Closed
Description
I tried this code:
trait T2: T1 {
fn say_bye(&self);
}
trait T1: T2 {
fn say_hello(&self);
}
impl T1 for i32 {
fn say_hello(&self) {
println!("Hello {}!", self);
}
}
impl T2 for i32 {
fn say_bye(&self) {
println!("Bye {}?", self);
}
}
fn main() {
let n = 16;
n.say_hello();
n.say_bye();
}
I expected to see this happen: compilation error about cycle in traits T1,T2
Instead, this happened: compiler panicked
Meta
rustc --version --verbose
:
rustc 1.32.0 (9fda7c2 2019-01-16)
binary: rustc
commit-hash: 9fda7c2
commit-date: 2019-01-16
host: x86_64-unknown-linux-gnu
release: 1.32.0
LLVM version: 8.0