Skip to content

Commit c551854

Browse files
enable RevealAll pass always
1 parent 668bf8c commit c551854

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

compiler/rustc_mir_transform/src/reveal_all.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
88
pub struct RevealAll;
99

1010
impl<'tcx> MirPass<'tcx> for RevealAll {
11-
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
12-
sess.mir_opt_level() >= 3 || super::inline::Inline.is_enabled(sess)
13-
}
14-
1511
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
1612
// Do not apply this transformation to generators.
1713
if body.generator.is_some() {

tests/ui/polymorphization/generators.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ where
3232

3333
#[rustc_polymorphize_error]
3434
pub fn unused_type<T>() -> impl Generator<(), Yield = u32, Return = u32> + Unpin {
35+
//~^ ERROR item has unused generic parameters
3536
|| {
3637
//~^ ERROR item has unused generic parameters
3738
yield 1;
@@ -57,6 +58,7 @@ pub fn used_type_in_return<R: Default>() -> impl Generator<(), Yield = u32, Retu
5758

5859
#[rustc_polymorphize_error]
5960
pub fn unused_const<const T: u32>() -> impl Generator<(), Yield = u32, Return = u32> + Unpin {
61+
//~^ ERROR item has unused generic parameters
6062
|| {
6163
//~^ ERROR item has unused generic parameters
6264
yield 1;

tests/ui/polymorphization/generators.stderr

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,34 @@ LL | #![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)]
88
= note: `#[warn(incomplete_features)]` on by default
99

1010
error: item has unused generic parameters
11-
--> $DIR/generators.rs:35:5
11+
--> $DIR/generators.rs:36:5
1212
|
1313
LL | pub fn unused_type<T>() -> impl Generator<(), Yield = u32, Return = u32> + Unpin {
1414
| - generic parameter `T` is unused
15+
LL |
1516
LL | || {
1617
| ^^
1718

1819
error: item has unused generic parameters
19-
--> $DIR/generators.rs:60:5
20+
--> $DIR/generators.rs:34:8
21+
|
22+
LL | pub fn unused_type<T>() -> impl Generator<(), Yield = u32, Return = u32> + Unpin {
23+
| ^^^^^^^^^^^ - generic parameter `T` is unused
24+
25+
error: item has unused generic parameters
26+
--> $DIR/generators.rs:62:5
2027
|
2128
LL | pub fn unused_const<const T: u32>() -> impl Generator<(), Yield = u32, Return = u32> + Unpin {
2229
| ------------ generic parameter `T` is unused
30+
LL |
2331
LL | || {
2432
| ^^
2533

26-
error: aborting due to 2 previous errors; 1 warning emitted
34+
error: item has unused generic parameters
35+
--> $DIR/generators.rs:60:8
36+
|
37+
LL | pub fn unused_const<const T: u32>() -> impl Generator<(), Yield = u32, Return = u32> + Unpin {
38+
| ^^^^^^^^^^^^ ------------ generic parameter `T` is unused
39+
40+
error: aborting due to 4 previous errors; 1 warning emitted
2741

0 commit comments

Comments
 (0)