Rollup merge of #79193 - tmiasko:revert-78969-normalize, r=davidtwco

Revert #78969 "Normalize function type during validation"

Closes #79066.
Reopens #78442.
This commit is contained in:
Dylan DPC 2020-11-19 23:58:43 +01:00 committed by GitHub
commit 084fc293eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 21 deletions

View file

@ -1,3 +1,7 @@
// revisions: default miropt
//[miropt]compile-flags: -Z mir-opt-level=2
// ~^ This flag is for #77668, it used to be ICE.
#![crate_type = "lib"]
pub fn bar<P>( // Error won't happen if "bar" is not generic

View file

@ -1,27 +1,17 @@
// 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
// run-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(());
}