Skip to content

Commit cc51d03

Browse files
authored
Rollup merge of rust-lang#68045 - Centril:liberate-lints, r=Mark-Simulacrum
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`.
2 parents 1b208b1 + 51078ce commit cc51d03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+974
-1017
lines changed

Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -3663,6 +3663,7 @@ dependencies = [
36633663
"log",
36643664
"rustc",
36653665
"rustc_data_structures",
3666+
"rustc_error_codes",
36663667
"rustc_errors",
36673668
"rustc_feature",
36683669
"rustc_hir",
@@ -3788,6 +3789,7 @@ dependencies = [
37883789
"rustc_error_codes",
37893790
"rustc_errors",
37903791
"rustc_hir",
3792+
"rustc_lint",
37913793
"rustc_metadata",
37923794
"rustc_span",
37933795
"syntax",

src/librustc/hir/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! item.
66
77
use crate::hir::map::Map;
8-
use crate::lint::builtin::UNUSED_ATTRIBUTES;
98
use crate::ty::query::Providers;
109
use crate::ty::TyCtxt;
1110

@@ -16,6 +15,7 @@ use rustc_hir::def_id::DefId;
1615
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
1716
use rustc_hir::DUMMY_HIR_ID;
1817
use rustc_hir::{self, HirId, Item, ItemKind, TraitItem, TraitItemKind};
18+
use rustc_session::lint::builtin::UNUSED_ATTRIBUTES;
1919
use rustc_span::symbol::sym;
2020
use rustc_span::Span;
2121
use syntax::ast::Attribute;

src/librustc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ extern crate rustc_data_structures;
7171
#[macro_use]
7272
extern crate log;
7373
#[macro_use]
74-
extern crate syntax;
75-
#[macro_use]
7674
extern crate smallvec;
7775

7876
#[cfg(test)]

0 commit comments

Comments
 (0)