forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#106302 - compiler-errors:terr-coerce-w-infe…
…r, r=estebank Suppress errors due to TypeError not coercing with inference variables Fixes rust-lang#75331 Fixes rust-lang#68507 Fixes rust-lang#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,14 @@ | ||
error[E0425]: cannot find value `oops` in this scope | ||
--> $DIR/fn-help-with-err.rs:14:35 | ||
--> $DIR/fn-help-with-err.rs:13:35 | ||
| | ||
LL | let arc = std::sync::Arc::new(oops); | ||
| ^^^^ not found in this scope | ||
|
||
error[E0599]: no method named `bar` found for struct `Arc<_>` in the current scope | ||
--> $DIR/fn-help-with-err.rs:17:9 | ||
| | ||
LL | arc.bar(); | ||
| ^^^ method not found in `Arc<_>` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
note: `Bar` defines an item `bar`, perhaps you need to implement it | ||
--> $DIR/fn-help-with-err.rs:5:1 | ||
| | ||
LL | trait Bar { | ||
| ^^^^^^^^^ | ||
|
||
error[E0599]: no method named `bar` found for struct `Arc<[[email protected]:22:36]>` in the current scope | ||
--> $DIR/fn-help-with-err.rs:23:10 | ||
error[E0599]: no method named `bar` found for struct `Arc<[[email protected]:18:36]>` in the current scope | ||
--> $DIR/fn-help-with-err.rs:19:10 | ||
| | ||
LL | arc2.bar(); | ||
| ^^^ method not found in `Arc<[[email protected]:22:36]>` | ||
| ^^^ method not found in `Arc<[[email protected]:18:36]>` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
note: `Bar` defines an item `bar`, perhaps you need to implement it | ||
|
@@ -34,7 +21,7 @@ help: use parentheses to call this closure | |
LL | arc2().bar(); | ||
| ++ | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0425, E0599. | ||
For more information about an 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
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`. |