Skip to content

Commit a1c32ca

Browse files
Rollup merge of #154276 - cyrgani:incomplete-mcp-2, r=fmease
allow `incomplete_features` in more tests This PR allows the `incomplete_features` lint for the `traits` and `const-generics` directories. `specialization` will come in a followup PR. Followup to #154174. Part of #154168.
2 parents 1cfbc50 + 7df43d3 commit a1c32ca

122 files changed

Lines changed: 132 additions & 871 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,10 +1922,7 @@ impl<'test> TestCx<'test> {
19221922
// Allow tests to use internal and incomplete features.
19231923
compiler.args(&["-A", "internal_features"]);
19241924
// FIXME(#154168); temporarily exclude some directories to make the transition easier
1925-
if !input_file
1926-
.iter()
1927-
.any(|p| p == "traits" || p == "specialization" || p == "const-generics")
1928-
{
1925+
if !input_file.iter().any(|p| p == "specialization") {
19291926
compiler.args(&["-A", "incomplete_features"]);
19301927
}
19311928

tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ check-pass
22
#![feature(adt_const_params, lazy_type_alias)]
3-
//~^ WARN: the feature `lazy_type_alias` is incomplete
43

54
pub type Matrix = [usize; 1];
65
const EMPTY_MATRIX: Matrix = [0; 1];

tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/const-generics/adt_const_params/unsized-anon-const-err-2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#![feature(adt_const_params)]
44
#![feature(unsized_const_params)]
5-
//~^ WARN the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
65

76
#[derive(Clone)]
87
struct S<const L: [u8]>;
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
error: free constant item without body
2-
--> $DIR/unsized-anon-const-err-2.rs:10:1
2+
--> $DIR/unsized-anon-const-err-2.rs:9:1
33
|
44
LL | const A: [u8];
55
| ^^^^^^^^^^^^^-
66
| |
77
| help: provide a definition for the constant: `= <expr>;`
88

9-
warning: the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
10-
--> $DIR/unsized-anon-const-err-2.rs:4:12
11-
|
12-
LL | #![feature(unsized_const_params)]
13-
| ^^^^^^^^^^^^^^^^^^^^
14-
|
15-
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
16-
= note: `#[warn(incomplete_features)]` on by default
17-
189
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
19-
--> $DIR/unsized-anon-const-err-2.rs:10:10
10+
--> $DIR/unsized-anon-const-err-2.rs:9:10
2011
|
2112
LL | const A: [u8];
2213
| ^^^^ doesn't have a size known at compile-time
@@ -25,7 +16,7 @@ LL | const A: [u8];
2516
= note: statics and constants must have a statically known size
2617

2718
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
28-
--> $DIR/unsized-anon-const-err-2.rs:14:31
19+
--> $DIR/unsized-anon-const-err-2.rs:13:31
2920
|
3021
LL | impl<const N: i32> Copy for S<A> {}
3122
| ^ doesn't have a size known at compile-time
@@ -34,7 +25,7 @@ LL | impl<const N: i32> Copy for S<A> {}
3425
= note: statics and constants must have a statically known size
3526

3627
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
37-
--> $DIR/unsized-anon-const-err-2.rs:17:33
28+
--> $DIR/unsized-anon-const-err-2.rs:16:33
3829
|
3930
LL | impl<const M: usize> Copy for S<A> {}
4031
| ^ doesn't have a size known at compile-time
@@ -43,7 +34,7 @@ LL | impl<const M: usize> Copy for S<A> {}
4334
= note: statics and constants must have a statically known size
4435

4536
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
46-
--> $DIR/unsized-anon-const-err-2.rs:14:6
37+
--> $DIR/unsized-anon-const-err-2.rs:13:6
4738
|
4839
LL | impl<const N: i32> Copy for S<A> {}
4940
| ^^^^^^^^^^^^ unconstrained const parameter
@@ -52,15 +43,15 @@ LL | impl<const N: i32> Copy for S<A> {}
5243
= note: proving the result of expressions other than the parameter are unique is not supported
5344

5445
error[E0207]: the const parameter `M` is not constrained by the impl trait, self type, or predicates
55-
--> $DIR/unsized-anon-const-err-2.rs:17:6
46+
--> $DIR/unsized-anon-const-err-2.rs:16:6
5647
|
5748
LL | impl<const M: usize> Copy for S<A> {}
5849
| ^^^^^^^^^^^^^^ unconstrained const parameter
5950
|
6051
= note: expressions using a const parameter must map each value to a distinct output value
6152
= note: proving the result of expressions other than the parameter are unique is not supported
6253

63-
error: aborting due to 6 previous errors; 1 warning emitted
54+
error: aborting due to 6 previous errors
6455

6556
Some errors have detailed explanations: E0207, E0277.
6657
For more information about an error, try `rustc --explain E0207`.

tests/ui/const-generics/defaults/concrete-const-param-type.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#![feature(generic_const_parameter_types, unsized_const_params, adt_const_params)]
2-
//~^ WARN the feature `generic_const_parameter_types` is incomplete
3-
//~| WARN the feature `unsized_const_params` is incomplete
42
// Make sure that we test the const param type of default const parameters
53
// if both the type of the default and the type of the parameter are concrete.
64

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
warning: the feature `generic_const_parameter_types` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/concrete-const-param-type.rs:1:12
3-
|
4-
LL | #![feature(generic_const_parameter_types, unsized_const_params, adt_const_params)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: see issue #137626 <https://github.com/rust-lang/rust/issues/137626> for more information
8-
= note: `#[warn(incomplete_features)]` on by default
9-
10-
warning: the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
11-
--> $DIR/concrete-const-param-type.rs:1:43
12-
|
13-
LL | #![feature(generic_const_parameter_types, unsized_const_params, adt_const_params)]
14-
| ^^^^^^^^^^^^^^^^^^^^
15-
|
16-
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
17-
181
error: the constant `N` is not of type `u64`
19-
--> $DIR/concrete-const-param-type.rs:9:26
2+
--> $DIR/concrete-const-param-type.rs:7:26
203
|
214
LL | struct Foo<const N: u32, const M: u64 = N>;
225
| ^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
236

24-
error: aborting due to 1 previous error; 2 warnings emitted
7+
error: aborting due to 1 previous error
258

tests/ui/const-generics/generic_const_exprs/cannot-convert-refree-ice-114463.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// issue: rust-lang/rust#114463
22
// ICE cannot convert `ReFree ..` to a region vid
33
#![feature(generic_const_exprs)]
4-
//~^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
4+
55
fn bug<'a>() {
66
[(); (|_: &'a u8| (), 0).1];
77
//~^ ERROR cannot capture late-bound lifetime in constant
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/cannot-convert-refree-ice-114463.rs:3:12
3-
|
4-
LL | #![feature(generic_const_exprs)]
5-
| ^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
8-
= note: `#[warn(incomplete_features)]` on by default
9-
101
error: cannot capture late-bound lifetime in constant
112
--> $DIR/cannot-convert-refree-ice-114463.rs:6:16
123
|
@@ -15,5 +6,5 @@ LL | fn bug<'a>() {
156
LL | [(); (|_: &'a u8| (), 0).1];
167
| ^^
178

18-
error: aborting due to 1 previous error; 1 warning emitted
9+
error: aborting due to 1 previous error
1910

tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(generic_const_exprs)]
2-
//~^ WARN the feature `generic_const_exprs` is incomplete
32

43
fn foo<T>() {
54
let _ = [0u8; { const { std::mem::size_of::<T>() } }];

0 commit comments

Comments
 (0)