Skip to content

Commit 91429a7

Browse files
Rollup merge of rust-lang#154174 - cyrgani:incomplete-mcp, r=JonathanBrouwer
allow `incomplete_features` in most UI tests This PR allows the `incomplete_features` lint for all UI tests except for the three directories with the largest number of tests (`traits`, `specialization` and `const-generics`) triggering this lint to keep the size of this PR manageable. The remaining three directories will be handled in followup PRs. Part of rust-lang#154168.
2 parents 0dac1aa + 9b0be78 commit 91429a7

114 files changed

Lines changed: 374 additions & 917 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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,8 +1919,15 @@ impl<'test> TestCx<'test> {
19191919
compiler.args(&["-A", "unused", "-W", "unused_attributes"]);
19201920
}
19211921

1922-
// Allow tests to use internal features.
1922+
// Allow tests to use internal and incomplete features.
19231923
compiler.args(&["-A", "internal_features"]);
1924+
// 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+
{
1929+
compiler.args(&["-A", "incomplete_features"]);
1930+
}
19241931

19251932
// Allow tests to have unused parens and braces.
19261933
// Add #![deny(unused_parens, unused_braces)] to the test file if you want to

tests/ui/associated-consts/type-const-in-array-len-wrong-type.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#![feature(generic_const_exprs)]
2-
//~^ WARN the feature `generic_const_exprs` is incomplete
32
#![feature(min_generic_const_args)]
4-
//~^ WARN the feature `min_generic_const_args` is incomplete
53
#![feature(inherent_associated_types)]
6-
//~^ WARN the feature `inherent_associated_types` is incomplete
74

85
struct OnDiskDirEntry<'a>(&'a ());
96

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
1-
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/type-const-in-array-len-wrong-type.rs:1: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-
10-
warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
11-
--> $DIR/type-const-in-array-len-wrong-type.rs:3:12
12-
|
13-
LL | #![feature(min_generic_const_args)]
14-
| ^^^^^^^^^^^^^^^^^^^^^^
15-
|
16-
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
17-
18-
warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
19-
--> $DIR/type-const-in-array-len-wrong-type.rs:5:12
20-
|
21-
LL | #![feature(inherent_associated_types)]
22-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
23-
|
24-
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
25-
261
error: the constant `2` is not of type `usize`
27-
--> $DIR/type-const-in-array-len-wrong-type.rs:13:26
2+
--> $DIR/type-const-in-array-len-wrong-type.rs:10:26
283
|
294
LL | fn lfn_contents() -> [char; Self::LFN_FRAGMENT_LEN] {
305
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `i64`
316
|
327
= note: the length of array `[char; 2]` must be type `usize`
338

34-
error: aborting due to 1 previous error; 3 warnings emitted
9+
error: aborting due to 1 previous error
3510

tests/ui/associated-consts/type-const-in-array-len.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//@ check-pass
22

33
#![feature(min_generic_const_args)]
4-
//~^ WARN the feature `min_generic_const_args` is incomplete
54
#![feature(inherent_associated_types)]
6-
//~^ WARN the feature `inherent_associated_types` is incomplete
75

86
// Test case from #138226: generic impl with multiple type parameters
97
struct Foo<A, B>(A, B);

tests/ui/associated-consts/type-const-in-array-len.stderr

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

tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.rs

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

33
// Regression test for #146467.
44
#![feature(inherent_associated_types)]
5-
//~^ WARN the feature `inherent_associated_types` is incomplete
65

76
struct Foo<T>(T);
87

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:4:12
3-
|
4-
LL | #![feature(inherent_associated_types)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
8-
= note: `#[warn(incomplete_features)]` on by default
9-
101
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
11-
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:9:6
2+
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:8:6
123
|
134
LL | impl<'a> Foo<fn(&())> {
145
| ^^ unconstrained lifetime parameter
156

167
error[E0308]: mismatched types
17-
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:14:11
8+
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:13:11
189
|
1910
LL | fn foo(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
2011
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -23,12 +14,12 @@ LL | fn foo(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
2314
found struct `Foo<for<'a> fn(&'a ())>`
2415

2516
error: higher-ranked subtype error
26-
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:14:1
17+
--> $DIR/hr-do-not-blame-outlives-static-ice.rs:13:1
2718
|
2819
LL | fn foo(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
2920
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3021

31-
error: aborting due to 3 previous errors; 1 warning emitted
22+
error: aborting due to 3 previous errors
3223

3324
Some errors have detailed explanations: E0207, E0308.
3425
For more information about an error, try `rustc --explain E0207`.

tests/ui/associated-inherent-types/variance-computation-requires-equality.rs

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

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

65
struct D<T> {
76
a: T

tests/ui/associated-inherent-types/variance-computation-requires-equality.stderr

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

tests/ui/associated-types/defaults-specialization.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Tests the interaction of associated type defaults and specialization.
22
33
#![feature(associated_type_defaults, specialization)]
4-
//~^ WARN the feature `specialization` is incomplete
54

65
trait Tr {
76
type Ty = u8;

0 commit comments

Comments
 (0)