diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-24308.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-24308.rs b/src/test/ui/issues/issue-24308.rs new file mode 100644 index 000000000..4a582c68e --- /dev/null +++ b/src/test/ui/issues/issue-24308.rs @@ -0,0 +1,17 @@ +// run-pass +pub trait Foo { + fn method1() {} + fn method2(); +} + +struct Slice<'a, T: 'a>(#[allow(unused_tuple_struct_fields)] &'a [T]); + +impl<'a, T: 'a> Foo for Slice<'a, T> { + fn method2() { + <Self as Foo>::method1(); + } +} + +fn main() { + <Slice<()> as Foo>::method2(); +} |