diff options
Diffstat (limited to 'tests/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs')
-rw-r--r-- | tests/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs b/tests/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs new file mode 100644 index 000000000..73c4e577b --- /dev/null +++ b/tests/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs @@ -0,0 +1,14 @@ +trait Foo<'a> { + const C: &'a u32; +} + +impl<'a, T> Foo<'a> for T { + const C: &'a u32 = &22; +} + +fn foo<'a, T: Foo<'a>>() -> &'static u32 { + <T as Foo<'a>>::C //~ ERROR +} + +fn main() { +} |