Rollup merge of #95876 - fee1-dead:note-const-drop, r=oli-obk

Add a note for unsatisfied `~const Drop` bounds

r? ``@oli-obk``
This commit is contained in:
Matthias Krüger
2022-04-11 12:06:56 +02:00
committed by GitHub
3 changed files with 33 additions and 17 deletions

View File

@@ -440,6 +440,13 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
}
}
if Some(trait_ref.def_id()) == tcx.lang_items().drop_trait()
&& predicate_is_const
{
err.note("`~const Drop` was renamed to `~const Destruct`");
err.note("See <https://github.com/rust-lang/rust/pull/94901> for more details");
}
let explanation = if let ObligationCauseCode::MainFunctionType =
obligation.cause.code()
{