2015-04-03 04:13:52 +00:00
|
|
|
// Test that unsupported uses of `Self` in impls don't crash
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
type Baz;
|
|
|
|
}
|
|
|
|
|
2015-04-07 05:59:10 +00:00
|
|
|
trait SuperFoo {
|
|
|
|
type SuperBaz;
|
|
|
|
}
|
|
|
|
|
2015-04-03 04:13:52 +00:00
|
|
|
impl Foo for Bar {
|
|
|
|
type Baz = bool;
|
|
|
|
}
|
|
|
|
|
2015-04-07 05:59:10 +00:00
|
|
|
impl SuperFoo for Bar {
|
|
|
|
type SuperBaz = bool;
|
|
|
|
}
|
|
|
|
|
2015-04-03 04:13:52 +00:00
|
|
|
impl Bar {
|
|
|
|
fn f() {
|
|
|
|
let _: <Self>::Baz = true;
|
2016-08-06 03:41:25 +00:00
|
|
|
//~^ ERROR ambiguous associated type
|
2015-04-03 04:13:52 +00:00
|
|
|
let _: Self::Baz = true;
|
2016-08-06 03:41:25 +00:00
|
|
|
//~^ ERROR ambiguous associated type
|
2015-04-03 04:13:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|