diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/rfc-2093-infer-outlives | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/rfc-2093-infer-outlives')
46 files changed, 0 insertions, 744 deletions
diff --git a/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs b/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs deleted file mode 100644 index a9bfeabf1..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/cross-crate.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'a, T> { //~ ERROR rustc_outlives - bar: std::slice::IterMut<'a, T> -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr deleted file mode 100644 index 76300cce5..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/cross-crate.rs:4:1 - | -LL | struct Foo<'a, T> { - | ^^^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs deleted file mode 100644 index d3940b13b..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* - * We don't infer `T: 'static` outlives relationships. - */ - -struct Foo<U> { - bar: Bar<U> //~ ERROR the parameter type `U` may not live long enough [E0310] -} -struct Bar<T: 'static> { - x: T, -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr deleted file mode 100644 index 0c388f5fe..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0310]: the parameter type `U` may not live long enough - --> $DIR/dont-infer-static.rs:6:10 - | -LL | bar: Bar<U> - | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/dont-infer-static.rs:8:15 - | -LL | struct Bar<T: 'static> { - | ^^^^^^^ -help: consider adding an explicit lifetime bound... - | -LL | struct Foo<U: 'static> { - | +++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.rs b/src/test/ui/rfc-2093-infer-outlives/enum.rs deleted file mode 100644 index 71d2d3222..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/enum.rs +++ /dev/null @@ -1,27 +0,0 @@ -#![feature(rustc_attrs)] - -// Needs an explicit where clause stating outlives condition. (RFC 2093) - -// Type T needs to outlive lifetime 'a. -#[rustc_outlives] -enum Foo<'a, T> { //~ ERROR rustc_outlives - One(Bar<'a, T>) -} - -// Type U needs to outlive lifetime 'b -#[rustc_outlives] -struct Bar<'b, U> { //~ ERROR rustc_outlives - field2: &'b U -} - -// Type K needs to outlive lifetime 'c. -#[rustc_outlives] -enum Ying<'c, K> { //~ ERROR rustc_outlives - One(&'c Yang<K>) -} - -struct Yang<V> { - field2: V -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.stderr b/src/test/ui/rfc-2093-infer-outlives/enum.stderr deleted file mode 100644 index b6ce2450e..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/enum.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: rustc_outlives - --> $DIR/enum.rs:7:1 - | -LL | enum Foo<'a, T> { - | ^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: rustc_outlives - --> $DIR/enum.rs:13:1 - | -LL | struct Bar<'b, U> { - | ^^^^^^^^^^^^^^^^^ - | - = note: U: 'b - -error: rustc_outlives - --> $DIR/enum.rs:19:1 - | -LL | enum Ying<'c, K> { - | ^^^^^^^^^^^^^^^^ - | - = note: K: 'c - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs deleted file mode 100644 index 419fb0a0e..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![feature(rustc_attrs)] - -trait Trait<'x, T> where T: 'x { -} - -#[rustc_outlives] -struct Foo<'a, A> //~ ERROR rustc_outlives -{ - foo: Box<dyn Trait<'a, A>> -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr deleted file mode 100644 index 595a5c280..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/explicit-dyn.rs:7:1 - | -LL | struct Foo<'a, A> - | ^^^^^^^^^^^^^^^^^ - | - = note: A: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs deleted file mode 100644 index c330c27fe..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -enum Foo<'a, U> { //~ ERROR rustc_outlives - One(Bar<'a, U>) -} - -struct Bar<'x, T> where T: 'x { - x: &'x (), - y: T, -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr deleted file mode 100644 index 3059f95ae..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/explicit-enum.rs:4:1 - | -LL | enum Foo<'a, U> { - | ^^^^^^^^^^^^^^^ - | - = note: U: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs deleted file mode 100644 index 00b895288..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(rustc_attrs)] - -trait Trait<'x, T> where T: 'x { - type Type; -} - -#[rustc_outlives] -struct Foo<'a, A, B> where A: Trait<'a, B> //~ ERROR rustc_outlives -{ - foo: <A as Trait<'a, B>>::Type -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr deleted file mode 100644 index 589e95899..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/explicit-projection.rs:8:1 - | -LL | struct Foo<'a, A, B> where A: Trait<'a, B> - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: B: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs deleted file mode 100644 index 3d5e610b9..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'b, U> { //~ ERROR rustc_outlives - bar: Bar<'b, U> -} - -struct Bar<'a, T> where T: 'a { - x: &'a (), - y: T, -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr deleted file mode 100644 index 9912e36b2..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/explicit-struct.rs:4:1 - | -LL | struct Foo<'b, U> { - | ^^^^^^^^^^^^^^^^^ - | - = note: U: 'b - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs b/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs deleted file mode 100644 index 871208b5b..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-union.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -union Foo<'b, U: Copy> { //~ ERROR rustc_outlives - bar: Bar<'b, U> -} - -#[derive(Clone, Copy)] -union Bar<'a, T: Copy> where T: 'a { - x: &'a (), - y: T, -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr deleted file mode 100644 index 16b64bdc2..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/explicit-union.rs:4:1 - | -LL | union Foo<'b, U: Copy> { - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: U: 'b - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs b/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs deleted file mode 100644 index c712f15e3..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Regression test for #54467: -// -// Here, the trait object has an "inferred outlives" requirement that -// `<Self as MyIterator<'a>>::Item: 'a`; but since we don't know what -// `Self` is, we were (incorrectly) messing things up, leading to -// strange errors. This test ensures that we do not give compilation -// errors. -// -// check-pass - -trait MyIterator<'a>: Iterator where Self::Item: 'a { } - -struct MyStruct<'a, A> { - item: Box<dyn MyIterator<'a, Item = A>> -} - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs b/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs deleted file mode 100644 index 0cd706e7a..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-enum.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -enum Foo<'a, T> { //~ ERROR rustc_outlives - - One(Bar<'a, T>) -} - -struct Bar<'b, U> { - field2: &'b U -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr deleted file mode 100644 index 4350e6e8b..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/nested-enum.rs:4:1 - | -LL | enum Foo<'a, T> { - | ^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs b/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs deleted file mode 100644 index a01c50681..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-regions.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'a, 'b, T> { //~ ERROR rustc_outlives - x: &'a &'b T -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr deleted file mode 100644 index c08add7ed..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error: rustc_outlives - --> $DIR/nested-regions.rs:4:1 - | -LL | struct Foo<'a, 'b, T> { - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: 'b: 'a - = note: T: 'a - = note: T: 'b - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs b/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs deleted file mode 100644 index ac6817d22..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-structs.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'a, T> { //~ ERROR rustc_outlives - field1: Bar<'a, T> -} - -struct Bar<'b, U> { - field2: &'b U -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr deleted file mode 100644 index 769555234..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/nested-structs.rs:4:1 - | -LL | struct Foo<'a, T> { - | ^^^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-union.rs b/src/test/ui/rfc-2093-infer-outlives/nested-union.rs deleted file mode 100644 index 27ebd0b54..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-union.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -union Foo<'a, T: Copy> { //~ ERROR rustc_outlives - field1: Bar<'a, T> -} - -// Type U needs to outlive lifetime 'b -#[derive(Clone, Copy)] -union Bar<'b, U: Copy> { - field2: &'b U -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr deleted file mode 100644 index a785c63ce..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/nested-union.rs:4:1 - | -LL | union Foo<'a, T: Copy> { - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/privacy.rs b/src/test/ui/rfc-2093-infer-outlives/privacy.rs deleted file mode 100644 index 180f5ac6c..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/privacy.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Test that we do not get a privacy error here. Initially, we did, -// because we inferred an outlives predciate of `<Foo<'a> as -// Private>::Out: 'a`, but the private trait is -- well -- private, -// and hence it was not something that a pub trait could refer to. -// -// run-pass - -#![allow(dead_code)] - -pub struct Foo<'a> { - field: Option<&'a <Foo<'a> as Private>::Out> -} - -trait Private { - type Out: ?Sized; -} - -impl<T: ?Sized> Private for T { type Out = Self; } - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/projection.rs b/src/test/ui/rfc-2093-infer-outlives/projection.rs deleted file mode 100644 index 411c86da1..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/projection.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'a, T: Iterator> { //~ ERROR rustc_outlives - bar: &'a T::Item -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/projection.stderr b/src/test/ui/rfc-2093-infer-outlives/projection.stderr deleted file mode 100644 index d9342013f..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/projection.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/projection.rs:4:1 - | -LL | struct Foo<'a, T: Iterator> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: <T as Iterator>::Item: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/reference.rs b/src/test/ui/rfc-2093-infer-outlives/reference.rs deleted file mode 100644 index a48a3315a..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/reference.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'a, T> { //~ ERROR rustc_outlives - bar: &'a T, -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/reference.stderr b/src/test/ui/rfc-2093-infer-outlives/reference.stderr deleted file mode 100644 index 508114357..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/reference.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/reference.rs:4:1 - | -LL | struct Foo<'a, T> { - | ^^^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs deleted file mode 100644 index 8b491ee4e..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Various examples of structs whose fields are not well-formed. - -#![allow(dead_code)] - -trait Dummy<'a> { - type Out; -} -impl<'a, T> Dummy<'a> for T -where - T: 'a, -{ - type Out = (); -} -type RequireOutlives<'a, T> = <T as Dummy<'a>>::Out; - -enum Ref1<'a, T> { - Ref1Variant1(RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough -} - -enum Ref2<'a, T> { - Ref2Variant1, - Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough -} - -enum RefOk<'a, T: 'a> { - RefOkVariant1(&'a T), -} - -// This is now well formed. RFC 2093 -enum RefIndirect<'a, T> { - RefIndirectVariant1(isize, RefOk<'a, T>), -} - -enum RefDouble<'a, 'b, T> { - RefDoubleVariant1(&'a RequireOutlives<'b, T>), - //~^ the parameter type `T` may not live long enough [E0309] -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr deleted file mode 100644 index 2c660b285..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:17:18 - | -LL | Ref1Variant1(RequireOutlives<'a, T>), - | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | enum Ref1<'a, T: 'a> { - | ++++ - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:22:25 - | -LL | Ref2Variant2(isize, RequireOutlives<'a, T>), - | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | enum Ref2<'a, T: 'a> { - | ++++ - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:35:23 - | -LL | RefDoubleVariant1(&'a RequireOutlives<'b, T>), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | enum RefDouble<'a, 'b, T: 'b> { - | ++++ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs deleted file mode 100644 index 36b024d2e..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its -// arguments (like `'a`) outlive `'b`. -// -// Rule OutlivesNominalType from RFC 1214. - - -#![allow(dead_code)] - -mod rev_variant_struct_region { - struct Foo<'a> { - x: fn(&'a i32), - } - trait Trait<'a, 'b> { - type Out; - } - impl<'a, 'b> Trait<'a, 'b> for usize { - type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime - } -} - - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr deleted file mode 100644 index 5dff4c8ff..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0491]: in type `&'a Foo<'b>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-nominal-type-region-rev.rs:17:20 - | -LL | type Out = &'a Foo<'b>; - | ^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-nominal-type-region-rev.rs:16:10 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-nominal-type-region-rev.rs:16:14 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs deleted file mode 100644 index 47a38f7c4..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its -// arguments (like `'a`) outlive `'b`. -// -// Rule OutlivesNominalType from RFC 1214. - - -#![allow(dead_code)] - -mod variant_struct_region { - struct Foo<'a> { - x: &'a i32, - } - trait Trait<'a, 'b> { - type Out; - } - impl<'a, 'b> Trait<'a, 'b> for usize { - type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime - } -} - - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr deleted file mode 100644 index 975776cdd..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0491]: in type `&'a Foo<'b>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-nominal-type-region.rs:17:20 - | -LL | type Out = &'a Foo<'b>; - | ^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-nominal-type-region.rs:16:10 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-nominal-type-region.rs:16:14 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs deleted file mode 100644 index 083ba8948..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its -// arguments (like `'a`) outlive `'b`. -// -// Rule OutlivesNominalType from RFC 1214. - - -#![allow(dead_code)] - -mod variant_struct_type { - struct Foo<T> { - x: fn(T) - } - trait Trait<'a, 'b> { - type Out; - } - impl<'a, 'b> Trait<'a, 'b> for usize { - type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime - } -} - - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr deleted file mode 100644 index be05ecec0..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0491]: in type `&'a Foo<&'b i32>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-nominal-type-type-rev.rs:17:20 - | -LL | type Out = &'a Foo<&'b i32>; - | ^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-nominal-type-type-rev.rs:16:10 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-nominal-type-type-rev.rs:16:14 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs deleted file mode 100644 index f3e4e39ac..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its -// arguments (like `'a`) outlive `'b`. -// -// Rule OutlivesNominalType from RFC 1214. - - -#![allow(dead_code)] - -mod variant_struct_type { - struct Foo<T> { - x: T - } - trait Trait<'a, 'b> { - type Out; - } - impl<'a, 'b> Trait<'a, 'b> for usize { - type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime - } -} - - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr deleted file mode 100644 index 4ba1778d6..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0491]: in type `&'a Foo<&'b i32>`, reference has a longer lifetime than the data it references - --> $DIR/regions-outlives-nominal-type-type.rs:17:20 - | -LL | type Out = &'a Foo<&'b i32>; - | ^^^^^^^^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-outlives-nominal-type-type.rs:16:10 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-outlives-nominal-type-type.rs:16:14 - | -LL | impl<'a, 'b> Trait<'a, 'b> for usize { - | ^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs deleted file mode 100644 index 552c6cf00..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Various examples of structs whose fields are not well-formed. - -#![allow(dead_code)] - -trait Trait<'a, T> { - type Out; -} -trait Trait1<'a, 'b, T> { - type Out; -} - -impl<'a, T> Trait<'a, T> for usize { - type Out = &'a T; //~ ERROR `T` may not live long enough -} - -struct RefOk<'a, T:'a> { - field: &'a T -} - -impl<'a, T> Trait<'a, T> for u32 { - type Out = RefOk<'a, T>; //~ ERROR `T` may not live long enough -} - -impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 { - type Out = &'a &'b T; //~ ERROR reference has a longer lifetime than the data -} - -fn main() { } diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr deleted file mode 100644 index 34ff1362c..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-struct-not-wf.rs:13:16 - | -LL | type Out = &'a T; - | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at - | -help: consider adding an explicit lifetime bound... - | -LL | impl<'a, T: 'a> Trait<'a, T> for usize { - | ++++ - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-struct-not-wf.rs:21:16 - | -LL | type Out = RefOk<'a, T>; - | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds... - | -note: ...that is required by this bound - --> $DIR/regions-struct-not-wf.rs:16:20 - | -LL | struct RefOk<'a, T:'a> { - | ^^ -help: consider adding an explicit lifetime bound... - | -LL | impl<'a, T: 'a> Trait<'a, T> for u32 { - | ++++ - -error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references - --> $DIR/regions-struct-not-wf.rs:25:16 - | -LL | type Out = &'a &'b T; - | ^^^^^^^^^ - | -note: the pointer is valid for the lifetime `'a` as defined here - --> $DIR/regions-struct-not-wf.rs:24:6 - | -LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 { - | ^^ -note: but the referenced data is only valid for the lifetime `'b` as defined here - --> $DIR/regions-struct-not-wf.rs:24:10 - | -LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 { - | ^^ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0309, E0491. -For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs b/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs deleted file mode 100644 index c53d6c18f..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/self-dyn.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(rustc_attrs)] - -trait Trait<'x, 's, T> where T: 'x, - 's: { -} - -#[rustc_outlives] -struct Foo<'a, 'b, A> //~ ERROR rustc_outlives -{ - foo: Box<dyn Trait<'a, 'b, A>> -} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr deleted file mode 100644 index 9c836b190..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/self-dyn.rs:8:1 - | -LL | struct Foo<'a, 'b, A> - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: A: 'a - -error: aborting due to previous error - diff --git a/src/test/ui/rfc-2093-infer-outlives/self-structs.rs b/src/test/ui/rfc-2093-infer-outlives/self-structs.rs deleted file mode 100644 index 8f2d29d6f..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/self-structs.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_outlives] -struct Foo<'a, 'b, T> { //~ ERROR rustc_outlives - field1: dyn Bar<'a, 'b, T> -} - -trait Bar<'x, 's, U> - where U: 'x, - Self:'s -{} - -fn main() {} diff --git a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr deleted file mode 100644 index 2b4625f77..000000000 --- a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: rustc_outlives - --> $DIR/self-structs.rs:4:1 - | -LL | struct Foo<'a, 'b, T> { - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: T: 'a - -error: aborting due to previous error - |