Skip to content

Panic when compiling gluon on 1.46 #75313

@nukeop

Description

@nukeop

I created an empty hello world project with Cargo, added the "gluon" library to it, then tried to compile.
I understand this is something more than just an incompatibility between the nightly compiler and the library.
Does not occur on stable.

Code

There's no code, I added gluon = "0.16.1" to Cargo.toml of an empty project.

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (6c8927b0c 2020-07-26)
binary: rustc
commit-hash: 6c8927b0cf80ceee19386026cf9d7fd4fd9d486f
commit-date: 2020-07-26
host: x86_64-unknown-linux-gnu
release: 1.47.0-nightly
LLVM version: 10.0

Error output

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:814 ~ gluon[bf1c]::std_lib[0]::regex[0]::load[0]), const_param_did: None }) (end of phase Optimized) at bb26[20]:            
encountered `Assign` statement with incompatible types:                                                                                                                                                          
left-hand side has type: fn(&std_lib::regex::Regex, &str) -> std::option::Option<vm::api::Collect<impl std::iter::Iterator>>                                                                                     
right-hand side has type: for<'r, 's> fn(&'r std_lib::regex::Regex, &'s str) -> std::option::Option<vm::api::Collect<impl std::iter::Iterator>>                                                                  
  --> /home/jcd/.cargo/registry/src/github.com-1ecc6299db9ec823/gluon-0.16.1/src/std_lib/regex.rs:90:39                                                                                                          
   |                                                                                                                                                                                                             
90 |             captures => primitive!(2, std::regex::prim::captures),                                                                                                                                          
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                            
   |                                                                                                                                                                                                             
   = note: delayed at src/librustc_mir/transform/validate.rs:140:36                                                                                                                                              
                                                                                                                                                                                                                 
error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:2715 ~ gluon[bf1c]::std_lib[0]::regex[0]::load[0]::wrapper[3]), const_param_did: None }) (end of phase Optimized) at bb0[0]: 
encountered `Assign` statement with incompatible types:                                                                                                                                                          
left-hand side has type: fn(&std_lib::regex::Regex, &str) -> std::option::Option<vm::api::Collect<impl std::iter::Iterator>>                                                                                     
right-hand side has type: for<'r, 's> fn(&'r std_lib::regex::Regex, &'s str) -> std::option::Option<vm::api::Collect<impl std::iter::Iterator>>                                                                  
  --> /home/jcd/.cargo/registry/src/github.com-1ecc6299db9ec823/gluon-0.16.1/src/std_lib/regex.rs:90:39                                                                                                          
   |                                                                                                                                                                                                             
90 |             captures => primitive!(2, std::regex::prim::captures),                                                                                                                                          
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                                                
   = note: delayed at src/librustc_mir/transform/validate.rs:140:36

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.47.0-nightly (6c8927b0c 2020-07-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: could not compile `gluon`.

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions