diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-30 19:45:27 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-30 19:45:59 -0400 |
| commit | e485b193d07a77495dcdcb3f52f5976c9c9ca1f4 (patch) | |
| tree | e38739b95556b6ac3a69a4b480fc7bbdf9b7fdcc /compiler/rustc_trait_selection/src/traits | |
| parent | 6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4 (diff) | |
| download | rust-e485b193d07a77495dcdcb3f52f5976c9c9ca1f4.tar.gz rust-e485b193d07a77495dcdcb3f52f5976c9c9ca1f4.zip | |
Don't drop Upcast candidate in intercrate mode
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index fd7c47ad6fb..f0ecbd83341 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -921,6 +921,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { param_env: ty::ParamEnv<'tcx>, cause: &ObligationCause<'tcx>, ) -> Option<ty::PolyExistentialTraitRef<'tcx>> { + // Don't drop any candidates in intercrate mode, as it's incomplete. + // (Not that it matters, since `Unsize` is not a stable trait.) + if self.infcx.intercrate { + return None; + } + let tcx = self.tcx(); if tcx.features().trait_upcasting { return None; |
