8000 Rollup of 10 pull requests by Centril · Pull Request #64883 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 10 pull requests #64883

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 26 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
68d099a
Create new error code E0734 for stability attributes used outside of …
GuillaumeGomez Sep 25, 2019
0ec4513
Fix format macro expansions spans to be macro-generated
rinon Sep 25, 2019
0ebb044
Add long error explanation for E0734
GuillaumeGomez Sep 25, 2019
2e78683
Update ui tests
GuillaumeGomez Sep 25, 2019
ecfe92f
Don't check error_codes files for lints
GuillaumeGomez Sep 27, 2019
ac9aed5
getting more context for duplicate lang items (fixes #60561)
tomtau Sep 27, 2019
f922483
Print ParamTy span when accessing a field (#52082)
Baranowski Sep 26, 2019
d35f25c
Filter out stmts made for the redundant_semicolon lint when pretty-pr…
nathanwhit Sep 12, 2019
66c33c0
Add test for redundant_semicolon lint interaction with proc macro attrs
nathanwhit Sep 28, 2019
800bd3a
data_structures: Add deterministic FxHashMap and FxHashSet wrappers
inashivb Sep 3, 2019
fd505d7
Improve wording in documentation of MaybeUninit
nliberg Sep 27, 2019
f3744a1
Implement CRs
Baranowski Sep 28, 2019
9ad99c3
Refactor into ban_nonexisting_field method
Baranowski Sep 28, 2019
f6cecce
Upgrade async/await to "used" keywords.
ehuss Sep 28, 2019
c666bd5
Fix typo in intrinsics op safety
vertexclique Sep 28, 2019
e77dfa2
Slice docs: fix typo
llogiq Sep 28, 2019
b18d861
Rollup merge of #64131 - shivan1b:deterministic-fxhashmap, r=Mark-Sim…
Centril Sep 28, 2019
55a3ead
Rollup merge of #64387 - nathanwhit:redundant-semi-fix, r=varkor
Centril Sep 28, 2019
05881d0
Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasper
Centril Sep 28, 2019
01075d8
Rollup merge of #64763 - GuillaumeGomez:long-err-explanation-E0734, r…
Centril Sep 28, 2019
d9168e4
Rollup merge of #64793 - immunant:format_spans, r=matthewjasper
Centril Sep 28, 2019
69a3009
Rollup merge of #64837 - nliberg:patch-2, r=Centril
Centril Sep 28, 2019
6145757
Rollup merge of #64852 - Baranowski:param_note_52082, r=estebank
Centril Sep 28, 2019
787829d
Rollup merge of #64875 - ehuss:async-await-reserved, r=estebank
Centril Sep 28, 2019
1c2dd14
Rollup merge of #64876 - vertexclique:vcq/fix-fn-name-intrinsic-op-un…
Centril Sep 28, 2019
4652671
Rollup merge of #64880 - llogiq:slice-docs, r=Centril
Centril Sep 28, 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
Upgrade async/await to "used" keywords.
  • Loading branch information
ehuss committed Sep 28, 2019
commit f6ceccea935e2ed7f55109b9a2cc2addfe894dff
8 changes: 4 additions & 4 deletions src/libsyntax_pos/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ symbols! {
Yield: "yield",

// Edition-specific keywords that are used in stable Rust.
Async: "async", // >= 2018 Edition only
Await: "await", // >= 2018 Edition only
Dyn: "dyn", // >= 2018 Edition only

// Edition-specific keywords that are used in unstable Rust or reserved for future use.
Async: "async", // >= 2018 Edition only
Await: "await", // >= 2018 Edition only
Try: "try", // >= 2018 Edition only

// Special lifetime names
Expand Down Expand Up @@ -1088,11 +1088,11 @@ pub mod sym {

impl Symbol {
fn is_used_keyword_2018(self) -> bool {
self == kw::Dyn
self >= kw::Async && self <= kw::Dyn
}

fn is_unused_keyword_2018(self) -> bool {
self >= kw::Async && self <= kw::Try
self == kw::Try
}

/// Used for sanity checking rustdoc keyword sections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
#![allow(non_camel_case_types)]

mod outer_mod {
pub mod await { //~ ERROR expected identifier, found reserved keyword `await`
pub struct await; //~ ERROR expected identifier, found reserved keyword `await`
pub mod await { //~ ERROR expected identifier, found keyword `await`
pub struct await; //~ ERROR expected identifier, found keyword `await`
}
}
use self::outer_mod::await::await; //~ ERROR expected identifier, found reserved keyword `await`
//~^ ERROR expected identifier, found reserved keyword `await`
use self::outer_mod::await::await; //~ ERROR expected identifier, found keyword `await`
//~^ ERROR expected identifier, found keyword `await`

struct Foo { await: () }
//~^ ERROR expected identifier, found reserved keyword `await`
//~^ ERROR expected identifier, found keyword `await`

impl Foo { fn await() {} }
//~^ ERROR expected identifier, found reserved keyword `await`
//~^ ERROR expected identifier, found keyword `await`

macro_rules! await {
//~^ ERROR expected identifier, found reserved keyword `await`
//~^ ERROR expected identifier, found keyword `await`
() => {}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:6:13
|
LL | pub mod await {
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
|
LL | pub struct await;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
|
LL | struct Foo { await: () }
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | struct Foo { r#await: () }
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
|
LL | impl Foo { fn await() {} }
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | impl Foo { fn r#await() {} }
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
|
LL | macro_rules! await {
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/async-await/await-keyword/2018-edition-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ mod outer_mod {
}
}
use self::outer_mod::await::await; //~ ERROR expected identifier
//~^ ERROR expected identifier, found reserved keyword `await`
//~^ ERROR expected identifier, found keyword `await`

macro_rules! await { () => {}; } //~ ERROR expected identifier, found reserved keyword `await`
macro_rules! await { () => {}; } //~ ERROR expected identifier, found keyword `await`

fn main() {
await!(); //~ ERROR expected expression, found `)`
Expand Down
20 changes: 10 additions & 10 deletions src/test/ui/async-await/await-keyword/2018-edition-error.stderr
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:5:13
|
LL | pub mod await {
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:6:20
|
LL | pub struct await;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:22
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:29
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
| ^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:12:14
|
LL | macro_rules! await { () => {}; }
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await { () => {}; }
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/async-await/no-const-async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
// compile-flags: --crate-type lib

pub const async fn x() {}
//~^ ERROR expected identifier, found reserved keyword `async`
//~^ ERROR expected identifier, found keyword `async`
//~^^ expected `:`, found keyword `fn`
4 changes: 2 additions & 2 deletions src/test/ui/async-await/no-const-async.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/no-const-async.rs:5:11
|
LL | pub const async fn x() {}
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | pub const r#async fn x() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern crate edition_kw_macro_2018;

mod one_async {
produces_async! {} //~ ERROR expected identifier, found reserved keyword
produces_async! {} //~ ERROR expected identifier, found keyword
}
mod two_async {
produces_async_raw! {} // OK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2015-2018-expansion.rs:8:5
|
LL | produces_async! {}
| ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
| ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
help: you can escape reserved keywords to use them as identifiers
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/editions/edition-keywords-2018-2015-parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern crate edition_kw_macro_2015;

pub fn check_async() {
let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
let mut async = 1; //~ ERROR expected identifier, found keyword `async`
let mut r#async = 1; // OK

r#async = consumes_async!(async); // OK
Expand All @@ -15,6 +15,6 @@ pub fn check_async() {

if passes_ident!(async) == 1 {}
if passes_ident!(r#async) == 1 {} // OK
module::async(); //~ ERROR expected identifier, found reserved keyword `async`
module::async(); //~ ERROR expected identifier, found keyword `async`
module::r#async(); // OK
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2015-parsing.rs:8:13
|
LL | let mut async = 1;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
| ^^^^^^^

error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2015-parsing.rs:18:13
|
LL | module::async();
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern crate edition_kw_macro_2018;

mod one_async {
produces_async! {} //~ ERROR expected identifier, found reserved keyword `async`
produces_async! {} //~ ERROR expected identifier, found keyword `async`
}
mod two_async {
produces_async_raw! {} // OK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2018-expansion.rs:8:5
|
LL | produces_async! {}
| ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
| ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
help: you can escape reserved keywords to use them as identifiers
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/editions/edition-keywords-2018-2018-parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern crate edition_kw_macro_2018;

pub fn check_async() {
let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
let mut async = 1; //~ ERROR expected identifier, found keyword `async`
let mut r#async = 1; // OK

r#async = consumes_async!(async); // OK
Expand All @@ -15,6 +15,6 @@ pub fn check_async() {

if passes_ident!(async) == 1 {}
if passes_ident!(r#async) == 1 {} // OK
module::async(); //~ ERROR expected identifier, found reserved keyword `async`
module::async(); //~ ERROR expected identifier, found keyword `async`
module::r#async(); // OK
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2018-parsing.rs:8:13
|
LL | let mut async = 1;
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
| ^^^^^^^

error: expected identifier, found reserved keyword `async`
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2018-parsing.rs:18:13
|
LL | module::async();
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/mut-patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn main() {
//~| ERROR `mut` must be attached to each individual binding
//~| ERROR expected identifier, found reserved keyword `yield`
//~| ERROR expected identifier, found reserved keyword `become`
//~| ERROR expected identifier, found reserved keyword `await`
//~| ERROR expected identifier, found keyword `await`

struct W<T, U>(T, U);
struct B { f: Box<u8> }
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/parser/mut-patterns.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ help: you can escape reserved keywords to use them as identifiers
LL | let mut mut yield(r#become, await) = r#yield(0, 0);
| ^^^^^^^^

error: expected identifier, found reserved keyword `await`
error: expected identifier, found keyword `await`
--> $DIR/mut-patterns.rs:26:31
|
LL | let mut mut yield(become, await) = r#yield(0, 0);
| ^^^^^ expected identifier, found reserved keyword
| ^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut yield(become, r#await) = r#yield(0, 0);
Expand Down
0