Skip to content

Commit 886c0e6

Browse files
committed
fix ICE
1 parent 954d9a8 commit 886c0e6

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

compiler/rustc_traits/src/type_op.rs

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ fn relate_mir_and_user_substs<'tcx>(
8989
def_id: hir::def_id::DefId,
9090
user_substs: UserSubsts<'tcx>,
9191
) -> Result<(), NoSolution> {
92+
let param_env = param_env.without_const();
9293
let UserSubsts { user_self_ty, substs } = user_substs;
9394
let tcx = ocx.infcx.tcx;
9495
let cause = ObligationCause::dummy_with_span(span);

tests/ui/const-generics/issues/issue-88119.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
// known-bug: #88119
2-
// failure-status: 101
3-
// normalize-stderr-test "note: .*\n" -> ""
4-
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
5-
// normalize-stderr-test "\s\d{1,}: .*\n" -> ""
6-
// normalize-stderr-test "\s at .*\n" -> ""
7-
// rustc-env:RUST_BACKTRACE=0
1+
// check-pass
82

93
#![allow(incomplete_features)]
104
#![feature(const_trait_impl, generic_const_exprs)]

tests/ui/const-generics/issues/issue-88119.stderr

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// check-pass
2+
3+
struct LazyLock<T> {
4+
data: (Option<T>, fn() -> T),
5+
}
6+
7+
impl<T> LazyLock<T> {
8+
pub const fn new(f: fn() -> T) -> LazyLock<T> {
9+
LazyLock { data: (None, f) }
10+
}
11+
}
12+
13+
struct A<T = i32>(Option<T>);
14+
15+
impl<T> Default for A<T> {
16+
fn default() -> Self {
17+
A(None)
18+
}
19+
}
20+
21+
static EMPTY_SET: LazyLock<A<i32>> = LazyLock::new(A::default);
22+
23+
fn main() {}

0 commit comments

Comments
 (0)