Explain that the current impl is only silly, not recursive

This commit is contained in:
Ben Kimock
2025-10-26 22:13:12 -04:00
parent 6ba56d227f
commit a63035f9bf

View File

@@ -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,