diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-16 23:45:01 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-20 04:38:55 +0000 |
| commit | ca68cf0d46ec3485be177eeec3f4a4662b21bc8c (patch) | |
| tree | c7571dca43b2bd7d7c391c4640c20dd6e993c797 /compiler/rustc_trait_selection/src/traits/project.rs | |
| parent | 91e5c3f2e5d0a20ffc9b2e80ea049e77d5721da0 (diff) | |
| download | rust-ca68cf0d46ec3485be177eeec3f4a4662b21bc8c.tar.gz rust-ca68cf0d46ec3485be177eeec3f4a4662b21bc8c.zip | |
Merge attrs, better validation
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/project.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 563cc257e03..5554c8a0cc4 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -1586,6 +1586,10 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>( let tcx = selcx.tcx(); + if !tcx.trait_def(obligation.predicate.trait_def_id(tcx)).implement_via_object { + return; + } + let self_ty = obligation.predicate.self_ty(); let object_ty = selcx.infcx.shallow_resolve(self_ty); let data = match object_ty.kind() { |
