Constness -> enum Const { Yes(Span), No }
Same idea for `Unsafety` & use new span for better diagnostics.
This commit is contained in:
parent
2e6eaceede
commit
e839b2ec84
40 changed files with 238 additions and 212 deletions
|
|
@ -2,7 +2,9 @@ error[E0198]: negative impls cannot be unsafe
|
|||
--> $DIR/coherence-negative-impls-safe.rs:7:1
|
||||
|
|
||||
LL | unsafe impl !Send for TestType {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| unsafe because of this
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
error: const parameters are not permitted in `const fn`
|
||||
--> $DIR/const-fn-with-const-param.rs:4:1
|
||||
|
|
||||
LL | / const fn const_u32_identity<const X: u32>() -> u32 {
|
||||
LL | const fn const_u32_identity<const X: u32>() -> u32 {
|
||||
| ^----
|
||||
| |
|
||||
| _`const fn` because of this
|
||||
| |
|
||||
LL | |
|
||||
LL | | X
|
||||
LL | | }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0197]: inherent impls cannot be unsafe
|
|||
--> $DIR/E0197.rs:3:1
|
||||
|
|
||||
LL | unsafe impl Foo { }
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
| ------^^^^^^^^^^^^^
|
||||
| |
|
||||
| unsafe because of this
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0198]: negative impls cannot be unsafe
|
|||
--> $DIR/E0198.rs:5:1
|
||||
|
|
||||
LL | unsafe impl !Send for Foo { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ------^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| unsafe because of this
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error: const trait impls are not yet implemented
|
|||
--> $DIR/feature-gate.rs:9:1
|
||||
|
|
||||
LL | impl const T for S {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^-----^^^^^^^^^^^
|
||||
| |
|
||||
| const because of this
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ error: const trait impls are not yet implemented
|
|||
--> $DIR/feature-gate.rs:9:1
|
||||
|
|
||||
LL | impl const T for S {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^-----^^^^^^^^^^^
|
||||
| |
|
||||
| const because of this
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error: inherent impls cannot be `const`
|
|||
--> $DIR/inherent-impl.rs:9:1
|
||||
|
|
||||
LL | impl const S {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^-----^^^^^
|
||||
| |
|
||||
| `const` because of this
|
||||
|
|
||||
= note: only trait implementations may be annotated with `const`
|
||||
|
||||
|
|
@ -10,7 +12,9 @@ error: inherent impls cannot be `const`
|
|||
--> $DIR/inherent-impl.rs:13:1
|
||||
|
|
||||
LL | impl const T {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^-----^^^^^
|
||||
| |
|
||||
| `const` because of this
|
||||
|
|
||||
= note: only trait implementations may be annotated with `const`
|
||||
|
||||
|
|
@ -18,13 +22,17 @@ error: const trait impls are not yet implemented
|
|||
--> $DIR/inherent-impl.rs:9:1
|
||||
|
|
||||
LL | impl const S {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^-----^^^^^
|
||||
| |
|
||||
| const because of this
|
||||
|
||||
error: const trait impls are not yet implemented
|
||||
--> $DIR/inherent-impl.rs:13:1
|
||||
|
|
||||
LL | impl const T {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^-----^^^^^
|
||||
| |
|
||||
| const because of this
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ error[E0198]: negative impls cannot be unsafe
|
|||
--> $DIR/syntax-trait-polarity.rs:12:1
|
||||
|
|
||||
LL | unsafe impl !Send for TestType {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| unsafe because of this
|
||||
|
||||
error: inherent impls cannot be negative
|
||||
--> $DIR/syntax-trait-polarity.rs:19:1
|
||||
|
|
@ -20,7 +22,9 @@ error[E0198]: negative impls cannot be unsafe
|
|||
--> $DIR/syntax-trait-polarity.rs:22:1
|
||||
|
|
||||
LL | unsafe impl<T> !Send for TestType2<T> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| unsafe because of this
|
||||
|
||||
error[E0192]: negative impls are only allowed for auto traits (e.g., `Send` and `Sync`)
|
||||
--> $DIR/syntax-trait-polarity.rs:14:1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
error[E0197]: inherent impls cannot be unsafe
|
||||
--> $DIR/trait-safety-inherent-impl.rs:5:1
|
||||
|
|
||||
LL | / unsafe impl SomeStruct {
|
||||
LL | unsafe impl SomeStruct {
|
||||
| ^-----
|
||||
| |
|
||||
| _unsafe because of this
|
||||
| |
|
||||
LL | | fn foo(self) { }
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue