Make feature negative_bounds
internal
This commit is contained in:
parent
88d69b72b4
commit
5f56465621
7 changed files with 15 additions and 45 deletions
|
@ -210,7 +210,7 @@ declare_features! (
|
||||||
/// Allows the `multiple_supertrait_upcastable` lint.
|
/// Allows the `multiple_supertrait_upcastable` lint.
|
||||||
(unstable, multiple_supertrait_upcastable, "1.69.0", None),
|
(unstable, multiple_supertrait_upcastable, "1.69.0", None),
|
||||||
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
|
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
|
||||||
(incomplete, negative_bounds, "1.71.0", None),
|
(internal, negative_bounds, "1.71.0", None),
|
||||||
/// Allows using `#[omit_gdb_pretty_printer_section]`.
|
/// Allows using `#[omit_gdb_pretty_printer_section]`.
|
||||||
(internal, omit_gdb_pretty_printer_section, "1.5.0", None),
|
(internal, omit_gdb_pretty_printer_section, "1.5.0", None),
|
||||||
/// Allows using `#[prelude_import]` on glob `use` items.
|
/// Allows using `#[prelude_import]` on glob `use` items.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![feature(negative_bounds, associated_type_bounds)]
|
#![feature(negative_bounds, associated_type_bounds)]
|
||||||
//~^ WARN the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
|
|
||||||
|
|
||||||
trait Trait {
|
trait Trait {
|
||||||
type Assoc;
|
type Assoc;
|
||||||
|
|
|
@ -1,34 +1,25 @@
|
||||||
error: associated type constraints not allowed on negative bounds
|
error: associated type constraints not allowed on negative bounds
|
||||||
--> $DIR/associated-constraints.rs:8:19
|
--> $DIR/associated-constraints.rs:7:19
|
||||||
|
|
|
|
||||||
LL | fn test<T: !Trait<Assoc = i32>>() {}
|
LL | fn test<T: !Trait<Assoc = i32>>() {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: associated type constraints not allowed on negative bounds
|
error: associated type constraints not allowed on negative bounds
|
||||||
--> $DIR/associated-constraints.rs:11:31
|
--> $DIR/associated-constraints.rs:10:31
|
||||||
|
|
|
|
||||||
LL | fn test2<T>() where T: !Trait<Assoc = i32> {}
|
LL | fn test2<T>() where T: !Trait<Assoc = i32> {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: associated type constraints not allowed on negative bounds
|
error: associated type constraints not allowed on negative bounds
|
||||||
--> $DIR/associated-constraints.rs:14:20
|
--> $DIR/associated-constraints.rs:13:20
|
||||||
|
|
|
|
||||||
LL | fn test3<T: !Trait<Assoc: Send>>() {}
|
LL | fn test3<T: !Trait<Assoc: Send>>() {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: associated type constraints not allowed on negative bounds
|
error: associated type constraints not allowed on negative bounds
|
||||||
--> $DIR/associated-constraints.rs:17:31
|
--> $DIR/associated-constraints.rs:16:31
|
||||||
|
|
|
|
||||||
LL | fn test4<T>() where T: !Trait<Assoc: Send> {}
|
LL | fn test4<T>() where T: !Trait<Assoc: Send> {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
|
error: aborting due to 4 previous errors
|
||||||
--> $DIR/associated-constraints.rs:1:12
|
|
||||||
|
|
|
||||||
LL | #![feature(negative_bounds, associated_type_bounds)]
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(incomplete_features)]` on by default
|
|
||||||
|
|
||||||
error: aborting due to 4 previous errors; 1 warning emitted
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![feature(negative_bounds, negative_impls)]
|
#![feature(negative_bounds, negative_impls)]
|
||||||
//~^ WARN the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
|
|
||||||
|
|
||||||
fn not_copy<T: !Copy>() {}
|
fn not_copy<T: !Copy>() {}
|
||||||
|
|
||||||
|
|
|
@ -1,44 +1,36 @@
|
||||||
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
|
|
||||||
--> $DIR/simple.rs:1:12
|
|
||||||
|
|
|
||||||
LL | #![feature(negative_bounds, negative_impls)]
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(incomplete_features)]` on by default
|
|
||||||
|
|
||||||
error[E0277]: the trait bound `T: !Copy` is not satisfied
|
error[E0277]: the trait bound `T: !Copy` is not satisfied
|
||||||
--> $DIR/simple.rs:11:16
|
--> $DIR/simple.rs:10:16
|
||||||
|
|
|
|
||||||
LL | not_copy::<T>();
|
LL | not_copy::<T>();
|
||||||
| ^ the trait `!Copy` is not implemented for `T`
|
| ^ the trait `!Copy` is not implemented for `T`
|
||||||
|
|
|
|
||||||
note: required by a bound in `not_copy`
|
note: required by a bound in `not_copy`
|
||||||
--> $DIR/simple.rs:4:16
|
--> $DIR/simple.rs:3:16
|
||||||
|
|
|
|
||||||
LL | fn not_copy<T: !Copy>() {}
|
LL | fn not_copy<T: !Copy>() {}
|
||||||
| ^^^^^ required by this bound in `not_copy`
|
| ^^^^^ required by this bound in `not_copy`
|
||||||
|
|
||||||
error[E0277]: the trait bound `T: !Copy` is not satisfied
|
error[E0277]: the trait bound `T: !Copy` is not satisfied
|
||||||
--> $DIR/simple.rs:16:16
|
--> $DIR/simple.rs:15:16
|
||||||
|
|
|
|
||||||
LL | not_copy::<T>();
|
LL | not_copy::<T>();
|
||||||
| ^ the trait `!Copy` is not implemented for `T`
|
| ^ the trait `!Copy` is not implemented for `T`
|
||||||
|
|
|
|
||||||
note: required by a bound in `not_copy`
|
note: required by a bound in `not_copy`
|
||||||
--> $DIR/simple.rs:4:16
|
--> $DIR/simple.rs:3:16
|
||||||
|
|
|
|
||||||
LL | fn not_copy<T: !Copy>() {}
|
LL | fn not_copy<T: !Copy>() {}
|
||||||
| ^^^^^ required by this bound in `not_copy`
|
| ^^^^^ required by this bound in `not_copy`
|
||||||
|
|
||||||
error[E0277]: the trait bound `Copyable: !Copy` is not satisfied
|
error[E0277]: the trait bound `Copyable: !Copy` is not satisfied
|
||||||
--> $DIR/simple.rs:31:16
|
--> $DIR/simple.rs:30:16
|
||||||
|
|
|
|
||||||
LL | not_copy::<Copyable>();
|
LL | not_copy::<Copyable>();
|
||||||
| ^^^^^^^^ the trait `!Copy` is not implemented for `Copyable`
|
| ^^^^^^^^ the trait `!Copy` is not implemented for `Copyable`
|
||||||
|
|
|
|
||||||
= help: the trait `Copy` is implemented for `Copyable`
|
= help: the trait `Copy` is implemented for `Copyable`
|
||||||
note: required by a bound in `not_copy`
|
note: required by a bound in `not_copy`
|
||||||
--> $DIR/simple.rs:4:16
|
--> $DIR/simple.rs:3:16
|
||||||
|
|
|
|
||||||
LL | fn not_copy<T: !Copy>() {}
|
LL | fn not_copy<T: !Copy>() {}
|
||||||
| ^^^^^ required by this bound in `not_copy`
|
| ^^^^^ required by this bound in `not_copy`
|
||||||
|
@ -49,13 +41,13 @@ LL | struct Copyable;
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0277]: the trait bound `NotNecessarilyCopyable: !Copy` is not satisfied
|
error[E0277]: the trait bound `NotNecessarilyCopyable: !Copy` is not satisfied
|
||||||
--> $DIR/simple.rs:38:16
|
--> $DIR/simple.rs:37:16
|
||||||
|
|
|
|
||||||
LL | not_copy::<NotNecessarilyCopyable>();
|
LL | not_copy::<NotNecessarilyCopyable>();
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `!Copy` is not implemented for `NotNecessarilyCopyable`
|
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `!Copy` is not implemented for `NotNecessarilyCopyable`
|
||||||
|
|
|
|
||||||
note: required by a bound in `not_copy`
|
note: required by a bound in `not_copy`
|
||||||
--> $DIR/simple.rs:4:16
|
--> $DIR/simple.rs:3:16
|
||||||
|
|
|
|
||||||
LL | fn not_copy<T: !Copy>() {}
|
LL | fn not_copy<T: !Copy>() {}
|
||||||
| ^^^^^ required by this bound in `not_copy`
|
| ^^^^^ required by this bound in `not_copy`
|
||||||
|
@ -65,6 +57,6 @@ LL + #[derive(Copy)]
|
||||||
LL | struct NotNecessarilyCopyable;
|
LL | struct NotNecessarilyCopyable;
|
||||||
|
|
|
|
||||||
|
|
||||||
error: aborting due to 4 previous errors; 1 warning emitted
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0277`.
|
For more information about this error, try `rustc --explain E0277`.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
||||||
#![feature(negative_bounds)]
|
#![feature(negative_bounds)]
|
||||||
//~^ WARN the feature `negative_bounds` is incomplete
|
|
||||||
|
|
||||||
trait A: !B {}
|
trait A: !B {}
|
||||||
trait B: !A {}
|
trait B: !A {}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
|
|
||||||
--> $DIR/supertrait.rs:3:12
|
|
||||||
|
|
|
||||||
LL | #![feature(negative_bounds)]
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(incomplete_features)]` on by default
|
|
||||||
|
|
||||||
warning: 1 warning emitted
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue