diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-01-02 16:31:30 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-01-09 16:47:05 -0800 |
| commit | 343e1570a9b460e3dda85fe87fd6819df99d7943 (patch) | |
| tree | b1195e9d781a7f77ea9ed21c8127ab122d650456 /src/test/ui/parser | |
| parent | d843e002bb836be3164bef80d6218228aec974a8 (diff) | |
Add tests for RFC 2632
Diffstat (limited to 'src/test/ui/parser')
| -rw-r--r-- | src/test/ui/parser/bounds-type.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/parser/bounds-type.stderr | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/test/ui/parser/bounds-type.rs b/src/test/ui/parser/bounds-type.rs index 9122cb49ebc..7a187a0518a 100644 --- a/src/test/ui/parser/bounds-type.rs +++ b/src/test/ui/parser/bounds-type.rs @@ -8,6 +8,11 @@ struct S< 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() {} diff --git a/src/test/ui/parser/bounds-type.stderr b/src/test/ui/parser/bounds-type.stderr index 0b714e40a10..9a1f2ed3982 100644 --- a/src/test/ui/parser/bounds-type.stderr +++ b/src/test/ui/parser/bounds-type.stderr @@ -4,5 +4,11 @@ error: `?` may only modify trait bounds, not lifetime bounds LL | T: ?'a, | ^ -error: aborting due to previous error +error: `?const` may only modify trait bounds, not lifetime bounds + --> $DIR/bounds-type.rs:15:8 + | +LL | T: ?const 'a, + | ^^^^^^ + +error: aborting due to 2 previous errors |
