diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2025-07-23 21:46:43 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2025-07-25 08:49:31 -0500 |
| commit | cf4d7938cff6efd89c2605421a43600a7a5bb6c7 (patch) | |
| tree | 08ef048bb12d0f1b8c6b5d5c08136fbb74fd422d /compiler/rustc_ty_utils/src/ty.rs | |
| parent | b56aaec52bc0fa35591a872fb4aac81f606e265c (diff) | |
| download | rust-cf4d7938cff6efd89c2605421a43600a7a5bb6c7.tar.gz rust-cf4d7938cff6efd89c2605421a43600a7a5bb6c7.zip | |
Limit defaultness to impl of trait
Diffstat (limited to 'compiler/rustc_ty_utils/src/ty.rs')
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index f8d793464a9..18f10da8505 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -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); |
