diff --git a/compiler/rustc_mir_transform/src/trivial_const.rs b/compiler/rustc_mir_transform/src/trivial_const.rs index bc66271e8ea1..af096f2b0468 100644 --- a/compiler/rustc_mir_transform/src/trivial_const.rs +++ b/compiler/rustc_mir_transform/src/trivial_const.rs @@ -83,6 +83,10 @@ where return None; } +// The query provider is based on calling the free function trivial_const, which calls mir_built, +// which internally has a fast-path for trivial consts so it too calls trivial_const. This isn't +// recursive, but we are checking if the const is trivial twice. A better design might detect +// trivial consts before getting to MIR, which would hopefully straighten this out. pub(crate) fn trivial_const_provider<'tcx>( tcx: TyCtxt<'tcx>, def: LocalDefId,