-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Simplify use of keyword symbols #60740
Conversation
cc @nnethercote |
Lovely! I had considered doing this myself, but I hadn't yet worked up the energy to do so :) |
☔ The latest upstream changes (presumably #60679) made this pull request unmergeable. Please resolve the merge conflicts. |
@petrochenkov: r=me once the issue above is resolved satisfactorily. |
@bors r=nnethercote |
📌 Commit 261eb01 has been approved by |
🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened |
@bors p=1 (conflict-prone) |
⌛ Testing commit 261eb01 with merge e598681d9a59feedcd638666232dcac1d8826314... |
💔 Test failed - checks-travis |
The job Click to expand the log.
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 |
I'm confused... I thought clippy wasn't tested by rustc's CI. E.g. #60630 would have broken clippy in similar ways to this PR, and it passed tests on CI. |
@nnethercote tools like Clippy, RLS are tested but they are allowed to fail. Build failed because the log has grown too much:
BTW it could be worth to silence these warnings: |
@bors retry |
Simplify use of keyword symbols They mirror non-keyword symbols now (see #60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
💔 Test failed - checks-travis |
📌 Commit a1885cd has been approved by |
Simplify use of keyword symbols They mirror non-keyword symbols now (see #60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
☀️ Test successful - checks-travis, status-appveyor |
📣 Toolstate changed by #60740! Tested on commit 15ccaf7. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra). |
Tested on commit rust-lang/rust@15ccaf7. Direct link to PR: <rust-lang/rust#60740> 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra). 💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra). 💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
changelog: none
Rustup to rust-lang/rust#60740 rust-lang/rust#60740 changelog: none
Rustup to rust-lang/rust#60740 rust-lang/rust#60740 changelog: none
Changes: ``` Rustup to rust-lang#60740 Lifetimes UI test cleanup tests: update needless_bool test stderr Rustup to rust-lang#60965 ```
Changes: ```` Rustup to rust-lang#61026 rustup rust-lang#60803 Rustup to rust-lang#59545 Rustup to rust-lang#60965 clippy: bump rustc_tools util version to 0.2 rustc_tools_util: fix typo in docs (readme) rustc_tool_utils: bump version to 0.2.0 update if_chain to 1.0.0 tests: update needless_bool test stderr cargo fmt Rustup to rust-lang#60740 Lifetimes UI test cleanup ````
They mirror non-keyword symbols now (see #60630).
keywords::MyKeyword.name()
->kw::MyKeyword
keywords::MyKeyword.ident()
->Ident::with_empty_ctxt(kw::MyKeyword)
(not common)keywords::Invalid.ident()
->Ident::invalid()
(more common)Keywords are simply
Symbol
constants now, theKeyword
struct is eliminated.This means
kw::MyKeyword
can now be used inmatch
in particular.