diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-26 15:28:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-26 15:28:02 +0200 |
| commit | d88aa06cd96aa52a602fec76c24e932cf27f97a3 (patch) | |
| tree | b97846e12460ec59a99b993a44d2d37bcd8ec26d /compiler/rustc_ty_utils/src | |
| parent | e2a5862d229e4293e4597d6fe0648ea0f991c4da (diff) | |
| parent | cf4d7938cff6efd89c2605421a43600a7a5bb6c7 (diff) | |
| download | rust-d88aa06cd96aa52a602fec76c24e932cf27f97a3.tar.gz rust-d88aa06cd96aa52a602fec76c24e932cf27f97a3.zip | |
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.
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -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); |
