diff options
Diffstat (limited to '')
8 files changed, 38 insertions, 9 deletions
diff --git a/tests/ui/auto-traits/auto-trait-validation.stderr b/tests/ui/auto-traits/auto-trait-validation.stderr index 2c380e5b0..89b63d23d 100644 --- a/tests/ui/auto-traits/auto-trait-validation.stderr +++ b/tests/ui/auto-traits/auto-trait-validation.stderr @@ -12,7 +12,7 @@ error[E0568]: auto traits cannot have super traits or lifetime bounds LL | auto trait Bound : Copy {} | -----^^^^^^^ help: remove the super traits or lifetime bounds | | - | auto trait cannot have super traits or lifetime bounds + | auto traits cannot have super traits or lifetime bounds error[E0568]: auto traits cannot have super traits or lifetime bounds --> $DIR/auto-trait-validation.rs:9:25 @@ -20,7 +20,7 @@ error[E0568]: auto traits cannot have super traits or lifetime bounds LL | auto trait LifetimeBound : 'static {} | -------------^^^^^^^^^^ help: remove the super traits or lifetime bounds | | - | auto trait cannot have super traits or lifetime bounds + | auto traits cannot have super traits or lifetime bounds error[E0380]: auto traits cannot have associated items --> $DIR/auto-trait-validation.rs:11:25 @@ -29,7 +29,7 @@ LL | auto trait MyTrait { fn foo() {} } | ------- ---^^^----- | | | | | help: remove these associated items - | auto trait cannot have associated items + | auto traits cannot have associated items error: aborting due to 4 previous errors diff --git a/tests/ui/auto-traits/issue-23080-2.stderr b/tests/ui/auto-traits/issue-23080-2.stderr index 267a712f6..fed485612 100644 --- a/tests/ui/auto-traits/issue-23080-2.stderr +++ b/tests/ui/auto-traits/issue-23080-2.stderr @@ -2,7 +2,7 @@ error[E0380]: auto traits cannot have associated items --> $DIR/issue-23080-2.rs:5:10 | LL | unsafe auto trait Trait { - | ----- auto trait cannot have associated items + | ----- auto traits cannot have associated items LL | type Output; | -----^^^^^^- help: remove these associated items diff --git a/tests/ui/auto-traits/issue-23080.stderr b/tests/ui/auto-traits/issue-23080.stderr index c1b16b2f4..f5d607298 100644 --- a/tests/ui/auto-traits/issue-23080.stderr +++ b/tests/ui/auto-traits/issue-23080.stderr @@ -2,7 +2,7 @@ error[E0380]: auto traits cannot have associated items --> $DIR/issue-23080.rs:5:8 | LL | unsafe auto trait Trait { - | ----- auto trait cannot have associated items + | ----- auto traits cannot have associated items LL | fn method(&self) { | _____- ^^^^^^ LL | | println!("Hello"); diff --git a/tests/ui/auto-traits/issue-84075.stderr b/tests/ui/auto-traits/issue-84075.stderr index 02dca598e..6fbdc669b 100644 --- a/tests/ui/auto-traits/issue-84075.stderr +++ b/tests/ui/auto-traits/issue-84075.stderr @@ -4,7 +4,7 @@ error[E0568]: auto traits cannot have super traits or lifetime bounds LL | auto trait Magic where Self: Copy {} | ----- ^^^^^^^^^^^^^^^^ help: remove the super traits or lifetime bounds | | - | auto trait cannot have super traits or lifetime bounds + | auto traits cannot have super traits or lifetime bounds error: aborting due to previous error diff --git a/tests/ui/auto-traits/str-contains-slice-conceptually.rs b/tests/ui/auto-traits/str-contains-slice-conceptually.rs new file mode 100644 index 000000000..6a16fdcf2 --- /dev/null +++ b/tests/ui/auto-traits/str-contains-slice-conceptually.rs @@ -0,0 +1,13 @@ +#![feature(negative_impls)] +#![feature(auto_traits)] + +auto trait AutoTrait {} + +impl<T> !AutoTrait for [T] {} + +fn needs_auto_trait<T: AutoTrait + ?Sized>() {} + +fn main() { + needs_auto_trait::<str>(); + //~^ ERROR the trait bound `[u8]: AutoTrait` is not satisfied in `str` +} diff --git a/tests/ui/auto-traits/str-contains-slice-conceptually.stderr b/tests/ui/auto-traits/str-contains-slice-conceptually.stderr new file mode 100644 index 000000000..1cf16cebd --- /dev/null +++ b/tests/ui/auto-traits/str-contains-slice-conceptually.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `[u8]: AutoTrait` is not satisfied in `str` + --> $DIR/str-contains-slice-conceptually.rs:11:22 + | +LL | needs_auto_trait::<str>(); + | ^^^ within `str`, the trait `AutoTrait` is not implemented for `[u8]` + | + = note: `str` is considered to contain a `[u8]` slice for auto trait purposes +note: required by a bound in `needs_auto_trait` + --> $DIR/str-contains-slice-conceptually.rs:8:24 + | +LL | fn needs_auto_trait<T: AutoTrait + ?Sized>() {} + | ^^^^^^^^^ required by this bound in `needs_auto_trait` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.stderr b/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.stderr index 4827916fa..547b4bb54 100644 --- a/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.stderr +++ b/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.stderr @@ -4,7 +4,7 @@ error[E0568]: auto traits cannot have super traits or lifetime bounds LL | auto trait Magic : Sized where Option<Self> : Magic {} | -----^^^^^^^^ help: remove the super traits or lifetime bounds | | - | auto trait cannot have super traits or lifetime bounds + | auto traits cannot have super traits or lifetime bounds error[E0568]: auto traits cannot have super traits or lifetime bounds --> $DIR/typeck-auto-trait-no-supertraits-2.rs:4:26 @@ -12,7 +12,7 @@ error[E0568]: auto traits cannot have super traits or lifetime bounds LL | auto trait Magic : Sized where Option<Self> : Magic {} | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the super traits or lifetime bounds | | - | auto trait cannot have super traits or lifetime bounds + | auto traits cannot have super traits or lifetime bounds error: aborting due to 2 previous errors diff --git a/tests/ui/auto-traits/typeck-auto-trait-no-supertraits.stderr b/tests/ui/auto-traits/typeck-auto-trait-no-supertraits.stderr index d7716f4b6..80f074103 100644 --- a/tests/ui/auto-traits/typeck-auto-trait-no-supertraits.stderr +++ b/tests/ui/auto-traits/typeck-auto-trait-no-supertraits.stderr @@ -4,7 +4,7 @@ error[E0568]: auto traits cannot have super traits or lifetime bounds LL | auto trait Magic: Copy {} | -----^^^^^^ help: remove the super traits or lifetime bounds | | - | auto trait cannot have super traits or lifetime bounds + | auto traits cannot have super traits or lifetime bounds error: aborting due to previous error |