Skip to content

Commit

Permalink
Update lint_levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed May 23, 2019
1 parent 5bcc80b commit 9dcc60b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/librustc/arena.rs
Expand Up @@ -78,6 +78,7 @@ macro_rules! arena_types {
>,
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
[decode] generic_predicates: rustc::ty::GenericPredicates<'tcx>,
[few] lint_levels: rustc::lint::LintLevelMap,
], $tcx);
)
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/lint/mod.rs
Expand Up @@ -21,7 +21,7 @@
pub use self::Level::*;
pub use self::LintSource::*;

use rustc_data_structures::sync::{self, Lrc};
use rustc_data_structures::sync;

use crate::hir::def_id::{CrateNum, LOCAL_CRATE};
use crate::hir::intravisit;
Expand Down Expand Up @@ -767,7 +767,7 @@ pub fn maybe_lint_level_root(tcx: TyCtxt<'_, '_, '_>, id: hir::HirId) -> bool {
}

fn lint_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, cnum: CrateNum)
-> Lrc<LintLevelMap>
-> &'tcx LintLevelMap
{
assert_eq!(cnum, LOCAL_CRATE);
let mut builder = LintLevelMapBuilder {
Expand All @@ -784,7 +784,7 @@ fn lint_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, cnum: CrateNum)
intravisit::walk_crate(&mut builder, krate);
builder.levels.pop(push);

Lrc::new(builder.levels.build_map())
tcx.arena.alloc(builder.levels.build_map())
}

struct LintLevelMapBuilder<'a, 'tcx: 'a> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/query/mod.rs
Expand Up @@ -67,7 +67,7 @@ rustc_queries! {
desc { "looking up the native libraries of a linked crate" }
}

query lint_levels(_: CrateNum) -> Lrc<lint::LintLevelMap> {
query lint_levels(_: CrateNum) -> &'tcx lint::LintLevelMap {
eval_always
desc { "computing the lint levels for items in this crate" }
}
Expand Down

0 comments on commit 9dcc60b

Please sign in to comment.