mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
31 lines
443 B
Rust
31 lines
443 B
Rust
// Test that unsupported uses of `Self` in impls don't crash
|
|
|
|
struct Bar;
|
|
|
|
trait Foo {
|
|
type Baz;
|
|
}
|
|
|
|
trait SuperFoo {
|
|
type SuperBaz;
|
|
}
|
|
|
|
impl Foo for Bar {
|
|
type Baz = bool;
|
|
}
|
|
|
|
impl SuperFoo for Bar {
|
|
type SuperBaz = bool;
|
|
}
|
|
|
|
impl Bar {
|
|
fn f() {
|
|
let _: <Self>::Baz = true;
|
|
//~^ ERROR ambiguous associated type
|
|
let _: Self::Baz = true;
|
|
//~^ ERROR ambiguous associated type
|
|
}
|
|
}
|
|
|
|
fn main() {}
|