Uh oh!
There was an error while loading. Please reload this page.
Slimmer syntax - #68133
Conversation
This comment has been minimized.
This comment has been minimized.
…lacrum Move more of `rustc::lint` into `rustc_lint` Based on rust-lang#67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after rust-lang#68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
…lacrum Move more of `rustc::lint` into `rustc_lint` Based on rust-lang#67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after rust-lang#68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::lint::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
…lacrum Move more of `rustc::lint` into `rustc_lint` Based on rust-lang#67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after rust-lang#68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::lint::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
This comment has been minimized.
This comment has been minimized.
Centril
commented
Jan 17, 2020
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
Jan 17, 2020
👍 |
Centril
commented
Jan 17, 2020
Cool; I'll follow up with this. :) |
Centril
commented
Jan 18, 2020
Addressed the review comments. |
This comment has been minimized.
This comment has been minimized.
petrochenkov
commented
Jan 18, 2020
@bors r+ |
bors
commented
Jan 18, 2020
📌 Commit 1fbab97f3d177c4f4d58f69a2b73d938740a2abc has been approved by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Centril
commented
Feb 1, 2020
@bors r=petrochenkov |
bors
commented
Feb 1, 2020
📌 Commit 1a3141c has been approved by |
bors
commented
Feb 1, 2020
Slimmer syntax High-level summary of changes: - The `syntax::node_count` pass is moved into `rustc_ast_passes`. This works towards improving #65031 by making compiling `syntax` go faster. - The `syntax::{GLOBALS, with_globals, ..}` business is consolidated into `syntax::attr` for cleaner code and future possible improvements. - The pretty printer loses its dependency on `ParseSess`, opting to use `SourceMap` & friends directly instead. - Some drive by cleanup of `syntax::attr::HasAttr` happens. - Builtin attribute logic (`syntax::attr::builtin`) + `syntax::attr::allow_internal_unstable` is moved into a new `rustc_attr` crate. More logic from `syntax::attr` should be moved into that crate over time. This also means that `syntax` loses all mentions of `ParseSess`, which enables the next point. - The pretty printer `syntax::print` is moved into a new crate `rustc_ast_pretty`. - `rustc_session::node_id` is moved back as `syntax::node_id`. As a result, `syntax` gets to drop dependencies on `rustc_session` (and implicitly `rustc_target`), `rustc_error_codes`, and `rustc_errors`. Moreover `rustc_hir` gets to drop its dependency on `rustc_session` as well. At this point, these crates are mostly "pure data crates", which is approaching a desirable end state. - We should consider renaming `syntax` to `rustc_ast` now.
bors
commented
Feb 1, 2020
☀️ Test successful - checks-azure |
rust-highfive
commented
Feb 1, 2020
📣 Toolstate changed by #68133! Tested on commit 13db650. 💔 clippy-driver on windows: test-fail → build-fail (cc @mcarton@oli-obk@Manishearth@flip1995@yaahc@phansch@llogiq, @rust-lang/infra). |
Tested on commit rust-lang/rust@13db650. Direct link to PR: <rust-lang/rust#68133> 💔 clippy-driver on windows: test-fail → build-fail (cc @mcarton@oli-obk@Manishearth@flip1995@yaahc@phansch@llogiq, @rust-lang/infra). 💔 clippy-driver on linux: test-fail → build-fail (cc @mcarton@oli-obk@Manishearth@flip1995@yaahc@phansch@llogiq, @rust-lang/infra).
Rustup to rust-lang/rust#68133 changelog: none
High-level summary of changes:
The
syntax::node_countpass is moved intorustc_ast_passes. This works towards improving Therustc_query_implcrate is too big, which hurts compile times for the compiler itself #65031 by making compilingsyntaxgo faster.The
syntax::{GLOBALS, with_globals, ..}business is consolidated intosyntax::attrfor cleaner code and future possible improvements.The pretty printer loses its dependency on
ParseSess, opting to useSourceMap& friends directly instead.Some drive by cleanup of
syntax::attr::HasAttrhappens.Builtin attribute logic (
syntax::attr::builtin) +syntax::attr::allow_internal_unstableis moved into a newrustc_attrcrate. More logic fromsyntax::attrshould be moved into that crate over time. This also means thatsyntaxloses all mentions ofParseSess, which enables the next point.The pretty printer
syntax::printis moved into a new craterustc_ast_pretty.rustc_session::node_idis moved back assyntax::node_id. As a result,syntaxgets to drop dependencies onrustc_session(and implicitlyrustc_target),rustc_error_codes, andrustc_errors. Moreoverrustc_hirgets to drop its dependency onrustc_sessionas well. At this point, these crates are mostly "pure data crates", which is approaching a desirable end state.syntaxtorustc_astnow.