From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/rfc-2093-infer-outlives/cross-crate.rs | 8 ---- .../ui/rfc-2093-infer-outlives/cross-crate.stderr | 10 ----- .../rfc-2093-infer-outlives/dont-infer-static.rs | 12 ------ .../dont-infer-static.stderr | 19 --------- src/test/ui/rfc-2093-infer-outlives/enum.rs | 27 ------------ src/test/ui/rfc-2093-infer-outlives/enum.stderr | 26 ------------ .../ui/rfc-2093-infer-outlives/explicit-dyn.rs | 12 ------ .../ui/rfc-2093-infer-outlives/explicit-dyn.stderr | 10 ----- .../ui/rfc-2093-infer-outlives/explicit-enum.rs | 13 ------ .../rfc-2093-infer-outlives/explicit-enum.stderr | 10 ----- .../rfc-2093-infer-outlives/explicit-projection.rs | 13 ------ .../explicit-projection.stderr | 10 ----- .../ui/rfc-2093-infer-outlives/explicit-struct.rs | 13 ------ .../rfc-2093-infer-outlives/explicit-struct.stderr | 10 ----- .../ui/rfc-2093-infer-outlives/explicit-union.rs | 14 ------- .../rfc-2093-infer-outlives/explicit-union.stderr | 10 ----- src/test/ui/rfc-2093-infer-outlives/issue-54467.rs | 17 -------- src/test/ui/rfc-2093-infer-outlives/nested-enum.rs | 13 ------ .../ui/rfc-2093-infer-outlives/nested-enum.stderr | 10 ----- .../ui/rfc-2093-infer-outlives/nested-regions.rs | 8 ---- .../rfc-2093-infer-outlives/nested-regions.stderr | 12 ------ .../ui/rfc-2093-infer-outlives/nested-structs.rs | 12 ------ .../rfc-2093-infer-outlives/nested-structs.stderr | 10 ----- .../ui/rfc-2093-infer-outlives/nested-union.rs | 14 ------- .../ui/rfc-2093-infer-outlives/nested-union.stderr | 10 ----- src/test/ui/rfc-2093-infer-outlives/privacy.rs | 20 --------- src/test/ui/rfc-2093-infer-outlives/projection.rs | 8 ---- .../ui/rfc-2093-infer-outlives/projection.stderr | 10 ----- src/test/ui/rfc-2093-infer-outlives/reference.rs | 8 ---- .../ui/rfc-2093-infer-outlives/reference.stderr | 10 ----- .../rfc-2093-infer-outlives/regions-enum-not-wf.rs | 39 ------------------ .../regions-enum-not-wf.stderr | 36 ---------------- .../regions-outlives-nominal-type-region-rev.rs | 22 ---------- ...regions-outlives-nominal-type-region-rev.stderr | 20 --------- .../regions-outlives-nominal-type-region.rs | 22 ---------- .../regions-outlives-nominal-type-region.stderr | 20 --------- .../regions-outlives-nominal-type-type-rev.rs | 22 ---------- .../regions-outlives-nominal-type-type-rev.stderr | 20 --------- .../regions-outlives-nominal-type-type.rs | 22 ---------- .../regions-outlives-nominal-type-type.stderr | 20 --------- .../regions-struct-not-wf.rs | 28 ------------- .../regions-struct-not-wf.stderr | 48 ---------------------- src/test/ui/rfc-2093-infer-outlives/self-dyn.rs | 13 ------ .../ui/rfc-2093-infer-outlives/self-dyn.stderr | 10 ----- .../ui/rfc-2093-infer-outlives/self-structs.rs | 13 ------ .../ui/rfc-2093-infer-outlives/self-structs.stderr | 10 ----- 46 files changed, 744 deletions(-) delete mode 100644 src/test/ui/rfc-2093-infer-outlives/cross-crate.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/enum.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/enum.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-union.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/issue-54467.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-enum.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-regions.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-structs.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-union.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/nested-union.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/privacy.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/projection.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/projection.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/reference.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/reference.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/self-dyn.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr delete mode 100644 src/test/ui/rfc-2093-infer-outlives/self-structs.rs delete mode 100644 src/test/ui/rfc-2093-infer-outlives/self-structs.stderr (limited to 'src/test/ui/rfc-2093-infer-outlives') 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 { - bar: Bar //~ ERROR the parameter type `U` may not live long enough [E0310] -} -struct Bar { - 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 - | ^^^^^^ ...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 { - | ^^^^^^^ -help: consider adding an explicit lifetime bound... - | -LL | struct Foo { - | +++++++++ - -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) -} - -struct Yang { - 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> -} - -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: >::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 -// `>::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> -} - -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 ` 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 as Private>::Out> -} - -trait Private { - type Out: ?Sized; -} - -impl 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: ::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> = >::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 { - 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 { - 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> -} - -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 - -- cgit v1.2.3