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.
Merge
impl_trait_in_assoc_types_defined_by
query back into `opaque_…
…types_defined_by` Instead, when we're collecting opaques for associated items, we choose the right collection mode depending on whether we're collecting for an associated item of a trait impl or not.
- Loading branch information
Showing
7 changed files
with
35 additions
and
53 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
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
13 changes: 9 additions & 4 deletions
13
tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.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,15 +1,20 @@ | ||
error: item constrains opaque type that is not in its signature | ||
error[E0308]: mismatched types | ||
--> $DIR/hidden_behind_struct_field2.rs:17:22 | ||
| | ||
LL | type Assoc = impl std::fmt::Debug; | ||
| -------------------- the expected opaque type | ||
LL | fn foo() -> Foo { | ||
LL | Foo { field: () } | ||
| ^^ | ||
| ^^ expected opaque type, found `()` | ||
| | ||
= note: this item must mention the opaque type in its signature in order to be able to register hidden types | ||
note: this item must mention the opaque type in its signature in order to be able to register hidden types | ||
= note: expected opaque type `<Bar as Trait>::Assoc` | ||
found unit type `()` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/hidden_behind_struct_field2.rs:16:8 | ||
| | ||
LL | fn foo() -> Foo { | ||
| ^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
13 changes: 9 additions & 4 deletions
13
tests/ui/type-alias-impl-trait/hidden_behind_struct_field3.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,15 +1,20 @@ | ||
error: item constrains opaque type that is not in its signature | ||
error[E0308]: mismatched types | ||
--> $DIR/hidden_behind_struct_field3.rs:19:27 | ||
| | ||
LL | type Assoc2 = impl std::fmt::Debug; | ||
| -------------------- the expected opaque type | ||
... | ||
LL | vec![Foo { field: () }].into_iter() | ||
| ^^ | ||
| ^^ expected opaque type, found `()` | ||
| | ||
= note: this item must mention the opaque type in its signature in order to be able to register hidden types | ||
note: this item must mention the opaque type in its signature in order to be able to register hidden types | ||
= note: expected opaque type `<Bar as Trait>::Assoc2` | ||
found unit type `()` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/hidden_behind_struct_field3.rs:18:8 | ||
| | ||
LL | fn foo() -> Self::Assoc { | ||
| ^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |