From 9eaec139d0a71993f5b4eeef739bd565123b607e Mon Sep 17 00:00:00 2001 From: oli Date: Sat, 26 Dec 2020 14:50:32 +0000 Subject: [PATCH] Small comment adjustments --- compiler/rustc_middle/src/query/mod.rs | 1 - compiler/rustc_mir/src/transform/mod.rs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 6da61486a55c..1bf246a7b4f2 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -935,7 +935,6 @@ rustc_queries! { } Codegen { - // FIXME: remove after figuring out how to make miri able to detect non-Rust function calls query is_ctfe_mir_available(key: DefId) -> bool { desc { |tcx| "checking if item has ctfe mir available: `{}`", tcx.def_path_str(key) } } diff --git a/compiler/rustc_mir/src/transform/mod.rs b/compiler/rustc_mir/src/transform/mod.rs index 03e27991d930..a9bc11502bb9 100644 --- a/compiler/rustc_mir/src/transform/mod.rs +++ b/compiler/rustc_mir/src/transform/mod.rs @@ -542,6 +542,9 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> { } match tcx.hir().body_const_context(did) { + /// Run the `mir_for_ctfe` query, which depends on `mir_drops_elaborated_and_const_checked` + /// which we are going to steal below. Thus we need to run `mir_for_ctfe` first, so it + /// computes and caches its result. Some(hir::ConstContext::ConstFn) => tcx.ensure().mir_for_ctfe(did), None => {} Some(other) => panic!("do not use `optimized_mir` for constants: {:?}", other),