Skip to content

Rollup of 7 pull requests #63807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0337cc1
Use more optimal Ord implementation for integers
tesuji Aug 21, 2019
96983fc
Add comment to avoid accidentally remove the changes.
tesuji Aug 21, 2019
3375b05
Fix confusion in theme picker functions
GuillaumeGomez Aug 21, 2019
a9900be
add amanjeev
mark-i-m Aug 21, 2019
f5b16f6
Add codegen test for integers compare
tesuji Aug 21, 2019
1c82987
Fix typo in E0308 if/else label
estebank Aug 21, 2019
ba8e094
Add clarification on E0308 about opaque types
estebank Aug 21, 2019
8c07d78
When declaring a declarative macro in an item it's only accessible in…
estebank Aug 16, 2019
4971667
review comments
estebank Aug 21, 2019
a710c61
review comments: reword and add test
estebank Aug 21, 2019
4f613ff
Fix naming misspelling
howjmay Aug 20, 2019
b7ad3f9
Apply clippy::redundant_field_names suggestion
mati865 Aug 22, 2019
7f4aba4
Apply clippy::needless_return suggestions
mati865 Aug 22, 2019
edabcdd
Apply clippy::let_and_return suggestion
mati865 Aug 22, 2019
8a26ba7
Rollup merge of #63624 - estebank:unreachable-macro, r=petrochenkov
Centril Aug 22, 2019
0784395
Rollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievink
Centril Aug 22, 2019
30fd79c
Rollup merge of #63767 - lzutao:integer-ord-suboptimal, r=nagisa
Centril Aug 22, 2019
1f56441
Rollup merge of #63782 - GuillaumeGomez:theme-switch-fix, r=kinnison
Centril Aug 22, 2019
6c1cdb7
Rollup merge of #63788 - mark-i-m:rustc-guide-toolstate-add, r=ehuss
Centril Aug 22, 2019
aa9490b
Rollup merge of #63796 - estebank:opaque_future, r=Centril
Centril Aug 22, 2019
3068064
Rollup merge of #63805 - mati865:clippy, r=Centril
Centril Aug 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review comments: reword and add test
  • Loading branch information
estebank committed Aug 21, 2019
commit a710c610b2ea1550014e9f6bd20e5e4aed8a716c
4 changes: 2 additions & 2 deletions src/librustc/ty/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ impl<'tcx> TyCtxt<'tcx> {
let f_str = values.found.to_string();
if &e_str == &f_str && &e_str == "impl std::future::Future" {
// FIXME: use non-string based check.
db.help("if both futures resolve to the same type, consider `await`ing \
on both of them");
db.help("if both `Future`s have the same `Output` type, consider \
`.await`ing on both of them");
}
}
if let (ty::Infer(ty::IntVar(_)), ty::Float(_)) =
Expand Down
24 changes: 24 additions & 0 deletions src/test/ui/suggestions/opaque-type-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// edition:2018
use core::future::Future;

async fn base_thing() -> Result<(), ()> {
Ok(())
}

fn thing_one() -> impl Future<Output = Result<(), ()>> {
base_thing()
}

fn thing_two() -> impl Future<Output = Result<(), ()>> {
base_thing()
}

async fn thing() -> Result<(), ()> {
if true {
thing_one()
} else {
thing_two() //~ ERROR if and else have incompatible types
}.await
}

fn main() {}
20 changes: 20 additions & 0 deletions src/test/ui/suggestions/opaque-type-error.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
error[E0308]: if and else have incompatible types
--> $DIR/opaque-type-error.rs:20:9
|
LL | / if true {
LL | | thing_one()
| | ----------- expected because of this
LL | | } else {
LL | | thing_two()
| | ^^^^^^^^^^^ expected opaque type, found a different opaque type
LL | | }.await
| |_____- if and else have incompatible types
|
= note: expected type `impl std::future::Future` (opaque type)
found type `impl std::future::Future` (opaque type)
= note: distinct uses of `impl Trait` result in different opaque types
= help: if both `Future`s have the same `Output` type, consider `.await`ing on both of them

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.