aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/unstable-features
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unstable-features')
-rw-r--r--tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr2
-rw-r--r--tests/ui/unstable-features/marker_trait_attr.stderr2
-rw-r--r--tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr2
-rw-r--r--tests/ui/unstable-features/overlapping_marker_traits.stderr4
-rw-r--r--tests/ui/unstable-features/trivial_bounds-bug.rs33
-rw-r--r--tests/ui/unstable-features/trivial_bounds-bug.stderr7
-rw-r--r--tests/ui/unstable-features/trivial_bounds-feature-gate.stderr32
-rw-r--r--tests/ui/unstable-features/trivial_bounds.rs16
-rw-r--r--tests/ui/unstable-features/trivial_bounds.stderr22
9 files changed, 41 insertions, 79 deletions
diff --git a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr
index 01e5080..3412f2e 100644
--- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr
+++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
- --> $DIR/marker_trait_attr-feature-gate.rs:7:1
+ --> tests/ui/unstable-features/marker_trait_attr-feature-gate.rs:7:1
|
7 | #[pin_project] //~ ERROR E0119
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/marker_trait_attr.stderr b/tests/ui/unstable-features/marker_trait_attr.stderr
index fbc2d9d..2b68c80 100644
--- a/tests/ui/unstable-features/marker_trait_attr.stderr
+++ b/tests/ui/unstable-features/marker_trait_attr.stderr
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
- --> $DIR/marker_trait_attr.rs:13:1
+ --> tests/ui/unstable-features/marker_trait_attr.rs:13:1
|
13 | #[pin_project] //~ ERROR E0119
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr
index 5eba425..918d804 100644
--- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr
+++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
- --> $DIR/overlapping_marker_traits-feature-gate.rs:7:1
+ --> tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs:7:1
|
7 | #[pin_project] //~ ERROR E0119
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/overlapping_marker_traits.stderr b/tests/ui/unstable-features/overlapping_marker_traits.stderr
index 706d6c9..3e8411d 100644
--- a/tests/ui/unstable-features/overlapping_marker_traits.stderr
+++ b/tests/ui/unstable-features/overlapping_marker_traits.stderr
@@ -1,5 +1,5 @@
error[E0557]: feature has been removed
- --> $DIR/overlapping_marker_traits.rs:11:12
+ --> tests/ui/unstable-features/overlapping_marker_traits.rs:11:12
|
11 | #![feature(overlapping_marker_traits)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
@@ -7,7 +7,7 @@ error[E0557]: feature has been removed
= note: removed in favor of `#![feature(marker_trait_attr)]`
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
- --> $DIR/overlapping_marker_traits.rs:17:1
+ --> tests/ui/unstable-features/overlapping_marker_traits.rs:17:1
|
17 | #[pin_project]
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/trivial_bounds-bug.rs b/tests/ui/unstable-features/trivial_bounds-bug.rs
deleted file mode 100644
index 5e821c4..0000000
--- a/tests/ui/unstable-features/trivial_bounds-bug.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Note: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time.
-
-// trivial_bounds
-// Tracking issue: https://github.com/rust-lang/rust/issues/48214
-#![feature(trivial_bounds)]
-
-mod phantom_pinned {
- use std::marker::{PhantomData, PhantomPinned};
-
- struct A(PhantomPinned);
-
- // bug of trivial_bounds?
- impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
-
- struct Wrapper<T>(T);
-
- impl<T> Unpin for Wrapper<T> where T: Unpin {}
-
- struct B(PhantomPinned);
-
- impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} // Ok
-
- struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T);
-
- impl<T> Unpin for WrapperWithLifetime<'_, T> where T: Unpin {}
-
- struct C(PhantomPinned);
-
- // Ok
- impl<'a> Unpin for C where WrapperWithLifetime<'a, PhantomPinned>: Unpin {}
-}
-
-fn main() {}
diff --git a/tests/ui/unstable-features/trivial_bounds-bug.stderr b/tests/ui/unstable-features/trivial_bounds-bug.stderr
deleted file mode 100644
index f2407d0..0000000
--- a/tests/ui/unstable-features/trivial_bounds-bug.stderr
+++ /dev/null
@@ -1,7 +0,0 @@
-error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-bug.rs:13:43
- |
-13 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
- | ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
- |
- = note: consider using `Box::pin`
diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr
index cf3b075..2e31658 100644
--- a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr
+++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr
@@ -1,30 +1,22 @@
error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-feature-gate.rs:8:5
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:8:28
|
8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
+ | ^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: consider using `Box::pin`
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-feature-gate.rs:8:43
- |
-8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
- | ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
- |
- = note: consider using `Box::pin`
-
-error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-feature-gate.rs:16:5
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:16:28
|
16 | impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} //~ ERROR E0277
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: consider using `Box::pin`
note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper<PhantomPinned>`
- --> $DIR/trivial_bounds-feature-gate.rs:12:13
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:12:13
|
12 | impl<T> Unpin for Wrapper<T> where T: Unpin {}
| ^^^^^ ^^^^^^^^^^
@@ -32,14 +24,14 @@ note: required because of the requirements on the impl of `Unpin` for `phantom_p
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-feature-gate.rs:34:5
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:34:28
|
34 | impl Unpin for A where Inner: Unpin {} //~ ERROR E0277
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
+ | ^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: consider using `Box::pin`
note: required because it appears within the type `Inner`
- --> $DIR/trivial_bounds-feature-gate.rs:30:12
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:30:12
|
30 | struct Inner(PhantomPinned);
| ^^^^^
@@ -47,19 +39,19 @@ note: required because it appears within the type `Inner`
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-feature-gate.rs:42:5
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:42:28
|
42 | impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR E0277
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
+ | ^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: consider using `Box::pin`
note: required because it appears within the type `Inner`
- --> $DIR/trivial_bounds-feature-gate.rs:30:12
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:30:12
|
30 | struct Inner(PhantomPinned);
| ^^^^^
note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper<Inner>`
- --> $DIR/trivial_bounds-feature-gate.rs:38:13
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:38:13
|
38 | impl<T> Unpin for Wrapper<T> where T: Unpin {}
| ^^^^^ ^^^^^^^^^^
diff --git a/tests/ui/unstable-features/trivial_bounds.rs b/tests/ui/unstable-features/trivial_bounds.rs
index 2323bab..41f885d 100644
--- a/tests/ui/unstable-features/trivial_bounds.rs
+++ b/tests/ui/unstable-features/trivial_bounds.rs
@@ -10,25 +10,29 @@ use std::marker::{PhantomData, PhantomPinned};
fn inner() {
struct Inner(PhantomPinned);
- struct A(Inner);
+ struct A(PhantomPinned);
- impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
+ impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
+
+ struct B(Inner);
+
+ impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
struct Wrapper<T>(T);
impl<T> Unpin for Wrapper<T> where T: Unpin {}
- struct B(Inner);
+ struct C(Inner);
- impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
+ impl Unpin for C where Wrapper<Inner>: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T);
impl<T> Unpin for WrapperWithLifetime<'_, T> where T: Unpin {}
- struct C(Inner);
+ struct D(Inner);
- impl<'a> Unpin for C where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok
+ impl<'a> Unpin for D where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok
}
fn main() {}
diff --git a/tests/ui/unstable-features/trivial_bounds.stderr b/tests/ui/unstable-features/trivial_bounds.stderr
index 6a3bb94..23f45c7 100644
--- a/tests/ui/unstable-features/trivial_bounds.stderr
+++ b/tests/ui/unstable-features/trivial_bounds.stderr
@@ -1,17 +1,23 @@
-error: Trait bound Inner: Unpin does not depend on any type or lifetime parameters
- --> $DIR/trivial_bounds.rs:15:35
+error: trait bound PhantomPinned: Unpin does not depend on any type or lifetime parameters
+ --> tests/ui/unstable-features/trivial_bounds.rs:15:43
|
-15 | impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
- | ^^^^^
+15 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
+ | ^^^^^
|
note: the lint level is defined here
- --> $DIR/trivial_bounds.rs:6:9
+ --> tests/ui/unstable-features/trivial_bounds.rs:6:9
|
6 | #![deny(trivial_bounds)]
| ^^^^^^^^^^^^^^
-error: Trait bound Wrapper<Inner>: Unpin does not depend on any type or lifetime parameters
- --> $DIR/trivial_bounds.rs:23:44
+error: trait bound Inner: Unpin does not depend on any type or lifetime parameters
+ --> tests/ui/unstable-features/trivial_bounds.rs:19:35
+ |
+19 | impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
+ | ^^^^^
+
+error: trait bound Wrapper<Inner>: Unpin does not depend on any type or lifetime parameters
+ --> tests/ui/unstable-features/trivial_bounds.rs:27:44
|
-23 | impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
+27 | impl Unpin for C where Wrapper<Inner>: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
| ^^^^^