rust/tests/ui/phantom-auto-trait.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
2.3 KiB
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-auto-trait.rs:21:12
2018-08-08 12:28:26 +00:00
|
LL | is_zen(x)
| ------ ^ `T` cannot be shared between threads safely
| |
| required by a bound introduced by this call
2018-08-08 12:28:26 +00:00
|
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>) {
| +++++++++++++++++++
2018-08-08 12:28:26 +00:00
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-auto-trait.rs:26:12
2018-08-08 12:28:26 +00:00
|
LL | is_zen(x)
| ------ ^ `T` cannot be shared between threads safely
| |
| required by a bound introduced by this call
2018-08-08 12:28:26 +00:00
|
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>>) {
| +++++++++++++++++++
2018-08-08 12:28:26 +00:00
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.