Rollup merge of #137764 - compiler-errors:always-applicable-negative-impl, r=lcnr

Ensure that negative auto impls are always applicable

r? lcnr (or reassign if you dont want to review)

https://github.com/rust-lang/rust/issues/68318#issuecomment-2689265030
This commit is contained in:
Michael Goulet
2025-03-06 12:22:16 -05:00
committed by GitHub
23 changed files with 359 additions and 151 deletions

View File

@@ -62,9 +62,9 @@ a type parameter).
*/
pub mod always_applicable;
mod check;
mod compare_impl_item;
pub mod dropck;
mod entry;
pub mod intrinsic;
pub mod intrinsicck;
@@ -113,11 +113,11 @@ pub fn provide(providers: &mut Providers) {
}
fn adt_destructor(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::Destructor> {
tcx.calculate_dtor(def_id.to_def_id(), dropck::check_drop_impl)
tcx.calculate_dtor(def_id.to_def_id(), always_applicable::check_drop_impl)
}
fn adt_async_destructor(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::AsyncDestructor> {
tcx.calculate_async_dtor(def_id.to_def_id(), dropck::check_drop_impl)
tcx.calculate_async_dtor(def_id.to_def_id(), always_applicable::check_drop_impl)
}
/// Given a `DefId` for an opaque type in return position, find its parent item's return