Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
cargo update -p zeroize --precise 1.6.0
cargo update -p pretty_assertions --precise 1.4.0
cargo update -p glob --precise 0.3.2
cargo update -p proc-macro2 --precise 1.0.80
- name: Build
run:
cargo build --workspace ${{ matrix.features }}
Expand Down Expand Up @@ -126,6 +127,7 @@ jobs:
run: |
cargo update -p zeroize --precise 1.6.0
cargo update -p pretty_assertions --precise 1.4.0
cargo update -p proc-macro2 --precise 1.0.80
- name: Build
run:
cargo build --target thumbv6m-none-eabi ${{ matrix.features }} -p ensure-no-std
Expand Down
8 changes: 5 additions & 3 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use proc_macro2::Ident;
#[cfg(not(feature = "nightly"))]
use {
proc_macro2::{Span, TokenStream, TokenTree},
quote::ToTokens,
proc_macro2::{Span, TokenStream},
quote::{quote, ToTokens},
syn::{punctuated::Punctuated, spanned::Spanned, Attribute, Meta, Result, Token, Variant},
};

Expand Down Expand Up @@ -252,7 +252,9 @@ impl Representation {
Representation::ISize => "isize",
};

TokenTree::from(Ident::new(ident, Span::call_site())).into()
let ident = Ident::new(ident, Span::call_site());

quote! {::core::primitive::#ident}
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/test/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn struct_() -> Result<()> {
#[automatically_derived]
impl<T> ::core::cmp::PartialEq for Test<T> {
#[inline]
fn eq(&self, __other: &Self) -> bool {
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
match (self, __other) {
(Test { field: ref __field_field }, Test { field: ref __other_field_field }) =>
true && ::core::cmp::PartialEq::eq(__field_field, __other_field_field),
Expand Down Expand Up @@ -192,7 +192,7 @@ fn tuple() -> Result<()> {
#[automatically_derived]
impl<T> ::core::cmp::PartialEq for Test<T> {
#[inline]
fn eq(&self, __other: &Self) -> bool {
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
match (self, __other) {
(Test(ref __field_0), Test(ref __other_field_0)) =>
true && ::core::cmp::PartialEq::eq(__field_0, __other_field_0),
Expand Down Expand Up @@ -229,7 +229,7 @@ fn enum_() -> Result<()> {
};
#[cfg(not(feature = "nightly"))]
let ord = quote! {
const fn __discriminant<T>(__this: &Test<T>) -> isize {
const fn __discriminant<T>(__this: &Test<T>) -> ::core::primitive::isize {
match __this {
Test::A { field: ref __field_field } => 0,
Test::B { } => 1,
Expand Down Expand Up @@ -374,7 +374,7 @@ fn enum_() -> Result<()> {
#[automatically_derived]
impl<T> ::core::cmp::PartialEq for Test<T> {
#[inline]
fn eq(&self, __other: &Self) -> bool {
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
if ::core::mem::discriminant(self) == ::core::mem::discriminant(__other) {
match (self, __other) {
(Test::A { field: ref __field_field }, Test::A { field: ref __other_field_field }) =>
Expand Down
4 changes: 2 additions & 2 deletions src/test/bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ fn check_trait_bounds() -> Result<()> {
where T: ::core::cmp::PartialEq
{
#[inline]
fn eq(&self, __other: &Self) -> bool {
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
match (self, __other) {
(Test(ref __field_0, ref __field_1), Test(ref __other_field_0, ref __other_field_1)) =>
true
Expand Down Expand Up @@ -457,7 +457,7 @@ fn check_multiple_trait_bounds() -> Result<()> {
U: ::core::cmp::PartialEq
{
#[inline]
fn eq(&self, __other: &Self) -> bool {
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
match (self, __other) {
(Test(ref __field_0, ref __field_1), Test(ref __other_field_0, ref __other_field_1)) =>
true
Expand Down
Loading
Loading