diff options
| author | Michael Goulet <michael@errs.io> | 2023-08-09 00:31:26 +0000 |
|---|---|---|
| committer | Maybe Lapkin <waffle.lapkin@gmail.com> | 2024-10-17 20:43:31 +0200 |
| commit | e3800a1a04f338ce69bd403f230a019cebc54ece (patch) | |
| tree | 45940f80da51d580dbb2e2451c9be4bd1cd06168 /compiler/rustc_next_trait_solver | |
| parent | 3a85d3fa785d95a7b7bcf4f160b67bffba7afd4a (diff) | |
| download | rust-e3800a1a04f338ce69bd403f230a019cebc54ece.tar.gz rust-e3800a1a04f338ce69bd403f230a019cebc54ece.zip | |
Allow dropping dyn principal
Diffstat (limited to 'compiler/rustc_next_trait_solver')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/trait_goals.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 5828b2ecf34..2cbed0bceb2 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -785,7 +785,8 @@ where let mut responses = vec![]; // If the principal def ids match (or are both none), then we're not doing // trait upcasting. We're just removing auto traits (or shortening the lifetime). - if a_data.principal_def_id() == b_data.principal_def_id() { + let b_principal_def_id = b_data.principal_def_id(); + if a_data.principal_def_id() == b_principal_def_id || b_principal_def_id.is_none() { responses.extend(self.consider_builtin_upcast_to_principal( goal, CandidateSource::BuiltinImpl(BuiltinImplSource::Misc), |
