forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#116494 - compiler-errors:typeck-coinductive-a…
…mbig, r=<try> [crater only] Always make inductive cycles as ambig during typeck r? `@ghost`
- Loading branch information
Showing
7 changed files
with
67 additions
and
135 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
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
37 changes: 12 additions & 25 deletions
37
tests/ui/impl-trait/in-trait/specialization-broken.stderr
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 |
---|---|---|
@@ -1,31 +1,18 @@ | ||
error[E0053]: method `bar` has an incompatible type for trait | ||
--> $DIR/specialization-broken.rs:16:22 | ||
error[E0391]: cycle detected when computing whether impls specialize one another | ||
--> $DIR/specialization-broken.rs:12:1 | ||
| | ||
LL | default impl<U> Foo for U | ||
| - this type parameter | ||
... | ||
LL | fn bar(&self) -> U { | ||
| ^ | ||
| | | ||
| expected associated type, found type parameter `U` | ||
| help: change the output type to match the trait: `impl Sized` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: type in trait | ||
--> $DIR/specialization-broken.rs:9:22 | ||
= note: ...which requires evaluating trait selection obligation `i32: Foo`... | ||
= note: ...which again requires computing whether impls specialize one another, completing the cycle | ||
note: cycle used when building specialization graph of trait `Foo` | ||
--> $DIR/specialization-broken.rs:8:1 | ||
| | ||
LL | fn bar(&self) -> impl Sized; | ||
| ^^^^^^^^^^ | ||
= note: expected signature `fn(&U) -> impl Sized` | ||
found signature `fn(&U) -> U` | ||
LL | trait Foo { | ||
| ^^^^^^^^^ | ||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information | ||
|
||
error: method with return-position `impl Trait` in trait cannot be specialized | ||
--> $DIR/specialization-broken.rs:16:5 | ||
| | ||
LL | fn bar(&self) -> U { | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: specialization behaves in inconsistent and surprising ways with `#![feature(return_position_impl_trait_in_trait)]`, and for now is disallowed | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0053`. | ||
For more information about this error, try `rustc --explain E0391`. |
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
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
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
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