Rollup merge of #139349 - meithecatte:destructor-constness, r=compiler-errors
adt_destructor: sanity-check returned item Fixes #139278
This commit is contained in:
commit
0a9eae161b
3 changed files with 33 additions and 0 deletions
|
@ -414,6 +414,11 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
continue;
|
||||
};
|
||||
|
||||
if self.def_kind(item_id) != DefKind::AssocFn {
|
||||
self.dcx().span_delayed_bug(self.def_span(item_id), "drop is not a function");
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(old_item_id) = dtor_candidate {
|
||||
self.dcx()
|
||||
.struct_span_err(self.def_span(item_id), "multiple drop impls found")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue