Skip to content

Separate most of rustc::lint::builtin into a separate crate.#22801

Merged
bors merged 2 commits into
rust-lang:masterfrom
huonw:crateify-lint
Feb 28, 2015
Merged

Separate most of rustc::lint::builtin into a separate crate.#22801
bors merged 2 commits into
rust-lang:masterfrom
huonw:crateify-lint

Conversation

@huonw

@huonw huonw commented Feb 25, 2015

Copy link
Copy Markdown
Contributor

This pulls out the implementations of most built-in lints into a
separate crate, to reduce edit-compile-test iteration times with
librustc_lint and increase parallelism. This should enable lints to be
refactored, added and deleted much more easily as it slashes the
edit-compile cycle to get a minimal working compiler to test with (make rustc-stage1) from

librustc -> librustc_typeck -> ... -> librustc_driver ->
    libcore -> ... -> libstd

to

librustc_lint -> librustc_driver -> libcore -> ... libstd

which is significantly faster, mainly due to avoiding the librustc build
itself.

The intention would be to move as much as possible of the infrastructure
into the crate too, but the plumbing is deeply intertwined with librustc
itself at the moment. Also, there are lints for which diagnostics are
registered directly in the compiler code, not in their own crate
traversal, and their definitions have to remain in librustc.

This is a [breaking-change] for direct users of the compiler APIs:
callers of rustc::session::build_session or
rustc::session::build_session_ need to manually call
rustc_lint::register_builtins on their return value.

This should make #22206 easier.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@huonw

huonw commented Feb 25, 2015

Copy link
Copy Markdown
Contributor Author

r? @kmcallister

@nagisa

nagisa commented Feb 25, 2015

Copy link
Copy Markdown
Member

Nice improvement!

Since we have a separate crate for lints now, would be nice to split librustc_lint/builtin.rs into several files, e.g. each for a lint.

@huonw

huonw commented Feb 25, 2015

Copy link
Copy Markdown
Contributor Author

@nagisa yeah definitely, that's #22206. I don't have time to do it all immediately, but this patch makes it much easier to do incrementally since the compile times are much shorter. I thought it better to land this (to let everyone get the benefits now) than have it blocked on me doing the reorganisation first.

Comment thread src/librustc_lint/builtin.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be "Also see"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yup

@bors

bors commented Feb 25, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #22796) made this pull request unmergeable. Please resolve the merge conflicts.

@huonw

huonw commented Feb 26, 2015

Copy link
Copy Markdown
Contributor Author

Rebased & fixed the missing word.

@kmcallister

Copy link
Copy Markdown
Contributor

@bors: r+ 26ea732

@bors

bors commented Feb 27, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 26ea732 with merge 35923cb...

@bors

bors commented Feb 27, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-win-32-nopt-t

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry clean

@bors

bors commented Feb 28, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #22860) made this pull request unmergeable. Please resolve the merge conflicts.

This pulls out the implementations of most built-in lints into a
separate crate, to reduce edit-compile-test iteration times with
librustc_lint and increase parallelism. This should enable lints to be
refactored, added and deleted much more easily as it slashes the
edit-compile cycle to get a minimal working compiler to test with (`make
rustc-stage1`) from

    librustc -> librustc_typeck -> ... -> librustc_driver ->
        libcore -> ... -> libstd

to

    librustc_lint -> librustc_driver -> libcore -> ... libstd

which is significantly faster, mainly due to avoiding the librustc build
itself.

The intention would be to move as much as possible of the infrastructure
into the crate too, but the plumbing is deeply intertwined with librustc
itself at the moment. Also, there are lints for which diagnostics are
registered directly in the compiler code, not in their own crate
traversal, and their definitions have to remain in librustc.

This is a [breaking-change] for direct users of the compiler APIs:
callers of `rustc::session::build_session` or
`rustc::session::build_session_` need to manually call
`rustc_lint::register_builtins` on their return value.

This should make rust-lang#22206 easier.
@huonw

huonw commented Feb 28, 2015

Copy link
Copy Markdown
Contributor Author

@bors r=kmcallister 3909

@bors

bors commented Feb 28, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 3909253 with merge 48aeaba...

bors added a commit that referenced this pull request Feb 28, 2015
This pulls out the implementations of most built-in lints into a
separate crate, to reduce edit-compile-test iteration times with
librustc_lint and increase parallelism. This should enable lints to be
refactored, added and deleted much more easily as it slashes the
edit-compile cycle to get a minimal working compiler to test with (`make
rustc-stage1`) from

    librustc -> librustc_typeck -> ... -> librustc_driver ->
        libcore -> ... -> libstd

to

    librustc_lint -> librustc_driver -> libcore -> ... libstd

which is significantly faster, mainly due to avoiding the librustc build
itself.

The intention would be to move as much as possible of the infrastructure
into the crate too, but the plumbing is deeply intertwined with librustc
itself at the moment. Also, there are lints for which diagnostics are
registered directly in the compiler code, not in their own crate
traversal, and their definitions have to remain in librustc.

This is a [breaking-change] for direct users of the compiler APIs:
callers of `rustc::session::build_session` or
`rustc::session::build_session_` need to manually call
`rustc_lint::register_builtins` on their return value.

This should make #22206 easier.
@bors

bors commented Feb 28, 2015

Copy link
Copy Markdown
Collaborator

@Manishearth

Copy link
Copy Markdown
Member

\o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants