Skip to content

Commit 66ab625

Browse files
committed
Make feature negative_bounds internal
1 parent 255a0e9 commit 66ab625

11 files changed

+28
-75
lines changed

compiler/rustc_feature/src/unstable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ declare_features! (
210210
/// Allows the `multiple_supertrait_upcastable` lint.
211211
(unstable, multiple_supertrait_upcastable, "1.69.0", None),
212212
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
213-
(incomplete, negative_bounds, "1.71.0", None),
213+
(internal, negative_bounds, "1.71.0", None),
214214
/// Allows using `#[omit_gdb_pretty_printer_section]`.
215215
(internal, omit_gdb_pretty_printer_section, "1.5.0", None),
216216
/// Allows using `#[prelude_import]` on glob `use` items.

tests/ui/traits/negative-bounds/associated-constraints.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(negative_bounds, associated_type_bounds)]
2-
//~^ WARN the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
32

43
trait Trait {
54
type Assoc;
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
11
error: associated type constraints not allowed on negative bounds
2-
--> $DIR/associated-constraints.rs:8:19
2+
--> $DIR/associated-constraints.rs:7:19
33
|
44
LL | fn test<T: !Trait<Assoc = i32>>() {}
55
| ^^^^^^^^^^^
66

77
error: associated type constraints not allowed on negative bounds
8-
--> $DIR/associated-constraints.rs:11:31
8+
--> $DIR/associated-constraints.rs:10:31
99
|
1010
LL | fn test2<T>() where T: !Trait<Assoc = i32> {}
1111
| ^^^^^^^^^^^
1212

1313
error: associated type constraints not allowed on negative bounds
14-
--> $DIR/associated-constraints.rs:14:20
14+
--> $DIR/associated-constraints.rs:13:20
1515
|
1616
LL | fn test3<T: !Trait<Assoc: Send>>() {}
1717
| ^^^^^^^^^^^
1818

1919
error: associated type constraints not allowed on negative bounds
20-
--> $DIR/associated-constraints.rs:17:31
20+
--> $DIR/associated-constraints.rs:16:31
2121
|
2222
LL | fn test4<T>() where T: !Trait<Assoc: Send> {}
2323
| ^^^^^^^^^^^
2424

2525
error: parenthetical notation may not be used for negative bounds
26-
--> $DIR/associated-constraints.rs:20:25
26+
--> $DIR/associated-constraints.rs:19:25
2727
|
2828
LL | fn test5<T>() where T: !Fn() -> i32 {}
2929
| ^^^^^^^^^^^
3030

31-
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
32-
--> $DIR/associated-constraints.rs:1:12
33-
|
34-
LL | #![feature(negative_bounds, associated_type_bounds)]
35-
| ^^^^^^^^^^^^^^^
36-
|
37-
= note: `#[warn(incomplete_features)]` on by default
38-
39-
error: aborting due to 5 previous errors; 1 warning emitted
31+
error: aborting due to 5 previous errors
4032

tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// compile-flags: -Znext-solver
22

33
#![feature(negative_bounds, negative_impls)]
4-
//~^ WARN the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
54

65
trait Trait {}
76
impl !Trait for () {}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/opaque-type-unsatisfied-bound.rs:3:12
3-
|
4-
LL | #![feature(negative_bounds, negative_impls)]
5-
| ^^^^^^^^^^^^^^^
6-
|
7-
= note: `#[warn(incomplete_features)]` on by default
8-
91
error[E0308]: mismatched types
10-
--> $DIR/opaque-type-unsatisfied-bound.rs:16:36
2+
--> $DIR/opaque-type-unsatisfied-bound.rs:15:36
113
|
124
LL | fn weird0() -> impl Sized + !Sized {}
135
| ------------------- ^^ types differ
@@ -18,13 +10,13 @@ LL | fn weird0() -> impl Sized + !Sized {}
1810
found unit type `()`
1911

2012
error[E0271]: type mismatch resolving `() == impl !Sized`
21-
--> $DIR/opaque-type-unsatisfied-bound.rs:16:16
13+
--> $DIR/opaque-type-unsatisfied-bound.rs:15:16
2214
|
2315
LL | fn weird0() -> impl Sized + !Sized {}
2416
| ^^^^^^^^^^^^^^^^^^^ types differ
2517

2618
error[E0308]: mismatched types
27-
--> $DIR/opaque-type-unsatisfied-bound.rs:19:36
19+
--> $DIR/opaque-type-unsatisfied-bound.rs:18:36
2820
|
2921
LL | fn weird1() -> impl Sized + !Sized {}
3022
| ------------------- ^^ types differ
@@ -35,13 +27,13 @@ LL | fn weird1() -> impl Sized + !Sized {}
3527
found unit type `()`
3628

3729
error[E0271]: type mismatch resolving `() == impl !Sized`
38-
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
30+
--> $DIR/opaque-type-unsatisfied-bound.rs:18:16
3931
|
4032
LL | fn weird1() -> impl Sized + !Sized {}
4133
| ^^^^^^^^^^^^^^^^^^^ types differ
4234

4335
error[E0308]: mismatched types
44-
--> $DIR/opaque-type-unsatisfied-bound.rs:22:36
36+
--> $DIR/opaque-type-unsatisfied-bound.rs:21:36
4537
|
4638
LL | fn weird2() -> impl !Sized + Sized {}
4739
| ------------------- ^^ types differ
@@ -52,26 +44,26 @@ LL | fn weird2() -> impl !Sized + Sized {}
5244
found unit type `()`
5345

5446
error[E0271]: type mismatch resolving `() == impl !Sized`
55-
--> $DIR/opaque-type-unsatisfied-bound.rs:22:16
47+
--> $DIR/opaque-type-unsatisfied-bound.rs:21:16
5648
|
5749
LL | fn weird2() -> impl !Sized + Sized {}
5850
| ^^^^^^^^^^^^^^^^^^^ types differ
5951

6052
error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied
61-
--> $DIR/opaque-type-unsatisfied-bound.rs:13:13
53+
--> $DIR/opaque-type-unsatisfied-bound.rs:12:13
6254
|
6355
LL | consume(produce());
6456
| ------- ^^^^^^^^^ the trait `Trait` is not implemented for `impl !Trait`
6557
| |
6658
| required by a bound introduced by this call
6759
|
6860
note: required by a bound in `consume`
69-
--> $DIR/opaque-type-unsatisfied-bound.rs:10:20
61+
--> $DIR/opaque-type-unsatisfied-bound.rs:9:20
7062
|
7163
LL | fn consume(_: impl Trait) {}
7264
| ^^^^^ required by this bound in `consume`
7365

74-
error: aborting due to 7 previous errors; 1 warning emitted
66+
error: aborting due to 7 previous errors
7567

7668
Some errors have detailed explanations: E0271, E0277, E0308.
7769
For more information about an error, try `rustc --explain E0271`.

tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// compile-flags: -Znext-solver
22

33
#![feature(negative_bounds, unboxed_closures)]
4-
//~^ WARN the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
54

65
fn produce() -> impl !Fn<(u32,)> {}
76
//~^ ERROR mismatched types
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:3:12
3-
|
4-
LL | #![feature(negative_bounds, unboxed_closures)]
5-
| ^^^^^^^^^^^^^^^
6-
|
7-
= note: `#[warn(incomplete_features)]` on by default
8-
91
error[E0308]: mismatched types
10-
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:6:34
2+
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:34
113
|
124
LL | fn produce() -> impl !Fn<(u32,)> {}
135
| ---------------- ^^ types differ
@@ -18,12 +10,12 @@ LL | fn produce() -> impl !Fn<(u32,)> {}
1810
found unit type `()`
1911

2012
error[E0271]: type mismatch resolving `() == impl !Fn<(u32,)>`
21-
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:6:17
13+
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:17
2214
|
2315
LL | fn produce() -> impl !Fn<(u32,)> {}
2416
| ^^^^^^^^^^^^^^^^ types differ
2517

26-
error: aborting due to 2 previous errors; 1 warning emitted
18+
error: aborting due to 2 previous errors
2719

2820
Some errors have detailed explanations: E0271, E0308.
2921
For more information about an error, try `rustc --explain E0271`.

tests/ui/traits/negative-bounds/simple.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(negative_bounds, negative_impls)]
2-
//~^ WARN the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
32

43
fn not_copy<T: !Copy>() {}
54

+9-17
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,36 @@
1-
warning: the feature `negative_bounds` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/simple.rs:1:12
3-
|
4-
LL | #![feature(negative_bounds, negative_impls)]
5-
| ^^^^^^^^^^^^^^^
6-
|
7-
= note: `#[warn(incomplete_features)]` on by default
8-
91
error[E0277]: the trait bound `T: !Copy` is not satisfied
10-
--> $DIR/simple.rs:11:16
2+
--> $DIR/simple.rs:10:16
113
|
124
LL | not_copy::<T>();
135
| ^ the trait `!Copy` is not implemented for `T`
146
|
157
note: required by a bound in `not_copy`
16-
--> $DIR/simple.rs:4:16
8+
--> $DIR/simple.rs:3:16
179
|
1810
LL | fn not_copy<T: !Copy>() {}
1911
| ^^^^^ required by this bound in `not_copy`
2012

2113
error[E0277]: the trait bound `T: !Copy` is not satisfied
22-
--> $DIR/simple.rs:16:16
14+
--> $DIR/simple.rs:15:16
2315
|
2416
LL | not_copy::<T>();
2517
| ^ the trait `!Copy` is not implemented for `T`
2618
|
2719
note: required by a bound in `not_copy`
28-
--> $DIR/simple.rs:4:16
20+
--> $DIR/simple.rs:3:16
2921
|
3022
LL | fn not_copy<T: !Copy>() {}
3123
| ^^^^^ required by this bound in `not_copy`
3224

3325
error[E0277]: the trait bound `Copyable: !Copy` is not satisfied
34-
--> $DIR/simple.rs:31:16
26+
--> $DIR/simple.rs:30:16
3527
|
3628
LL | not_copy::<Copyable>();
3729
| ^^^^^^^^ the trait `!Copy` is not implemented for `Copyable`
3830
|
3931
= help: the trait `Copy` is implemented for `Copyable`
4032
note: required by a bound in `not_copy`
41-
--> $DIR/simple.rs:4:16
33+
--> $DIR/simple.rs:3:16
4234
|
4335
LL | fn not_copy<T: !Copy>() {}
4436
| ^^^^^ required by this bound in `not_copy`
@@ -49,13 +41,13 @@ LL | struct Copyable;
4941
|
5042

5143
error[E0277]: the trait bound `NotNecessarilyCopyable: !Copy` is not satisfied
52-
--> $DIR/simple.rs:38:16
44+
--> $DIR/simple.rs:37:16
5345
|
5446
LL | not_copy::<NotNecessarilyCopyable>();
5547
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `!Copy` is not implemented for `NotNecessarilyCopyable`
5648
|
5749
note: required by a bound in `not_copy`
58-
--> $DIR/simple.rs:4:16
50+
--> $DIR/simple.rs:3:16
5951
|
6052
LL | fn not_copy<T: !Copy>() {}
6153
| ^^^^^ required by this bound in `not_copy`
@@ -65,6 +57,6 @@ LL + #[derive(Copy)]
6557
LL | struct NotNecessarilyCopyable;
6658
|
6759

68-
error: aborting due to 4 previous errors; 1 warning emitted
60+
error: aborting due to 4 previous errors
6961

7062
For more information about this error, try `rustc --explain E0277`.

tests/ui/traits/negative-bounds/supertrait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// check-pass
22

33
#![feature(negative_bounds)]
4-
//~^ WARN the feature `negative_bounds` is incomplete
54

65
trait A: !B {}
76
trait B: !A {}

tests/ui/traits/negative-bounds/supertrait.stderr

-10
This file was deleted.

0 commit comments

Comments
 (0)