Skip to content

Commit d82419b

Browse files
authoredApr 7, 2021
Rollup merge of #83954 - estebank:issue-83613, r=varkor
Do not ICE when closure is involved in Trait Alias Impl Trait Fix #83613.
2 parents d7d42cc + 18cf44b commit d82419b

File tree

64 files changed

+125
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+125
-84
lines changed
 

‎compiler/rustc_trait_selection/src/traits/coherence.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
586586
false
587587
}
588588

589+
ty::Closure(..) => {
590+
// Similar to the `Opaque` case (#83613).
591+
false
592+
}
593+
589594
ty::Dynamic(ref tt, ..) => {
590595
if let Some(principal) = tt.principal() {
591596
def_id_is_local(principal.def_id(), in_crate)
@@ -596,7 +601,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
596601

597602
ty::Error(_) => true,
598603

599-
ty::Closure(..) | ty::Generator(..) | ty::GeneratorWitness(..) => {
604+
ty::Generator(..) | ty::GeneratorWitness(..) => {
600605
bug!("ty_is_local invoked on unexpected type: {:?}", ty)
601606
}
602607
}

‎compiler/rustc_trait_selection/src/traits/specialize/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,14 @@ fn report_conflicting_impls(
395395
// that's passed in.
396396
let decorate = |err: LintDiagnosticBuilder<'_>| {
397397
let msg = format!(
398-
"conflicting implementations of trait `{}`{}:{}",
398+
"conflicting implementations of trait `{}`{}{}",
399399
overlap.trait_desc,
400400
overlap
401401
.self_desc
402402
.clone()
403403
.map_or_else(String::new, |ty| { format!(" for type `{}`", ty) }),
404404
match used_to_be_allowed {
405-
Some(FutureCompatOverlapErrorKind::Issue33140) => " (E0119)",
405+
Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)",
406406
_ => "",
407407
}
408408
);

0 commit comments

Comments
 (0)
Please sign in to comment.