-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #111914 - rcvalle:rust-cfi-fix-111184, r=compiler-errors
CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi… Fixes #111184 by encoding ty::Generator parent substs only.
- Loading branch information
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Regression test for issue 111184, where ty::GeneratorWitness were not expected to occur in | ||
// encode_ty and caused the compiler to ICE. | ||
// | ||
// needs-sanitizer-cfi | ||
// compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021 | ||
// no-prefer-dynamic | ||
// only-x86_64-unknown-linux-gnu | ||
// run-pass | ||
|
||
use std::future::Future; | ||
|
||
async fn foo() {} | ||
fn bar<T>(_: impl Future<Output = T>) {} | ||
|
||
fn main() { | ||
bar(foo()); | ||
} |