-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Immediately register new opaque types in the global list.
Previously each opaque type instantiation would create new inference vars, even for the same opaque type/substs combination. Now there is a global map in InferCtxt that gets filled whenever we encounter an opaque type.
- Loading branch information
Showing
9 changed files
with
107 additions
and
119 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:8:5: 8:28] as FnOnce<()>>::Output == ()` | ||
--> $DIR/issue-63279.rs:5:16 | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-63279.rs:8:5 | ||
| | ||
LL | type Closure = impl FnOnce(); | ||
| ^^^^^^^^^^^^^ expected `()`, found opaque type | ||
| ------------- the found opaque type | ||
... | ||
LL | || -> Closure { || () } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure | ||
| | ||
= note: expected unit type `()` | ||
found opaque type `impl FnOnce<()>` | ||
= note: expected type `[closure@$DIR/issue-63279.rs:8:21: 8:26]` | ||
found closure `[closure@$DIR/issue-63279.rs:8:5: 8:28]` | ||
= note: no two closures, even if identical, have the same type | ||
= help: consider boxing your closure and/or using it as a trait object | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0271`. | ||
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
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,14 +1,9 @@ | ||
error: concrete type differs from previous defining opaque type use | ||
--> $DIR/issue-74280.rs:8:13 | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-74280.rs:9:5 | ||
| | ||
LL | let y = || -> Test { () }; | ||
| ^^^^^^^^^^^^^^^^^ expected `i32`, got `()` | ||
| | ||
note: previous use here | ||
--> $DIR/issue-74280.rs:7:1 | ||
| | ||
LL | fn test() -> Test { | ||
| ^^^^^^^^^^^^^^^^^ | ||
LL | 7 | ||
| ^ expected `()`, found integer | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |