Closed
Description
use std::ops::Add;
fn main() {
let x = &10 as &Add;
}
This code yields the following compile error:
% rustc addtrait.rs
addtrait.rs:4:21: 4:24 error: internal compiler error: Type parameter `Self/SelfSpace.0` (Self/SelfSpace/0) out of range when substituting (root type=Self) substs=Substs[types=[[];[];[]], regions=[[];[];[]]]
addtrait.rs:4 let x = &10 as &Add;
^~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /Users/ryama/tree/rust/src/libsyntax/diagnostic.rs:129