-
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.
Properly find owner of closure in THIR unsafeck
Co-authored-by: FabianWolff <fabian.wolff@alumni.ethz.ch>
- Loading branch information
1 parent
71a6c7c
commit 1280423
Showing
2 changed files
with
19 additions
and
7 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,15 @@ | ||
// Regression test for #87414. | ||
|
||
// check-pass | ||
// compile-flags: -Zthir-unsafeck | ||
|
||
fn bad<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> { todo!() } | ||
|
||
fn foo() -> [(); { |x: u32| { x }; 4 }] { todo!() } | ||
fn bar() { let _: [(); { |x: u32| { x }; 4 }]; } | ||
|
||
// This one should not cause any errors either: | ||
unsafe fn unsf() {} | ||
fn bad2<T>() -> Box<dyn Iterator<Item = [(); { unsafe { || { unsf() } }; 4 }]>> { todo!() } | ||
|
||
fn main() {} |