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

Rename librustc to librustc_middle #70536

Merged
merged 5 commits into from
Mar 30, 2020
Merged

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 29, 2020

Here we rename librustc to librustc_middle.

This crate is not nearly as large or central as it was previously and so it doesn't make much sense to give it such a central name as librustc ("the entry point to the compiler"). Moreover, there is already a rustc crate which is has the actual fn main of rustc, so having librustc is confusing relative to that.

r? @eddyb

/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
Copy link
Member

Choose a reason for hiding this comment

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

Is this accurate? Some stuff has been moved out into separate crates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #70537 for checking followups.

//! Their definition should always match the ABI defined in `rustc::back::abi`.
//! Their definition should always match the ABI defined in `rustc_target::abi`.
Copy link
Member

Choose a reason for hiding this comment

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

rustc_middle::ty::layout (which IMO should be rustc_middle::ty::abi or rustc_middle::abi but I've never gotten around to it)

// for symbol names src/librustc/middle/allocator.rs
// for symbol names src/librustc_middle/middle/allocator.rs
Copy link
Member

Choose a reason for hiding this comment

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

Is that file still there? But also I'm suspicious of rustc_middle::middle existing, in general.

//! `rustc::middle::typeck::infer::region_constraints`, generating a
//! `rustc_middle::middle::typeck::infer::region_constraints`, generating a
Copy link
Member

Choose a reason for hiding this comment

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

Does this module even exist anymore, it looks off.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I don't think it does.

src/librustc_middle/lib.rs Outdated Show resolved Hide resolved
/// `InferCtxt::type_must_outlive` in `rustc::infer::outlives`.
/// `InferCtxt::type_must_outlive` in `rustc_middle::infer::outlives`.
Copy link
Member

Choose a reason for hiding this comment

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

Is that still there, wasn't InferCtxt moved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was moved to rustc_infer::infer::InferCtxt says rustdoc nightly docs.

/// **Any `rustc::infer` operations that might generate region
/// **Any `rustc_middle::infer` operations that might generate region
Copy link
Member

Choose a reason for hiding this comment

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

Again, I'm not sure infer is really there anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rustc_middle::infer exists, but it's only 3 small modules.

// compiling librustc crates themselves so we can leverage crates.io
// compiling librustc_middle crates themselves so we can leverage crates.io
Copy link
Member

Choose a reason for hiding this comment

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

NB: this said "librustc crates". It could now be "librustc_* crates" or just "rustc crates".

// of the directory where librustc is located, rather than where the rustc
// of the directory where librustc_middle is located, rather than where the rustc
Copy link
Member

Choose a reason for hiding this comment

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

This should probably say librustc_driver, if it refers to the dynamic library (since it's the only one left).

@@ -207,7 +207,7 @@ pub struct BufferedEarlyLint {
/// The `NodeId` of the AST node that generated the lint.
pub node_id: NodeId,

/// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`.
/// A lint Id that can be passed to `rustc_session::lint::Lint::from_parser_lint_id`.
Copy link
Member

Choose a reason for hiding this comment

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

The two mentions of "passed" in this file should refer to the same thing, no?

@@ -195,7 +195,7 @@ pub enum BuiltinLintDiagnostics {
}

/// Lints that are buffered up early on in the `Session` before the
/// `LintLevels` is calculated. These are later passed to `librustc`.
/// `LintLevels` is calculated. These are later passed to `librustc_middle`.
Copy link
Member

Choose a reason for hiding this comment

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

This is the other "passed to" (GH won't let me do multi-line comments on this diff).

// `rustc::ty::instance::resolve_associated_item()`.
// `rustc_middle::ty::instance::resolve_associated_item()`.
Copy link
Member

Choose a reason for hiding this comment

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

I believe this was moved.

//! Do not call this query directory. See [`rustc::traits::query::implied_outlives_bounds`].
//! Do not call this query directory. See [`rustc_middle::traits::query::implied_outlives_bounds`].
Copy link
Member

Choose a reason for hiding this comment

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

Likely outdated.

// `rustc::traits::project::assemble_candidates_from_impls()`.
// `rustc_middle::traits::project::assemble_candidates_from_impls()`.
Copy link
Member

Choose a reason for hiding this comment

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

Likely moved in the meanwhile.

@eddyb
Copy link
Member

eddyb commented Mar 29, 2020

cc @rust-lang/compiler I'm approving this now because it's easier to revert it than to land it.
If this isn't wanted, @Centril or me will do s/rustc_middle/rustc/ + ./x.py fmt to revert it.

(long-term, I'd like "type/trait-system is part of MIR", which is why the Mir->mir::Body rename was suggested, but I expect that would be far more controversial than rustc_middle existing)

@bors r+ p=123

@bors
Copy link
Contributor

bors commented Mar 29, 2020

📌 Commit aaad8e77c07bad1db5aae2a40ed4d09e439c7ef5 has been approved by eddyb

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 29, 2020
@bors
Copy link
Contributor

bors commented Mar 29, 2020

⌛ Testing commit aaad8e77c07bad1db5aae2a40ed4d09e439c7ef5 with merge 4119b5a1717ea70c38981c45b8ba9d4d8d986364...

@crlf0710

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@bors

This comment has been minimized.

@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 Mar 29, 2020
@RalfJung
Copy link
Member

So now we have rustc_middle::middle? ;-)

@Centril
Copy link
Contributor Author

Centril commented Mar 30, 2020

Yep, and rustc_ast::ast and rustc_hir::hir 🙃 😅

matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Mar 30, 2020
bors added a commit to rust-lang/rust-clippy that referenced this pull request Mar 30, 2020
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 30, 2020
Changes:
````
rustup  rust-lang#70536
Rustup to rust-lang#70449
readme: move "how to run single lint" instructions to "Allowing/denying lints" section.
git attribute macros not allowed in submodules
Deprecate REPLACE_CONSTS lint
Bump itertools
````

Fixes rust-lang#70554
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 30, 2020
submodules: update clippy from 70b93aa to e170c84

Changes:
````
rustup  rust-lang#70536
Rustup to rust-lang#70449
readme: move "how to run single lint" instructions to "Allowing/denying lints" section.
git attribute macros not allowed in submodules
Deprecate REPLACE_CONSTS lint
Bump itertools
````

Fixes rust-lang#70554
artemmukhin added a commit to intellij-rust/intellij-rust that referenced this pull request Apr 10, 2020
"rustc" package was renamed to "rustc_middle"
in rust-lang/rust#70536 (>=1.42.0)
bors bot added a commit to intellij-rust/intellij-rust that referenced this pull request Apr 10, 2020
5220: Fix stdlib detection when working with rust-lang/rust project r=vlad20012 a=ortem

Our analysis is broken on the latest nightly rustc (1.42.0) because "rustc" package was renamed to "rustc_middle" in rust-lang/rust#70536 and now "rust-lang/rust" is not detected by the plugin.

Co-authored-by: ortem <ortem00@gmail.com>
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
rustup  rust-lang/rust#70536
Rustup to rust-lang/rust#70449
readme: move "how to run single lint" instructions to "Allowing/denying lints" section.
git attribute macros not allowed in submodules
Deprecate REPLACE_CONSTS lint
Bump itertools
````

Fixes #70554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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

7 participants