diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/auxiliary/issue-17662.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/issues/auxiliary/issue-17662.rs b/src/test/ui/issues/auxiliary/issue-17662.rs new file mode 100644 index 000000000..75efe110c --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-17662.rs @@ -0,0 +1,12 @@ +#![crate_type = "lib"] + +pub trait Foo<'a, T> { + fn foo(&'a self) -> T; +} + +pub fn foo<'a, T>(x: &'a Foo<'a, T>) -> T { + let x: &'a Foo<T> = x; + // ^ the lifetime parameter of Foo is left to be inferred. + x.foo() + // ^ encoding this method call in metadata triggers an ICE. +} |