Skip to content

Commit 0ce7db3

Browse files
committed
Perform KnownPanicsLint inside coroutines.
1 parent a46300a commit 0ce7db3

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

compiler/rustc_mir_transform/src/known_panics_lint.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ impl<'tcx> crate::MirLint<'tcx> for KnownPanicsLint {
4444
return;
4545
}
4646

47-
// FIXME(welseywiser) const prop doesn't work on coroutines because of query cycles
48-
// computing their layout.
49-
if tcx.is_coroutine(def_id.to_def_id()) {
50-
trace!("KnownPanicsLint skipped for coroutine {:?}", def_id);
51-
return;
52-
}
53-
5447
trace!("KnownPanicsLint starting for {:?}", def_id);
5548

5649
let mut linter = ConstPropagator::new(body, tcx);

tests/ui/async-await/future-sizes/async-awaiting-fut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//@ edition:2021
66
//@ build-pass
77
//@ ignore-pass
8-
//@ only-x86_64
8+
//@ only-64bit
99

1010
async fn wait() {}
1111

tests/ui/async-await/future-sizes/large-arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//@ edition: 2021
66
//@ build-pass
77
//@ ignore-pass
8-
//@ only-x86_64
8+
//@ only-64bit
99

1010
pub async fn test() {
1111
let _ = a([0u8; 1024]).await;

tests/ui/print_type_sizes/async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//@ edition:2021
66
//@ build-pass
77
//@ ignore-pass
8-
//@ only-x86_64
8+
//@ only-64bit
99

1010
#![allow(dropping_copy_types)]
1111

tests/ui/print_type_sizes/coroutine_discr_placement.stdout

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
print-type-size type: `std::pin::Pin<&mut {coroutine@$DIR/coroutine_discr_placement.rs:13:5: 13:7}>`: 8 bytes, alignment: 8 bytes
2+
print-type-size field `.pointer`: 8 bytes
13
print-type-size type: `{coroutine@$DIR/coroutine_discr_placement.rs:13:5: 13:7}`: 8 bytes, alignment: 4 bytes
24
print-type-size discriminant: 1 bytes
35
print-type-size variant `Unresumed`: 0 bytes
@@ -15,3 +17,9 @@ print-type-size type: `std::mem::MaybeUninit<i32>`: 4 bytes, alignment: 4 bytes
1517
print-type-size variant `MaybeUninit`: 4 bytes
1618
print-type-size field `.uninit`: 0 bytes
1719
print-type-size field `.value`: 4 bytes
20+
print-type-size type: `std::ops::CoroutineState<(), ()>`: 1 bytes, alignment: 1 bytes
21+
print-type-size discriminant: 1 bytes
22+
print-type-size variant `Yielded`: 0 bytes
23+
print-type-size field `.0`: 0 bytes
24+
print-type-size variant `Complete`: 0 bytes
25+
print-type-size field `.0`: 0 bytes

0 commit comments

Comments
 (0)