Tweak output for invalid negative impl AST errors

This commit is contained in:
Esteban Küber 2020-03-04 16:15:23 -08:00
parent 2b0cfa5b4c
commit 91525fd078
18 changed files with 56 additions and 52 deletions

View file

@ -1,8 +1,8 @@
error[E0198]: negative impls cannot be unsafe
--> $DIR/coherence-negative-impls-safe.rs:7:1
--> $DIR/coherence-negative-impls-safe.rs:7:13
|
LL | unsafe impl !Send for TestType {}
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ------ ^^^^^
| |
| unsafe because of this

View file

@ -2,7 +2,7 @@ error[E0197]: inherent impls cannot be unsafe
--> $DIR/E0197.rs:3:1
|
LL | unsafe impl Foo { }
| ------^^^^^^^^^^^^^
| ^^^^^^ ^^^ inherent impl for this type
| |
| unsafe because of this

View file

@ -1,8 +1,8 @@
error[E0198]: negative impls cannot be unsafe
--> $DIR/E0198.rs:5:1
--> $DIR/E0198.rs:5:13
|
LL | unsafe impl !Send for Foo { }
| ------^^^^^^^^^^^^^^^^^^^^^^^
| ------ ^^^^^
| |
| unsafe because of this

View file

@ -8,10 +8,10 @@ LL | auto trait AutoDummyTrait {}
= help: add `#![feature(optin_builtin_traits)]` to the crate attributes to enable
error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now
--> $DIR/feature-gate-optin-builtin-traits.rs:9:1
--> $DIR/feature-gate-optin-builtin-traits.rs:9:6
|
LL | impl !AutoDummyTrait for DummyStruct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^
|
= note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
= help: add `#![feature(optin_builtin_traits)]` to the crate attributes to enable

View file

@ -1,18 +1,18 @@
error: inherent impls cannot be `const`
--> $DIR/inherent-impl.rs:9:1
--> $DIR/inherent-impl.rs:9:6
|
LL | impl const S {}
| ^^^^^-----^^^^^
| ^^^^^ ^ inherent impl for this type
| |
| `const` because of this
|
= note: only trait implementations may be annotated with `const`
error: inherent impls cannot be `const`
--> $DIR/inherent-impl.rs:12:1
--> $DIR/inherent-impl.rs:12:6
|
LL | impl const T {}
| ^^^^^-----^^^^^
| ^^^^^ ^ inherent impl for this type
| |
| `const` because of this
|

View file

@ -2,7 +2,7 @@ error: inherent impls cannot be `default`
--> $DIR/validation.rs:7:1
|
LL | default impl S {}
| -------^^^^^^^
| ^^^^^^^ ^ inherent impl for this type
| |
| `default` because of this
|

View file

@ -1,8 +1,8 @@
error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now
--> $DIR/syntax-trait-polarity-feature-gate.rs:7:1
--> $DIR/syntax-trait-polarity-feature-gate.rs:7:6
|
LL | impl !Send for TestType {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^
|
= note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
= help: add `#![feature(optin_builtin_traits)]` to the crate attributes to enable

View file

@ -1,28 +1,28 @@
error: inherent impls cannot be negative
--> $DIR/syntax-trait-polarity.rs:7:1
--> $DIR/syntax-trait-polarity.rs:7:6
|
LL | impl !TestType {}
| ^^^^^^^^^^^^^^^^^
| ^
error[E0198]: negative impls cannot be unsafe
--> $DIR/syntax-trait-polarity.rs:12:1
--> $DIR/syntax-trait-polarity.rs:12:13
|
LL | unsafe impl !Send for TestType {}
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ------ ^^^^^
| |
| unsafe because of this
error: inherent impls cannot be negative
--> $DIR/syntax-trait-polarity.rs:19:1
--> $DIR/syntax-trait-polarity.rs:19:9
|
LL | impl<T> !TestType2<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error[E0198]: negative impls cannot be unsafe
--> $DIR/syntax-trait-polarity.rs:22:1
--> $DIR/syntax-trait-polarity.rs:22:16
|
LL | unsafe impl<T> !Send for TestType2<T> {}
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ------ ^^^^^
| |
| unsafe because of this

View file

@ -1,14 +1,10 @@
error[E0197]: inherent impls cannot be unsafe
--> $DIR/trait-safety-inherent-impl.rs:5:1
|
LL | unsafe impl SomeStruct {
| ^-----
| |
| _unsafe because of this
LL | unsafe impl SomeStruct {
| ^^^^^^ ^^^^^^^^^^ inherent impl for this type
| |
LL | | fn foo(self) { }
LL | | }
| |_^
| unsafe because of this
error: aborting due to previous error