about summary refs log tree commit diff
path: root/src/librustc_session/parse.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-239/+0
2020-08-18Promote missing_fragment_specifier to hard errorAleksey Kladov-2/+0
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
2020-08-10Fix symbol ordering for confusable idents detection.Nicholas Nethercote-2/+1
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.
2020-08-02Rollup merge of #75059 - shengsheng:typos, r=Dylan-DPCManish Goregaokar-1/+1
fix typos Fix common misspellings with https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2020-08-02fix typosliuzhenyu-1/+1
2020-07-31Reduce verbosity of some type ascription errorsEsteban Küber-0/+3
* 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
2020-06-26Auto merge of #73746 - Manishearth:rollup-80jnynm, r=Manishearthbors-1/+2
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
2020-06-25Auto merge of #71858 - petrochenkov:env, r=Mark-Simulacrumbors-0/+3
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
2020-06-23Refactor non_ascii_idents lints, exclude ascii pair for confusable_idents lint.Charles Lew-1/+2
2020-06-09expand: Give reasonable NodeIds to lints associated with macro definitionsVadim Petrochenkov-2/+2
2020-05-31Print accessed env vars as special comments into depinfo filesVadim Petrochenkov-0/+3
2020-05-27rustc_session: Cleanup session creationVadim Petrochenkov-0/+4
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-3/+3
2020-05-03Implement `confusable_idents` lint.Charles Lew-0/+16
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-23Auto merge of #69393 - Dylan-DPC:rollup-rxbd1zg, r=Dylan-DPCbors-5/+5
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
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-5/+5
2020-02-21clean things upJane Lusby-0/+19
2020-02-09Make issue references consistentMatthias Prechtl-2/+2
2020-02-011. move node_id to syntaxMazdak Farrokhzad-2/+1
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-1/+0
2020-01-11feature_gate: Remove `GateStrength`Vadim Petrochenkov-37/+1
2020-01-11pacify tidy by nixing added docs :(Mazdak Farrokhzad-12/+0
2020-01-11buffered lint infra -> rustc_sessionMazdak Farrokhzad-5/+6
2020-01-11document feature_err et. alMazdak Farrokhzad-0/+23
2020-01-11gating diagnostics -> rustc_session::parseMazdak Farrokhzad-4/+68
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-4/+4
2019-12-22Format the worldMark Rousskov-32/+14
2019-12-03Deduplicate CrateConfigMark Rousskov-2/+3
2019-12-03Move ParseSess to librustc_sessionMark Rousskov-0/+175