Skip to content

Commit 7f81ad9

Browse files
authoredJan 11, 2020
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::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
2 parents 2211f22 + 51078ce commit 7f81ad9

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
@@ -3654,6 +3654,7 @@ dependencies = [
36543654
"log",
36553655
"rustc",
36563656
"rustc_data_structures",
3657+
"rustc_error_codes",
36573658
"rustc_errors",
36583659
"rustc_feature",
36593660
"rustc_hir",
@@ -3779,6 +3780,7 @@ dependencies = [
37793780
"rustc_error_codes",
37803781
"rustc_errors",
37813782
"rustc_hir",
3783+
"rustc_lint",
37823784
"rustc_metadata",
37833785
"rustc_span",
37843786
"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;

0 commit comments

Comments
 (0)