Skip to content
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

Rollup of 9 pull requests #64944

Closed
wants to merge 50 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2cb460e
Use `saturating_sub` where applicable
AnthonyMikh Sep 25, 2019
e9a93be
Use `max` instead of `if`s
AnthonyMikh Sep 25, 2019
4fc5650
Simplify Unicode-aware trimming
AnthonyMikh Sep 25, 2019
d6327e8
Use map + sum instead of fold for computing Unicode width
AnthonyMikh Sep 25, 2019
aef169b
Use Option::map_or where applicable
AnthonyMikh Sep 25, 2019
9b447e2
Unify order of variables in chained comparison
AnthonyMikh Sep 25, 2019
f93827f
Simplify `Emitter::fix_multispan_in_std_macros`
AnthonyMikh Sep 25, 2019
ea32862
Use `sort_by_key` rather than `sort_by`
AnthonyMikh Sep 25, 2019
7a0725f
Simplify `style_or_override`
AnthonyMikh Sep 25, 2019
75a7c27
Revert "Simplify Unicode-aware trimming"
AnthonyMikh Sep 26, 2019
3eba6c1
syntax: recover trailing `|` in or-patterns.
Centril Sep 29, 2019
d938a80
Fixed grammar for some `time` fn calls and a diagnostic.
alexreg Sep 30, 2019
fdd1a62
Added backticks for one diagnostic message.
alexreg Sep 30, 2019
8a4af2f
Fixed weird non-sequential indices for serialisation of `SourceFile` …
alexreg Sep 30, 2019
13b61b5
Fixed grammar in one diagnostic and blessed tests.
alexreg Sep 29, 2019
49c6c86
Fixed stylistic convention for one diagnostic and blessed tests.
alexreg Sep 30, 2019
33ed03f
Cleaned up a few doc comments in libfmt_macros.
alexreg Sep 30, 2019
349259d
Stabilize macros in `extern` blocks
petrochenkov Aug 26, 2019
5ae38bb
Stabilize proc macros in type positions
petrochenkov Aug 27, 2019
b04d5f7
Upgrade Emscripten targets to use upstream LLVM backend
tlively Aug 17, 2019
535d474
syntax: Split `ast::Attribute` into container and inner parts
petrochenkov Aug 17, 2019
576c215
Add test for #50571
JohnTitor Sep 30, 2019
bc25746
Add test for #58022
JohnTitor Sep 30, 2019
9c73131
Add test for #58344
JohnTitor Sep 30, 2019
957986d
syntax: Support modern attribute syntax in the `meta` matcher
petrochenkov Aug 17, 2019
870b47f
typeck: silence unreachable code from await
davidtwco Sep 30, 2019
7dc953b
Simplify code for special case of annotation
AnthonyMikh Sep 30, 2019
6b6a79b
Simplify `EmitterWriter::get_multispan_max_line_num`
AnthonyMikh Sep 30, 2019
7b4c5c6
Simplify `EmitterWriter::get_max_line_num`
AnthonyMikh Sep 30, 2019
21724ed
Update doc comment for `style_or_override`
AnthonyMikh Sep 30, 2019
7a807c5
Simplify `EmitterWriter::emit_suggestion_default`
AnthonyMikh Sep 30, 2019
9d73176
Remove redundant `.iter_mut()`
AnthonyMikh Sep 30, 2019
55b5428
Simplify a conditional in `collect_annotations`
AnthonyMikh Sep 30, 2019
6ea4a52
Address review comments
petrochenkov Sep 30, 2019
bb44288
Use pattern matching instead of indexing tuples
AnthonyMikh Sep 30, 2019
e5db5b3
(fmt) remove trailing whitespaces
AnthonyMikh Sep 30, 2019
61bc38e
Fix errors
AnthonyMikh Sep 30, 2019
515262c
Ascript type explicitly
AnthonyMikh Sep 30, 2019
fdce416
Hint type for `.sum()`
AnthonyMikh Oct 1, 2019
50c2a58
Fix borrowck errors
AnthonyMikh Oct 1, 2019
13e9b3d
Deduplicate closure type errors
estebank Oct 1, 2019
2aafa46
Rollup merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexc…
Centril Oct 1, 2019
3ca5804
Rollup merge of #63674 - petrochenkov:meta2, r=Centril
Centril Oct 1, 2019
8bae91d
Rollup merge of #63931 - petrochenkov:stabmac, r=Centril
Centril Oct 1, 2019
8206e61
Rollup merge of #64887 - Centril:recover-trailing-vert, r=estebank
Centril Oct 1, 2019
857b2b9
Rollup merge of #64907 - alexreg:tidy-up, r=Mark-Simulacrum
Centril Oct 1, 2019
0aaab33
Rollup merge of #64928 - JohnTitor:add-some-tests, r=Centril
Centril Oct 1, 2019
cac592f
Rollup merge of #64930 - davidtwco:issue-61798-diverging-await, r=pet…
Centril Oct 1, 2019
3ff0f33
Rollup merge of #64935 - AnthonyMikh:librustc_errors/emmiter__code-cl…
Centril Oct 1, 2019
7ca64cc
Rollup merge of #64937 - estebank:dedup-closure-err, r=Centril
Centril Oct 1, 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
3 changes: 2 additions & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
@@ -2364,7 +2364,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// which diverges, that we are about to lint on. This gives suboptimal diagnostics.
// Instead, stop here so that the `if`- or `while`-expression's block is linted instead.
if !span.is_desugaring(DesugaringKind::CondTemporary) &&
!span.is_desugaring(DesugaringKind::Async)
!span.is_desugaring(DesugaringKind::Async) &&
!orig_span.is_desugaring(DesugaringKind::Await)
{
self.diverges.set(Diverges::WarnedAlways);

12 changes: 12 additions & 0 deletions src/test/ui/async-await/unreachable-lint-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// edition:2018
#![deny(unreachable_code)]

async fn foo() {
return; bar().await;
//~^ ERROR unreachable statement
}

async fn bar() {
}

fn main() { }
16 changes: 16 additions & 0 deletions src/test/ui/async-await/unreachable-lint-1.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error: unreachable statement
--> $DIR/unreachable-lint-1.rs:5:13
|
LL | return; bar().await;
| ------ ^^^^^^^^^^^^ unreachable statement
| |
| any code following this expression is unreachable
|
note: lint level defined here
--> $DIR/unreachable-lint-1.rs:2:9
|
LL | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^

error: aborting due to previous error

13 changes: 13 additions & 0 deletions src/test/ui/async-await/unreachable-lint.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// check-pass
// edition:2018
#![deny(unreachable_code)]

async fn foo() {
endless().await;
}

async fn endless() -> ! {
loop {}
}

fn main() { }