forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#85755 - b-naber:unexpected_concrete_region, r…
…=nikomatsakis Replace parent substs of associated types with inference vars in borrow checker Fixes rust-lang#83190 Fixes rust-lang#78450 When we normalize an associated type that refers to an opaque type, it can happen that the substs of the associated type do not occur in the projection (they are parent substs). We previously didn't replace those substs with inference vars, which left a concrete region after all regions should have already been replaced with inference vars and triggered a `delay_span_bug`. After we normalize the opaque type, we now try to replace any remaining concrete regions with inference vars.
- Loading branch information
Showing
5 changed files
with
49 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
src/test/ui/type-alias-impl-trait/associated-type-lifetime-ice.rs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/test/ui/type-alias-impl-trait/associated-type-lifetime-ice.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// check-pass | ||
|
||
#![feature(min_type_alias_impl_trait)] | ||
#![feature(type_alias_impl_trait)] | ||
//~^ WARNING: the feature `type_alias_impl_trait` is incomplete | ||
|
||
pub trait AssociatedImpl { | ||
type ImplTrait; | ||
|
||
fn f() -> Self::ImplTrait; | ||
} | ||
|
||
struct S<T>(T); | ||
|
||
trait Associated { | ||
type A; | ||
} | ||
|
||
impl<'a, T: Associated<A = &'a ()>> AssociatedImpl for S<T> { | ||
type ImplTrait = impl core::fmt::Debug; | ||
|
||
fn f() -> Self::ImplTrait { | ||
() | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/issue-78450.rs:4:12 | ||
| | ||
LL | #![feature(type_alias_impl_trait)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information | ||
|
||
warning: 1 warning emitted | ||
|