Skip to content

Commit 72d380f

Browse files
authored
Unrolled build for rust-lang#118210
Rollup merge of rust-lang#118210 - lcnr:intercrate-ambiguity-causes-uwu, r=compiler-errors intercrate ambiguity causes: ignore candidates which don't apply r? `@compiler-errors`
2 parents 4fd68eb + d51ef5c commit 72d380f

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,10 @@ impl<'a, 'tcx> ProofTreeVisitor<'tcx> for AmbiguityCausesVisitor<'a> {
10501050
let mut ambiguity_cause = None;
10511051
for cand in goal.candidates() {
10521052
// FIXME: boiiii, using string comparisions here sure is scuffed.
1053-
if let inspect::ProbeKind::MiscCandidate { name: "coherence unknowable", result: _ } =
1054-
cand.kind()
1053+
if let inspect::ProbeKind::MiscCandidate {
1054+
name: "coherence unknowable",
1055+
result: Ok(_),
1056+
} = cand.kind()
10551057
{
10561058
let lazily_normalize_ty = |ty: Ty<'tcx>| {
10571059
let mut fulfill_cx = <dyn TraitEngine<'tcx>>::new(infcx);

tests/ui/error-codes/E0476.stderr renamed to tests/ui/error-codes/E0476.next.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `CoerceUnsized<&Wrapper<_>>` for type `&Wrapper<_>`
2-
--> $DIR/E0476.rs:9:1
2+
--> $DIR/E0476.rs:11:1
33
|
44
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,18 +9,18 @@ LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S
99
where 'b: 'a, T: Unsize<U>, T: ?Sized, U: ?Sized;
1010

1111
error[E0476]: lifetime of the source pointer does not outlive lifetime bound of the object type
12-
--> $DIR/E0476.rs:9:1
12+
--> $DIR/E0476.rs:11:1
1313
|
1414
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616
|
1717
note: object type is valid for the lifetime `'a` as defined here
18-
--> $DIR/E0476.rs:9:6
18+
--> $DIR/E0476.rs:11:6
1919
|
2020
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
2121
| ^^
2222
note: source pointer is only valid for the lifetime `'b` as defined here
23-
--> $DIR/E0476.rs:9:10
23+
--> $DIR/E0476.rs:11:10
2424
|
2525
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
2626
| ^^

tests/ui/error-codes/E0476.old.stderr

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
error[E0119]: conflicting implementations of trait `CoerceUnsized<&Wrapper<_>>` for type `&Wrapper<_>`
2+
--> $DIR/E0476.rs:11:1
3+
|
4+
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: conflicting implementation in crate `core`:
8+
- impl<'a, 'b, T, U> CoerceUnsized<&'a U> for &'b T
9+
where 'b: 'a, T: Unsize<U>, T: ?Sized, U: ?Sized;
10+
11+
error[E0476]: lifetime of the source pointer does not outlive lifetime bound of the object type
12+
--> $DIR/E0476.rs:11:1
13+
|
14+
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
|
17+
note: object type is valid for the lifetime `'a` as defined here
18+
--> $DIR/E0476.rs:11:6
19+
|
20+
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
21+
| ^^
22+
note: source pointer is only valid for the lifetime `'b` as defined here
23+
--> $DIR/E0476.rs:11:10
24+
|
25+
LL | impl<'a, 'b, T, S> CoerceUnsized<&'a Wrapper<T>> for &'b Wrapper<S> where S: Unsize<T> {}
26+
| ^^
27+
28+
error: aborting due to 2 previous errors
29+
30+
Some errors have detailed explanations: E0119, E0476.
31+
For more information about an error, try `rustc --explain E0119`.

tests/ui/error-codes/E0476.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// revisions: old next
2+
//[next] compile-flags: -Ztrait-solver=next-coherence
13
#![feature(coerce_unsized)]
24
#![feature(unsize)]
35

0 commit comments

Comments
 (0)