| Age | Commit message (Collapse) | Author | Lines |
|
|
|
It has been deny_by_default since 2017 (and warned for some time
before that), so it seems reasonable to promote it.
The specific technical motivation to do this now is to remove a field
from `ParseSess` -- it is a global state, and global state makes
extracting libraries annoying.
Closes #40107
|
|
Confusable idents detection uses a type `BTreeMap<Symbol, Span>`. This is
highly dubious given that `Symbol` doesn't guarantee a meaningful order. (In
practice, it currently gives an order that mostly matches source code order.)
As a result, changes in `Symbol` representation make the
`lint-confusable-idents.rs` test fail, because this error message:
> identifier pair considered confusable between `s` and `s`
is changed to this:
> identifier pair considered confusable between `s` and `s`
and the corresponding span pointers get swapped erroneously, leading to
an incorrect "previous identifier" label.
This commit sorts the relevant symbols by span before doing the checking,
which ensures that the ident that appears first in the code will be mentioned
first in the message. The commit also extends the test slightly to be more
thorough.
|
|
fix typos
Fix common misspellings with https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
|
|
|
|
* Deduplicate type ascription LHS errors
* Remove duplicated `:` -> `::` suggestion from parse error
* Tweak wording to be more accurate
* Modify `current_type_ascription` to reduce span wrangling
* remove now unnecessary match arm
* Add run-rustfix to appropriate tests
|
|
Rollup of 14 pull requests
Successful merges:
- #72617 (Add a fast path for `std::thread::panicking`.)
- #72738 (Self contained linking option)
- #72770 (Implement mixed script confusable lint.)
- #73418 (Add unstable `core::mem::variant_count` intrinsic)
- #73460 (Emit line info for generator variants)
- #73534 (Provide suggestions for some moved value errors)
- #73538 (make commented examples use valid syntax, and be more consistent )
- #73581 (Create 0766 error code)
- #73619 (Document the mod keyword)
- #73621 (Document the mut keyword)
- #73648 (Document the return keyword)
- #73673 (Fix ptr doc warnings.)
- #73674 (Tweak binop errors)
- #73687 (Clean up E0701 explanation)
Failed merges:
- #73708 (Explain move errors that occur due to method calls involving `self` (take two))
r? @ghost
|
|
Print environment variables accessed by rustc as special comments into depinfo files
So cargo (and perhaps others tools) can use them for linting (at least) or for actually rebuilding crates on env var changes.
---
I've recently observed one more forgotten environment variable in a build script https://github.com/rust-lang/rust/pull/71314/commits/8a77d1ca3fc2df789157f7986ddbaf2a377ff0fe and thought it would be nice to provide the list of accessed variables to cargo automatically as a part of depinfo.
Unsurprisingly, I wasn't the first who had this idea - cc https://github.com/rust-lang/rust/issues/70517 https://github.com/rust-lang/rust/issues/40364 https://github.com/rust-lang/rust/issues/44074.
Also, there are dozens of uses of `(option_)env!` in rustc repo and, like, half of them are not registered in build scripts.
---
Description:
- depinfo files are extended with special comments containing info about environment variables accessed during compilation.
- Comment format for environment variables with successfully retrieved value: `# env-dep:KEY=VALUE`.
- Comment format for environment variables without successfully retrieved value: `# env-dep:KEY` (can happen with `option_env!`).
- `KEY` and `VALUE` are minimally escaped (`\n`, `\r`, `\\`) so they don't break makefile comments and can be unescaped by anything that can unescape standard `escape_default` and friends.
FCP report: https://github.com/rust-lang/rust/pull/71858#issuecomment-633071488
Closes https://github.com/rust-lang/rust/issues/70517
Closes https://github.com/rust-lang/rust/issues/40364
Closes https://github.com/rust-lang/rust/issues/44074
A new issue in the cargo repo will be needed to track the cargo side of this feature.
r? @ehuss
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #69336 (Do not ping the infrastructure team on toolstate changes)
- #69351 (Improve external MinGW detection)
- #69361 (parse: allow `type Foo: Ord` syntactically)
- #69375 (Rename CodeMap to SourceMap follow up)
- #69376 (parser: Cleanup `Parser::bump_with` and its uses)
Failed merges:
r? @ghost
|
|
|
|
|
|
|
|
2. invert rustc_session & syntax deps
3. drop rustc_session dep in rustc_hir
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|