-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, …
…r=oli-obk Revert "Normalize opaques with escaping bound vars" This caused a perf regression in #103423, cc `@skyzh` this should fix #103423. reverts #100980 r? `@oli-obk`
- Loading branch information
Showing
5 changed files
with
49 additions
and
26 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
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,39 @@ | ||
// known-bug: #103507 | ||
// failure-status: 101 | ||
// normalize-stderr-test "note: .*\n\n" -> "" | ||
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" | ||
// rustc-env:RUST_BACKTRACE=0 | ||
|
||
#![feature(type_alias_impl_trait)] | ||
#![feature(const_trait_impl)] | ||
#![feature(const_refs_to_cell)] | ||
#![feature(inline_const)] | ||
|
||
use std::marker::Destruct; | ||
|
||
trait T { | ||
type Item; | ||
} | ||
|
||
type Alias<'a> = impl T<Item = &'a ()>; | ||
|
||
struct S; | ||
impl<'a> T for &'a S { | ||
type Item = &'a (); | ||
} | ||
|
||
const fn filter_positive<'a>() -> &'a Alias<'a> { | ||
&&S | ||
} | ||
|
||
const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ||
fun(filter_positive()); | ||
} | ||
|
||
const fn foo(_: &Alias<'_>) {} | ||
|
||
const BAR: () = { | ||
with_positive(foo); | ||
}; | ||
|
||
fn main() {} |
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,8 @@ | ||
error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:198:90: Failed to normalize <for<'a, 'b> fn(&'a Alias<'b>) {foo} as std::ops::FnOnce<(&&S,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead | ||
|
||
query stack during panic: | ||
#0 [eval_to_allocation_raw] const-evaluating + checking `BAR` | ||
#1 [eval_to_const_value_raw] simplifying constant for the type system `BAR` | ||
end of query stack | ||
error: aborting due to previous error | ||
|
This file was deleted.
Oops, something went wrong.