fix ICE
This commit is contained in:
parent
954d9a8f8e
commit
886c0e6388
4 changed files with 25 additions and 24 deletions
|
@ -89,6 +89,7 @@ fn relate_mir_and_user_substs<'tcx>(
|
||||||
def_id: hir::def_id::DefId,
|
def_id: hir::def_id::DefId,
|
||||||
user_substs: UserSubsts<'tcx>,
|
user_substs: UserSubsts<'tcx>,
|
||||||
) -> Result<(), NoSolution> {
|
) -> Result<(), NoSolution> {
|
||||||
|
let param_env = param_env.without_const();
|
||||||
let UserSubsts { user_self_ty, substs } = user_substs;
|
let UserSubsts { user_self_ty, substs } = user_substs;
|
||||||
let tcx = ocx.infcx.tcx;
|
let tcx = ocx.infcx.tcx;
|
||||||
let cause = ObligationCause::dummy_with_span(span);
|
let cause = ObligationCause::dummy_with_span(span);
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
// known-bug: #88119
|
// check-pass
|
||||||
// failure-status: 101
|
|
||||||
// normalize-stderr-test "note: .*\n" -> ""
|
|
||||||
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
|
|
||||||
// normalize-stderr-test "\s\d{1,}: .*\n" -> ""
|
|
||||||
// normalize-stderr-test "\s at .*\n" -> ""
|
|
||||||
// rustc-env:RUST_BACKTRACE=0
|
|
||||||
|
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
#![feature(const_trait_impl, generic_const_exprs)]
|
#![feature(const_trait_impl, generic_const_exprs)]
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,23 @@
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
struct LazyLock<T> {
|
||||||
|
data: (Option<T>, fn() -> T),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> LazyLock<T> {
|
||||||
|
pub const fn new(f: fn() -> T) -> LazyLock<T> {
|
||||||
|
LazyLock { data: (None, f) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct A<T = i32>(Option<T>);
|
||||||
|
|
||||||
|
impl<T> Default for A<T> {
|
||||||
|
fn default() -> Self {
|
||||||
|
A(None)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static EMPTY_SET: LazyLock<A<i32>> = LazyLock::new(A::default);
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Add table
Reference in a new issue