-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-miriArea: The miri toolArea: The miri toolC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
The following ICEs (example by @eddyb):
#![feature(const_fn)]
const fn nested(x: (for<'a> fn(&'a ()), String)) -> (fn(&'static ()), String) {
x
}
pub const TEST: (fn(&'static ()), String) = nested((|_x| (), String::new()));
fn main() {}
shows
thread 'rustc' panicked at 'type mismatch when copying!
src: (for<'r> fn(&'r ()), std::string::String),
dest: (fn(&()), std::string::String)', /rustc/853c4774e26ea97b45fe74de9a6f68e526784323/src/libstd/macros.rs:16:9
This means that the check here is wrong. It might be possible to also trigger this without nightly features through const_prop.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-miriArea: The miri toolArea: The miri toolC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️