Rollup merge of #144448 - camsteffen:defaultness-impl-trait-only, r=compiler-errors
Limit defaultness query to impl of trait I separated this out from https://github.com/rust-lang/rust/pull/144386.
This commit is contained in:
@@ -80,8 +80,11 @@ fn sizedness_constraint_for_ty<'tcx>(
|
||||
|
||||
fn defaultness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Defaultness {
|
||||
match tcx.hir_node_by_def_id(def_id) {
|
||||
hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(impl_), .. }) => impl_.defaultness,
|
||||
hir::Node::ImplItem(hir::ImplItem { defaultness, .. })
|
||||
hir::Node::Item(hir::Item {
|
||||
kind: hir::ItemKind::Impl(hir::Impl { defaultness, of_trait: Some(_), .. }),
|
||||
..
|
||||
})
|
||||
| hir::Node::ImplItem(hir::ImplItem { defaultness, .. })
|
||||
| hir::Node::TraitItem(hir::TraitItem { defaultness, .. }) => *defaultness,
|
||||
node => {
|
||||
bug!("`defaultness` called on {:?}", node);
|
||||
|
||||
Reference in New Issue
Block a user