diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
commit | 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch) | |
tree | 3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /src/test/ui/object-lifetime | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.tar.xz rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.zip |
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/object-lifetime')
-rw-r--r-- | src/test/ui/object-lifetime/object-lifetime-default.rs | 44 | ||||
-rw-r--r-- | src/test/ui/object-lifetime/object-lifetime-default.stderr | 60 |
2 files changed, 71 insertions, 33 deletions
diff --git a/src/test/ui/object-lifetime/object-lifetime-default.rs b/src/test/ui/object-lifetime/object-lifetime-default.rs index 60b6629e6..74f5bb7dd 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default.rs @@ -1,24 +1,50 @@ #![feature(rustc_attrs)] #[rustc_object_lifetime_default] -struct A<T>(T); //~ ERROR BaseDefault +struct A< + T, //~ ERROR BaseDefault +>(T); #[rustc_object_lifetime_default] -struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault +struct B< + 'a, + T, //~ ERROR BaseDefault +>(&'a (), T); #[rustc_object_lifetime_default] -struct C<'a,T:'a>(&'a T); //~ ERROR 'a +struct C< + 'a, + T: 'a, //~ ERROR 'a +>(&'a T); #[rustc_object_lifetime_default] -struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous +struct D< + 'a, + 'b, + T: 'a + 'b, //~ ERROR Ambiguous +>(&'a T, &'b T); #[rustc_object_lifetime_default] -struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b +struct E< + 'a, + 'b: 'a, + T: 'b, //~ ERROR 'b +>(&'a T, &'b T); #[rustc_object_lifetime_default] -struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b +struct F< + 'a, + 'b, + T: 'a, //~ ERROR 'a + U: 'b, //~ ERROR 'b +>(&'a T, &'b U); #[rustc_object_lifetime_default] -struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous - -fn main() { } +struct G< + 'a, + 'b, + T: 'a, //~ ERROR 'a + U: 'a + 'b, //~ ERROR Ambiguous +>(&'a T, &'b U); + +fn main() {} diff --git a/src/test/ui/object-lifetime/object-lifetime-default.stderr b/src/test/ui/object-lifetime/object-lifetime-default.stderr index 60cb98c8f..a58afad3e 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default.stderr @@ -1,44 +1,56 @@ error: BaseDefault - --> $DIR/object-lifetime-default.rs:4:1 + --> $DIR/object-lifetime-default.rs:5:5 | -LL | struct A<T>(T); - | ^^^^^^^^^^^^^^^ +LL | T, + | ^ error: BaseDefault - --> $DIR/object-lifetime-default.rs:7:1 + --> $DIR/object-lifetime-default.rs:11:5 | -LL | struct B<'a,T>(&'a (), T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | T, + | ^ error: 'a - --> $DIR/object-lifetime-default.rs:10:1 + --> $DIR/object-lifetime-default.rs:17:5 | -LL | struct C<'a,T:'a>(&'a T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | T: 'a, + | ^ error: Ambiguous - --> $DIR/object-lifetime-default.rs:13:1 + --> $DIR/object-lifetime-default.rs:24:5 | -LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | T: 'a + 'b, + | ^ error: 'b - --> $DIR/object-lifetime-default.rs:16:1 + --> $DIR/object-lifetime-default.rs:31:5 | -LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | T: 'b, + | ^ -error: 'a,'b - --> $DIR/object-lifetime-default.rs:19:1 +error: 'a + --> $DIR/object-lifetime-default.rs:38:5 + | +LL | T: 'a, + | ^ + +error: 'b + --> $DIR/object-lifetime-default.rs:39:5 | -LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | U: 'b, + | ^ -error: 'a,Ambiguous - --> $DIR/object-lifetime-default.rs:22:1 +error: 'a + --> $DIR/object-lifetime-default.rs:46:5 + | +LL | T: 'a, + | ^ + +error: Ambiguous + --> $DIR/object-lifetime-default.rs:47:5 | -LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | U: 'a + 'b, + | ^ -error: aborting due to 7 previous errors +error: aborting due to 9 previous errors |