forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#78969 - tmiasko:normalize, r=davidtwco
Normalize function type during validation During inlining, the callee body is normalized and has types revealed, but some of locals corresponding to the arguments might come from the caller body which is not. As a result the caller body does not pass validation without additional normalization. Closes rust-lang#78442.
- Loading branch information
Showing
3 changed files
with
21 additions
and
16 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
4 changes: 0 additions & 4 deletions
4
src/test/ui/issues/issue-50865-private-impl-trait/auxiliary/lib.rs
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 |
---|---|---|
@@ -1,17 +1,27 @@ | ||
// run-pass | ||
// Regression test for various issues related to normalization & inlining. | ||
// * #68347, #77306, #77668 - missed normalization during inlining. | ||
// * #78442 - missed normalization in validator after inlining. | ||
// | ||
// build-pass | ||
// compile-flags:-Zmir-opt-level=2 | ||
|
||
// Previously ICEd because we did not normalize during inlining, | ||
// see https://github.com/rust-lang/rust/pull/77306 for more discussion. | ||
|
||
pub fn write() { | ||
create()() | ||
} | ||
|
||
pub fn write_generic<T>(_t: T) { | ||
hide()(); | ||
} | ||
|
||
pub fn create() -> impl FnOnce() { | ||
|| () | ||
} | ||
|
||
pub fn hide() -> impl Fn() { | ||
write | ||
} | ||
|
||
fn main() { | ||
write(); | ||
write_generic(()); | ||
} |