-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #106302 - compiler-errors:terr-coerce-w-infer, r=estebank
Suppress errors due to TypeError not coercing with inference variables Fixes #75331 Fixes #68507 Fixes #82323 cc `@estebank`
- Loading branch information
Showing
11 changed files
with
35 additions
and
72 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
26 changes: 3 additions & 23 deletions
26
src/test/ui/expr/malformed_closure/ruby_style_closure.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,29 +1,9 @@ | ||
error[E0425]: cannot find value `x` in this scope | ||
--> $DIR/ruby_style_closure.rs:13:14 | ||
--> $DIR/ruby_style_closure.rs:12:14 | ||
| | ||
LL | Some(x * 2) | ||
| ^ not found in this scope | ||
|
||
error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<_>` | ||
--> $DIR/ruby_style_closure.rs:10:31 | ||
| | ||
LL | let p = Some(45).and_then({ | ||
| ______________________--------_^ | ||
| | | | ||
| | required by a bound introduced by this call | ||
LL | | | ||
LL | | |x| println!("doubling {}", x); | ||
LL | | Some(x * 2) | ||
| | ----------- this tail expression is of type `Option<_>` | ||
LL | | | ||
LL | | }); | ||
| |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>` | ||
| | ||
= help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` | ||
note: required by a bound in `Option::<T>::and_then` | ||
--> $SRC_DIR/core/src/option.rs:LL:COL | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
||
Some errors have detailed explanations: E0277, E0425. | ||
For more information about an error, try `rustc --explain E0277`. | ||
For more information about this error, try `rustc --explain E0425`. |
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,22 +1,15 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `foo` | ||
--> $DIR/issue-72911.rs:12:33 | ||
--> $DIR/issue-72911.rs:11:33 | ||
| | ||
LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> { | ||
| ^^^ use of undeclared crate or module `foo` | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `foo` | ||
--> $DIR/issue-72911.rs:17:41 | ||
--> $DIR/issue-72911.rs:16:41 | ||
| | ||
LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> { | ||
| ^^^ use of undeclared crate or module `foo` | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/issue-72911.rs:7:24 | ||
| | ||
LL | pub fn gather_all() -> impl Iterator<Item = Lint> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0282, E0433. | ||
For more information about an error, try `rustc --explain E0282`. | ||
For more information about this error, try `rustc --explain E0433`. |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
struct Foo { | ||
val: MissingType, | ||
//~^ ERROR cannot find type `MissingType` in this scope | ||
} | ||
|
||
fn main() { | ||
Foo { val: Default::default() }; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0412]: cannot find type `MissingType` in this scope | ||
--> $DIR/nonexistent-field-not-ambiguous.rs:2:10 | ||
| | ||
LL | val: MissingType, | ||
| ^^^^^^^^^^^ not found in this scope | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |