Skip to content

Commit 5ff235b

Browse files
committed
Cleanup feature gates.
1 parent ebf467d commit 5ff235b

File tree

111 files changed

+236
-272
lines changed

Some content is hidden

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

111 files changed

+236
-272
lines changed

compiler/rustc_interface/src/passes.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,11 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
924924
tcx.ensure().check_mod_const_bodies(module);
925925
});
926926
},
927+
{
928+
sess.time("unused_lib_feature_checking", || {
929+
rustc_passes::stability::check_unused_or_stable_features(tcx)
930+
});
931+
},
927932
{
928933
// We force these querie to run,
929934
// since they might not otherwise get called.
@@ -1002,11 +1007,6 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
10021007
tcx.hir()
10031008
.par_for_each_module(|module| tcx.ensure().check_mod_deathness(module));
10041009
},
1005-
{
1006-
sess.time("unused_lib_feature_checking", || {
1007-
rustc_passes::stability::check_unused_or_stable_features(tcx)
1008-
});
1009-
},
10101010
{
10111011
sess.time("lint_checking", || {
10121012
rustc_lint::check_crate(tcx, || {

src/test/ui/alloc-error/alloc-error-handler-bad-signature-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags:-C panic=abort
22

3-
#![feature(alloc_error_handler, panic_handler)]
3+
#![feature(alloc_error_handler)]
44
#![no_std]
55
#![no_main]
66

src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags:-C panic=abort
22

3-
#![feature(alloc_error_handler, panic_handler)]
3+
#![feature(alloc_error_handler)]
44
#![no_std]
55
#![no_main]
66

src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags:-C panic=abort
22

3-
#![feature(alloc_error_handler, panic_handler)]
3+
#![feature(alloc_error_handler)]
44
#![no_std]
55
#![no_main]
66

src/test/ui/asm/naked-functions.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// ignore-wasm32
55

66
#![feature(naked_functions)]
7-
#![feature(or_patterns)]
87
#![feature(asm_const, asm_sym, asm_unwind)]
98
#![crate_type = "lib"]
109

src/test/ui/asm/naked-functions.stderr

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error: asm with the `pure` option must have at least one output
2-
--> $DIR/naked-functions.rs:111:14
2+
--> $DIR/naked-functions.rs:110:14
33
|
44
LL | asm!("", options(readonly, nostack), options(pure));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
66

77
error: patterns not allowed in naked function parameters
8-
--> $DIR/naked-functions.rs:21:5
8+
--> $DIR/naked-functions.rs:20:5
99
|
1010
LL | mut a: u32,
1111
| ^^^^^
1212

1313
error: patterns not allowed in naked function parameters
14-
--> $DIR/naked-functions.rs:23:5
14+
--> $DIR/naked-functions.rs:22:5
1515
|
1616
LL | &b: &i32,
1717
| ^^
1818

1919
error: patterns not allowed in naked function parameters
20-
--> $DIR/naked-functions.rs:25:6
20+
--> $DIR/naked-functions.rs:24:6
2121
|
2222
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
2323
| ^^^^^^^^^^^^^^
2424

2525
error: patterns not allowed in naked function parameters
26-
--> $DIR/naked-functions.rs:27:5
26+
--> $DIR/naked-functions.rs:26:5
2727
|
2828
LL | P { x, y }: P,
2929
| ^^^^^^^^^^
3030

3131
error: referencing function parameters is not allowed in naked functions
32-
--> $DIR/naked-functions.rs:36:5
32+
--> $DIR/naked-functions.rs:35:5
3333
|
3434
LL | a + 1
3535
| ^
3636
|
3737
= help: follow the calling convention in asm block to use parameters
3838

3939
error[E0787]: naked functions must contain a single asm block
40-
--> $DIR/naked-functions.rs:34:1
40+
--> $DIR/naked-functions.rs:33:1
4141
|
4242
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
4343
LL | |
@@ -48,21 +48,21 @@ LL | | }
4848
| |_^
4949

5050
error: referencing function parameters is not allowed in naked functions
51-
--> $DIR/naked-functions.rs:42:31
51+
--> $DIR/naked-functions.rs:41:31
5252
|
5353
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
5454
| ^
5555
|
5656
= help: follow the calling convention in asm block to use parameters
5757

5858
error[E0787]: only `const` and `sym` operands are supported in naked functions
59-
--> $DIR/naked-functions.rs:42:23
59+
--> $DIR/naked-functions.rs:41:23
6060
|
6161
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
6262
| ^^^^^^^^^
6363

6464
error[E0787]: naked functions must contain a single asm block
65-
--> $DIR/naked-functions.rs:48:1
65+
--> $DIR/naked-functions.rs:47:1
6666
|
6767
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
6868
LL | |
@@ -72,7 +72,7 @@ LL | | }
7272
| |_^
7373

7474
error[E0787]: only `const` and `sym` operands are supported in naked functions
75-
--> $DIR/naked-functions.rs:65:10
75+
--> $DIR/naked-functions.rs:64:10
7676
|
7777
LL | in(reg) a,
7878
| ^^^^^^^^^
@@ -87,7 +87,7 @@ LL | out(reg) e,
8787
| ^^^^^^^^^^
8888

8989
error[E0787]: asm in naked functions must use `noreturn` option
90-
--> $DIR/naked-functions.rs:63:5
90+
--> $DIR/naked-functions.rs:62:5
9191
|
9292
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
9393
LL | |
@@ -99,7 +99,7 @@ LL | | );
9999
| |_____^
100100

101101
error[E0787]: naked functions must contain a single asm block
102-
--> $DIR/naked-functions.rs:54:1
102+
--> $DIR/naked-functions.rs:53:1
103103
|
104104
LL | / pub unsafe extern "C" fn unsupported_operands() {
105105
LL | |
@@ -119,33 +119,33 @@ LL | | }
119119
| |_^
120120

121121
error[E0787]: naked functions must contain a single asm block
122-
--> $DIR/naked-functions.rs:77:1
122+
--> $DIR/naked-functions.rs:76:1
123123
|
124124
LL | / pub extern "C" fn missing_assembly() {
125125
LL | |
126126
LL | | }
127127
| |_^
128128

129129
error[E0787]: asm in naked functions must use `noreturn` option
130-
--> $DIR/naked-functions.rs:84:5
130+
--> $DIR/naked-functions.rs:83:5
131131
|
132132
LL | asm!("");
133133
| ^^^^^^^^
134134

135135
error[E0787]: asm in naked functions must use `noreturn` option
136-
--> $DIR/naked-functions.rs:86:5
136+
--> $DIR/naked-functions.rs:85:5
137137
|
138138
LL | asm!("");
139139
| ^^^^^^^^
140140

141141
error[E0787]: asm in naked functions must use `noreturn` option
142-
--> $DIR/naked-functions.rs:88:5
142+
--> $DIR/naked-functions.rs:87:5
143143
|
144144
LL | asm!("");
145145
| ^^^^^^^^
146146

147147
error[E0787]: naked functions must contain a single asm block
148-
--> $DIR/naked-functions.rs:82:1
148+
--> $DIR/naked-functions.rs:81:1
149149
|
150150
LL | / pub extern "C" fn too_many_asm_blocks() {
151151
LL | |
@@ -163,15 +163,15 @@ LL | | }
163163
| |_^
164164

165165
error: referencing function parameters is not allowed in naked functions
166-
--> $DIR/naked-functions.rs:97:11
166+
--> $DIR/naked-functions.rs:96:11
167167
|
168168
LL | *&y
169169
| ^
170170
|
171171
= help: follow the calling convention in asm block to use parameters
172172

173173
error[E0787]: naked functions must contain a single asm block
174-
--> $DIR/naked-functions.rs:95:5
174+
--> $DIR/naked-functions.rs:94:5
175175
|
176176
LL | / pub extern "C" fn inner(y: usize) -> usize {
177177
LL | |
@@ -182,75 +182,75 @@ LL | | }
182182
| |_____^
183183

184184
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
185-
--> $DIR/naked-functions.rs:105:5
185+
--> $DIR/naked-functions.rs:104:5
186186
|
187187
LL | asm!("", options(nomem, preserves_flags, noreturn));
188188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189189

190190
error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
191-
--> $DIR/naked-functions.rs:111:5
191+
--> $DIR/naked-functions.rs:110:5
192192
|
193193
LL | asm!("", options(readonly, nostack), options(pure));
194194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195195

196196
error[E0787]: asm in naked functions must use `noreturn` option
197-
--> $DIR/naked-functions.rs:111:5
197+
--> $DIR/naked-functions.rs:110:5
198198
|
199199
LL | asm!("", options(readonly, nostack), options(pure));
200200
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201201

202202
error[E0787]: asm options unsupported in naked functions: `may_unwind`
203-
--> $DIR/naked-functions.rs:119:5
203+
--> $DIR/naked-functions.rs:118:5
204204
|
205205
LL | asm!("", options(noreturn, may_unwind));
206206
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
207207

208208
warning: Rust ABI is unsupported in naked functions
209-
--> $DIR/naked-functions.rs:124:15
209+
--> $DIR/naked-functions.rs:123:15
210210
|
211211
LL | pub unsafe fn default_abi() {
212212
| ^^^^^^^^^^^
213213
|
214214
= note: `#[warn(undefined_naked_function_abi)]` on by default
215215

216216
warning: Rust ABI is unsupported in naked functions
217-
--> $DIR/naked-functions.rs:130:15
217+
--> $DIR/naked-functions.rs:129:15
218218
|
219219
LL | pub unsafe fn rust_abi() {
220220
| ^^^^^^^^
221221

222222
error: naked functions cannot be inlined
223-
--> $DIR/naked-functions.rs:170:1
223+
--> $DIR/naked-functions.rs:169:1
224224
|
225225
LL | #[inline]
226226
| ^^^^^^^^^
227227

228228
error: naked functions cannot be inlined
229-
--> $DIR/naked-functions.rs:177:1
229+
--> $DIR/naked-functions.rs:176:1
230230
|
231231
LL | #[inline(always)]
232232
| ^^^^^^^^^^^^^^^^^
233233

234234
error: naked functions cannot be inlined
235-
--> $DIR/naked-functions.rs:184:1
235+
--> $DIR/naked-functions.rs:183:1
236236
|
237237
LL | #[inline(never)]
238238
| ^^^^^^^^^^^^^^^^
239239

240240
error: naked functions cannot be inlined
241-
--> $DIR/naked-functions.rs:191:1
241+
--> $DIR/naked-functions.rs:190:1
242242
|
243243
LL | #[inline]
244244
| ^^^^^^^^^
245245

246246
error: naked functions cannot be inlined
247-
--> $DIR/naked-functions.rs:193:1
247+
--> $DIR/naked-functions.rs:192:1
248248
|
249249
LL | #[inline(always)]
250250
| ^^^^^^^^^^^^^^^^^
251251

252252
error: naked functions cannot be inlined
253-
--> $DIR/naked-functions.rs:195:1
253+
--> $DIR/naked-functions.rs:194:1
254254
|
255255
LL | #[inline(never)]
256256
| ^^^^^^^^^^^^^^^^

src/test/ui/associated-consts/associated-const-in-trait.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// #29924
22

3-
#![feature(associated_consts)]
4-
53
trait Trait {
64
const N: usize;
75
}

src/test/ui/associated-consts/associated-const-in-trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0038]: the trait `Trait` cannot be made into an object
2-
--> $DIR/associated-const-in-trait.rs:9:6
2+
--> $DIR/associated-const-in-trait.rs:7:6
33
|
44
LL | impl dyn Trait {
55
| ^^^^^^^^^ `Trait` cannot be made into an object
66
|
77
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
8-
--> $DIR/associated-const-in-trait.rs:6:11
8+
--> $DIR/associated-const-in-trait.rs:4:11
99
|
1010
LL | trait Trait {
1111
| ----- this trait cannot be made into an object...

src/test/ui/async-await/try-on-option-in-async.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(try_trait, async_closure)]
1+
#![feature(async_closure)]
22
// edition:2018
33
fn main() {}
44

src/test/ui/attributes/const-stability-on-macro.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![feature(staged_api)]
2+
#![stable(feature = "rust1", since = "1.0.0")]
3+
14
#[rustc_const_stable(feature = "foo", since = "0")]
25
//~^ ERROR macros cannot have const stability attributes
36
macro_rules! foo {

src/test/ui/attributes/const-stability-on-macro.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: macros cannot have const stability attributes
2-
--> $DIR/const-stability-on-macro.rs:1:1
2+
--> $DIR/const-stability-on-macro.rs:4:1
33
|
44
LL | #[rustc_const_stable(feature = "foo", since = "0")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute
@@ -8,7 +8,7 @@ LL | macro_rules! foo {
88
| ---------------- const stability attribute affects this macro
99

1010
error: macros cannot have const stability attributes
11-
--> $DIR/const-stability-on-macro.rs:7:1
11+
--> $DIR/const-stability-on-macro.rs:10:1
1212
|
1313
LL | #[rustc_const_unstable(feature = "bar", issue="none")]
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute

src/test/ui/attributes/extented-attribute-macro-error.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// normalize-stderr-test: "couldn't read.*" -> "couldn't read the file"
22

3-
#![feature(extended_key_value_attributes)]
43
#![doc = include_str!("../not_existing_file.md")]
54
struct Documented {}
65
//~^^ ERROR couldn't read

src/test/ui/attributes/extented-attribute-macro-error.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: couldn't read the file
2-
--> $DIR/extented-attribute-macro-error.rs:4:10
2+
--> $DIR/extented-attribute-macro-error.rs:3:10
33
|
44
LL | #![doc = include_str!("../not_existing_file.md")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/const-generics/issues/issue-82956.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(generic_const_exprs, array_map)]
1+
#![feature(generic_const_exprs)]
22
#![allow(incomplete_features)]
33

44
pub struct ConstCheck<const CHECK: bool>;

src/test/ui/consts/const-array-oob-arith.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(const_indexing)]
2-
31
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
42
const IDX: usize = 3;
53
const VAL: i32 = ARR[IDX];

src/test/ui/consts/const-array-oob-arith.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0308]: mismatched types
2-
--> $DIR/const-array-oob-arith.rs:7:45
2+
--> $DIR/const-array-oob-arith.rs:5:45
33
|
44
LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5];
55
| ^^^ expected an array with a fixed size of 2 elements, found one with 1 element
66

77
error[E0308]: mismatched types
8-
--> $DIR/const-array-oob-arith.rs:10:44
8+
--> $DIR/const-array-oob-arith.rs:8:44
99
|
1010
LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99];
1111
| ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements

0 commit comments

Comments
 (0)