forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#98761 - lcnr:need_type_info-cont, r=estebank
more `need_type_info` improvements this now deals with macros in suggestions and the source cost computation does what I want for `channel` 🎉 r? `@estebank`
- Loading branch information
Showing
14 changed files
with
167 additions
and
90 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
15 changes: 7 additions & 8 deletions
15
src/test/ui/inference/cannot-infer-partial-try-return.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
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,19 @@ | ||
// Test that we suggest specifying the generic argument of `channel` | ||
// instead of the return type of that function, which is a lot more | ||
// complex. | ||
use std::sync::mpsc::channel; | ||
|
||
fn no_tuple() { | ||
let _data = | ||
channel(); //~ ERROR type annotations needed | ||
} | ||
|
||
fn tuple() { | ||
let (_sender, _receiver) = | ||
channel(); //~ ERROR type annotations needed | ||
} | ||
|
||
fn main() { | ||
no_tuple(); | ||
tuple(); | ||
} |
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,25 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/channel.rs:8:9 | ||
| | ||
LL | channel(); | ||
| ^^^^^^^ cannot infer type of the type parameter `T` declared on the function `channel` | ||
| | ||
help: consider specifying the generic argument | ||
| | ||
LL | channel::<T>(); | ||
| +++++ | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/channel.rs:13:9 | ||
| | ||
LL | channel(); | ||
| ^^^^^^^ cannot infer type of the type parameter `T` declared on the function `channel` | ||
| | ||
help: consider specifying the generic argument | ||
| | ||
LL | channel::<T>(); | ||
| +++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
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
Oops, something went wrong.