1
Fork 0

Add a note for unsatisfied ~const Drop bounds

This commit is contained in:
Deadbeef 2022-04-10 17:36:08 +10:00
parent e745b4ddbd
commit 7f54d68f26
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
3 changed files with 33 additions and 17 deletions

View file

@ -439,6 +439,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()
{