We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c115ad9 + be92200 commit 09d6a65Copy full SHA for 09d6a65
src/librustc_mir/const_eval/eval_queries.rs
@@ -288,7 +288,10 @@ pub fn const_eval_raw_provider<'tcx>(
288
let cid = key.value;
289
let def_id = cid.instance.def.def_id();
290
291
- if def_id.is_local() && tcx.typeck_tables_of(def_id).tainted_by_errors {
+ if def_id.is_local()
292
+ && tcx.has_typeck_tables(def_id)
293
+ && tcx.typeck_tables_of(def_id).tainted_by_errors
294
+ {
295
return Err(ErrorHandled::Reported);
296
}
297
src/test/ui/consts/issue-68684.rs
@@ -0,0 +1,15 @@
1
+// check-pass
2
+
3
+enum _Enum {
4
+ A(),
5
+}
6
7
+type _E = _Enum;
8
9
+const fn _a() -> _Enum {
10
+ _E::A()
11
12
13
+const _A: _Enum = _a();
14
15
+fn main() {}
0 commit comments