Rollup merge of #125792 - compiler-errors:dont-drop-upcast-cand, r=lcnr
Don't drop `Unsize` candidate in intercrate mode Fixes #125767
This commit is contained in:
commit
e1745122ae
3 changed files with 30 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue