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

Generalize async_idents to all new keywords #53685

Merged
merged 1 commit into from
Aug 30, 2018

Conversation

alexcrichton
Copy link
Member

This commit generalizes the existing async_idents lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called keyword_idents and the old async_idents lint is registered as renamed
to this new lint.

As a proof of concept the try keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The await keyword was not added
as it's not listed as a keyword yet.

Closes #53077

@rust-highfive
Copy link
Collaborator

r? @varkor

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2018
Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. A couple of tiny comments, but r=me after that (or immediately if this is especially time-sensitive).

Edition::Edition2015 => {
match &ident.as_str()[..] {
"async" |
"try" => 2018,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this should be using Edition::Edition2018, which already implements Display.

@@ -0,0 +1,21 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just be able to remove this copyright header now (and with the other tests).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, good to know for the future!

(this'll be a hard habit to shake for me...)

}

/// Checks for uses of `async` as an identifier
/// Checks for uses of future edtion keywords used as an identifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "edition"

Edition::Edition2015 => {
match &ident.as_str()[..] {
"async" |
"try" => 2018,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was await also reserved?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be if it isn't already

@alexcrichton
Copy link
Member Author

@bors: r=varkor

@bors
Copy link
Contributor

bors commented Aug 27, 2018

📌 Commit 9e96419 has been approved by varkor

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Aug 28, 2018
Generalize `async_idents` to all new keywords

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes rust-lang#53077
@bors
Copy link
Contributor

bors commented Aug 29, 2018

⌛ Testing commit 9e96419 with merge 9119395c08158c67dffe36fbe0e0062c1ad577c7...

@bors
Copy link
Contributor

bors commented Aug 29, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 29, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-debug of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:07:07] 
[00:07:07] error[E0433]: failed to resolve. Use of undeclared type or module `Edition`
[00:07:07]     --> librustc_lint/builtin.rs:1928:30
[00:07:07]      |
[00:07:07] 1928 |                     "try" => Edition::Edition2018,
[00:07:07]      |                              ^^^^^^^ Use of undeclared type or module `Edition`
[00:07:08] error: aborting due to 2 previous errors
[00:07:08] 
[00:07:08] For more information about this error, try `rustc --explain E0433`.
[00:07:08] error: Could not compile `rustc_lint`.
[00:07:08] error: Could not compile `rustc_lint`.
[00:07:08] 
[00:07:08] Caused by:
[00:07:08]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_lint librustc_lint/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,metadata -C prefer-dynamic -C opt-level=2 -C metadata=ca229e70e4528598 -C extra-filename=-ca229e70e4528598 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-445c78b30a600938.rmeta --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-c80832497be56dad.rmeta --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-d8b9538784647156.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-62a91fdc5731dc0e.rmeta --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-cb7790fd9ee13ed4.rmeta --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-6449186865dade13.rmeta -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-ee16f6821aef40e9/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-52504d5ed57fefc2/out` (exit code: 1)
[00:07:09] error: build failed
[00:07:09] error: build failed
[00:07:09] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:07:09] expected success, got: exit code: 101
[00:07:09] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1119:9
[00:07:09] travis_fold:end:stage0-rustc

[00:07:09] travis_time:end:stage0-rustc:start=1535531902853676821,finish=1535532057503086294,duration=154649409473

---
travis_time:end:0172f4ca:start=1535532058235022235,finish=1535532058241271345,duration=6249110
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0ee0f50e
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0087bb3e
travis_time:start:0087bb3e
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:02267b18
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes rust-lang#53077
@alexcrichton
Copy link
Member Author

@bors: r=varkor

@bors
Copy link
Contributor

bors commented Aug 29, 2018

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Aug 29, 2018

📌 Commit 9e96419 has been approved by varkor

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 29, 2018
@alexcrichton
Copy link
Member Author

@bors: r=varkor

@bors
Copy link
Contributor

bors commented Aug 29, 2018

📌 Commit 003cab2 has been approved by varkor

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Aug 29, 2018
Generalize `async_idents` to all new keywords

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes rust-lang#53077
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Aug 29, 2018
Generalize `async_idents` to all new keywords

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes rust-lang#53077
@bors
Copy link
Contributor

bors commented Aug 30, 2018

⌛ Testing commit 003cab2 with merge f1a5373...

bors added a commit that referenced this pull request Aug 30, 2018
Generalize `async_idents` to all new keywords

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes #53077
@bors
Copy link
Contributor

bors commented Aug 30, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: varkor
Pushing f1a5373 to master...

@bors bors merged commit 003cab2 into rust-lang:master Aug 30, 2018
@alexcrichton alexcrichton deleted the more-keywords branch October 8, 2018 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants