Rollup merge of #83954 - estebank:issue-83613, r=varkor
Do not ICE when closure is involved in Trait Alias Impl Trait Fix #83613.
This commit is contained in:
commit
d82419b406
64 changed files with 125 additions and 84 deletions
|
@ -586,6 +586,11 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
|
|||
false
|
||||
}
|
||||
|
||||
ty::Closure(..) => {
|
||||
// Similar to the `Opaque` case (#83613).
|
||||
false
|
||||
}
|
||||
|
||||
ty::Dynamic(ref tt, ..) => {
|
||||
if let Some(principal) = tt.principal() {
|
||||
def_id_is_local(principal.def_id(), in_crate)
|
||||
|
@ -596,7 +601,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
|
|||
|
||||
ty::Error(_) => true,
|
||||
|
||||
ty::Closure(..) | ty::Generator(..) | ty::GeneratorWitness(..) => {
|
||||
ty::Generator(..) | ty::GeneratorWitness(..) => {
|
||||
bug!("ty_is_local invoked on unexpected type: {:?}", ty)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -395,14 +395,14 @@ fn report_conflicting_impls(
|
|||
// that's passed in.
|
||||
let decorate = |err: LintDiagnosticBuilder<'_>| {
|
||||
let msg = format!(
|
||||
"conflicting implementations of trait `{}`{}:{}",
|
||||
"conflicting implementations of trait `{}`{}{}",
|
||||
overlap.trait_desc,
|
||||
overlap
|
||||
.self_desc
|
||||
.clone()
|
||||
.map_or_else(String::new, |ty| { format!(" for type `{}`", ty) }),
|
||||
match used_to_be_allowed {
|
||||
Some(FutureCompatOverlapErrorKind::Issue33140) => " (E0119)",
|
||||
Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)",
|
||||
_ => "",
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue