summaryrefslogtreecommitdiffstats
path: root/tests/ui/phantom-auto-trait.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/phantom-auto-trait.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/phantom-auto-trait.stderr')
-rw-r--r--tests/ui/phantom-auto-trait.stderr66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/ui/phantom-auto-trait.stderr b/tests/ui/phantom-auto-trait.stderr
new file mode 100644
index 000000000..4769d53eb
--- /dev/null
+++ b/tests/ui/phantom-auto-trait.stderr
@@ -0,0 +1,66 @@
+error[E0277]: `T` cannot be shared between threads safely
+ --> $DIR/phantom-auto-trait.rs:21:12
+ |
+LL | is_zen(x)
+ | ------ ^ `T` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
+ |
+note: required for `&T` to implement `Zen`
+ --> $DIR/phantom-auto-trait.rs:10:24
+ |
+LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
+ | ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
+ = note: required because it appears within the type `PhantomData<&T>`
+note: required because it appears within the type `Guard<'_, T>`
+ --> $DIR/phantom-auto-trait.rs:12:8
+ |
+LL | struct Guard<'a, T: 'a> {
+ | ^^^^^
+note: required by a bound in `is_zen`
+ --> $DIR/phantom-auto-trait.rs:18:14
+ |
+LL | fn is_zen<T: Zen>(_: T) {}
+ | ^^^ required by this bound in `is_zen`
+help: consider restricting type parameter `T`
+ |
+LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
+ | +++++++++++++++++++
+
+error[E0277]: `T` cannot be shared between threads safely
+ --> $DIR/phantom-auto-trait.rs:26:12
+ |
+LL | is_zen(x)
+ | ------ ^ `T` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
+ |
+note: required for `&T` to implement `Zen`
+ --> $DIR/phantom-auto-trait.rs:10:24
+ |
+LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
+ | ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
+ = note: required because it appears within the type `PhantomData<&T>`
+note: required because it appears within the type `Guard<'_, T>`
+ --> $DIR/phantom-auto-trait.rs:12:8
+ |
+LL | struct Guard<'a, T: 'a> {
+ | ^^^^^
+note: required because it appears within the type `Nested<Guard<'_, T>>`
+ --> $DIR/phantom-auto-trait.rs:16:8
+ |
+LL | struct Nested<T>(T);
+ | ^^^^^^
+note: required by a bound in `is_zen`
+ --> $DIR/phantom-auto-trait.rs:18:14
+ |
+LL | fn is_zen<T: Zen>(_: T) {}
+ | ^^^ required by this bound in `is_zen`
+help: consider restricting type parameter `T`
+ |
+LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
+ | +++++++++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.