diff options
Diffstat (limited to 'src/test/ui/parser/bounds-type.rs')
-rw-r--r-- | src/test/ui/parser/bounds-type.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/parser/bounds-type.rs b/src/test/ui/parser/bounds-type.rs new file mode 100644 index 000000000..4ae4549ea --- /dev/null +++ b/src/test/ui/parser/bounds-type.rs @@ -0,0 +1,18 @@ +// compile-flags: -Z parse-only + +struct S< + T: 'a + Tr, // OK + T: Tr + 'a, // OK + T: 'a, // OK + T:, // OK + T: ?for<'a> Trait, // OK + T: Tr +, // OK + T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds + + T: ~const Tr, // OK + T: ~const ?Tr, // OK + T: ~const Tr + 'a, // OK + T: ~const 'a, //~ ERROR `~const` may only modify trait bounds, not lifetime bounds +>; + +fn main() {} |