You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'static bound not enforced in borrowed trait coercion #10751
traitA{}impl<T:'static>AforT{}fnmain(){let a = 3;let b = &a;let c = &b as&A;}
Original Bug Report
fn main() {
let x = 42;
let ref_x = &x;
let any_x : &Any = &ref_x as &Any;
println!("{:?}", any_x);
}
Results in
error: internal compiler error: non-static region found when hashing a type
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
task 'rustc' failed at 'explicit failure', /Users/mitsuhiko/Development/rust/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/mitsuhiko/Development/rust/src/librustc/lib.rs:396
Activity
alexcrichton commentedon Dec 1, 2013
cc @nikomatsakis, this should have aborted much earlier in compilation. I've updated the title of the bug to be what the root cause is.
dmski commentedon Mar 25, 2014
Not sure if related to this issue, but this also compiles (taken from irc):
auto merge of #13228 : dmski/rust/trait-static-bound, r=brson
alexcrichton commentedon Jan 19, 2015
This issue has since been fixed, closing.
Auto merge of rust-lang#10751 - blyxyas:explain_with_config, r=xFrednet