Skip to content

crosscompiling from x64 to i686 fail for crate macro_rules_attribute  #70158

Closed
@Kubikx

Description

@Kubikx

Example

https://docs.rs/macro_rules_attribute/0.0.1/macro_rules_attribute/#example

I found out about the issue after new team member joined and could not compile the the project
we later identified that the cause is that he have nightly-x86_64-pc-windows-msvc as default
using:
cargo build --lib --release --target=i686-pc-windows-msvc --verbose
causes:

     Running `rustc --crate-name macro_rules_attribute --edition=2018 C:\Users\xxxku\.cargo\registry\src\github.com-1ecc6299db9ec823\macro_rules_attribute-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=6d33a2ac94d8afdd -C extra-filename=-6d33a2ac94d8afdd --out-dir D:\cpp\proxy\target\i686-pc-windows-msvc\release\deps --target i686-pc-windows-msvc -L dependency=D:\cpp\proxy\target\i686-pc-windows-msvc\release\deps -L dependency=D:\cpp\proxy\target\release\deps --extern proc_macro=D:\cpp\proxy\target\release\deps\macro_rules_attribute_proc_macro-7dfb63828f9e9ef2.dll --cap-lints allow`
     
thread 'rustc' panicked at 'src\librustc_resolve\imports.rs:897: inconsistent resolution for an import', src\librustc_resolve\lib.rs:1:1
stack backtrace:
   0:     0x7fff443a975f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd03123af32678204
   1:     0x7fff443d645b - core::fmt::write::hd7e4da93b0f3f6cf
   2:     0x7fff44399fbc - <std::io::IoSlice as core::fmt::Debug>::fmt::hde06bc38d6d79e1b
   3:     0x7fff443aea0c - std::panicking::take_hook::h2d1d8b7f3a0f99f0
   4:     0x7fff443ae65f - std::panicking::take_hook::h2d1d8b7f3a0f99f0
   5:     0x7fff2630d28a - rustc_driver::report_ice::h81708fb20c592c8e
   6:     0x7fff443af2a8 - std::panicking::rust_panic_with_hook::hc4844992c2f458f0
   7:     0x7fff2878ffff - <rustc_resolve::imports::UnresolvedImportError as core::fmt::Debug>::fmt::h9734535dfbd031fd
   8:     0x7fff287cd896 - <rustc::middle::resolve_lifetime::Region as rustc_resolve::late::lifetimes::RegionExt>::shifted_out_to_binder::h144e678f8da85146
   9:     0x7fff287cd711 - <rustc::middle::resolve_lifetime::Region as rustc_resolve::late::lifetimes::RegionExt>::shifted_out_to_binder::h144e678f8da85146
  10:     0x7fff287cd673 - <rustc::middle::resolve_lifetime::Region as rustc_resolve::late::lifetimes::RegionExt>::shifted_out_to_binder::h144e678f8da85146
  11:     0x7fff287cd7cf - <rustc::middle::resolve_lifetime::Region as rustc_resolve::late::lifetimes::RegionExt>::shifted_out_to_binder::h144e678f8da85146
  12:     0x7fff287cd777 - <rustc::middle::resolve_lifetime::Region as rustc_resolve::late::lifetimes::RegionExt>::shifted_out_to_binder::h144e678f8da85146
  13:     0x7fff2878cc93 - rustc_resolve::imports::ImportResolver::finalize_imports::hce0049d9c84c8c0c
  14:     0x7fff287862fd - rustc_resolve::imports::ImportResolver::finalize_imports::hce0049d9c84c8c0c
  15:     0x7fff287522ca - rustc_resolve::Resolver::resolve_crate::h81965983eea3f464
  16:     0x7fff264ab32c - rustc_interface::passes::BoxedResolver::to_resolver_outputs::h3229fb634d1de4b6
  17:     0x7fff264c89e9 - rustc_interface::passes::BoxedResolver::complete::h413e13ca6256e1d7
  18:     0x7fff264b5674 - rustc_interface::passes::BoxedResolver::complete::h413e13ca6256e1d7
  19:     0x7fff264a9801 - rustc_interface::callbacks::setup_callbacks::h15cfb8d3c5a1bf19
  20:     0x7fff264cbfb2 - rustc_interface::queries::Queries::expansion::hb88ecea2335ddb8f
  21:     0x7fff26358da7 - <alloc::vec::Vec<rustc_ast::ast::Attribute> as rustc_ast::attr::HasAttrs>::attrs::hcf357fa16ec32aa4
  22:     0x7fff26313676 - <rustc_driver::DEFAULT_HOOK as core::ops::deref::Deref>::deref::h9fb2906f41fb910d
  23:     0x7fff2635bc23 - <alloc::vec::Vec<rustc_ast::ast::Attribute> as rustc_ast::attr::HasAttrs>::attrs::hcf357fa16ec32aa4
  24:     0x7fff44388687 - ZN244_$LT$std..error..$LT$impl$u20$core..convert..From$LT$alloc..string..String$GT$$u20$for$u20$alloc..boxed..Box$LT$dyn$u20$std..error..Error$u2b$core..marker..Sync$u2b$core..marker..Send$GT$$GT$..from..StringError$u20$as$u20$core..fmt..Display$GT$3fmt17
  25:     0x7fff443be6cc - std::sys::windows::thread::Thread::new::hc81dbcd4d803919c
  26:     0x7fff9ddb6fd4 - BaseThreadInitThunk
  27:     0x7fff9e05cf31 - RtlUserThreadStart

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f509b26a7 2020-03-18) running on x86_64-pc-windows-msvc

note: compiler flags: -C opt-level=3 --crate-type lib

we verified it on multiple version up to latest rustc 1.44.0-nightly (f509b26a7 2020-03-18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions