Skip to content

Commit 9dcc60b

Browse files
committed
Update lint_levels
1 parent 5bcc80b commit 9dcc60b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/librustc/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ macro_rules! arena_types {
7878
>,
7979
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
8080
[decode] generic_predicates: rustc::ty::GenericPredicates<'tcx>,
81+
[few] lint_levels: rustc::lint::LintLevelMap,
8182
], $tcx);
8283
)
8384
}

src/librustc/lint/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
pub use self::Level::*;
2222
pub use self::LintSource::*;
2323

24-
use rustc_data_structures::sync::{self, Lrc};
24+
use rustc_data_structures::sync;
2525

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

769769
fn lint_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, cnum: CrateNum)
770-
-> Lrc<LintLevelMap>
770+
-> &'tcx LintLevelMap
771771
{
772772
assert_eq!(cnum, LOCAL_CRATE);
773773
let mut builder = LintLevelMapBuilder {
@@ -784,7 +784,7 @@ fn lint_levels<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, cnum: CrateNum)
784784
intravisit::walk_crate(&mut builder, krate);
785785
builder.levels.pop(push);
786786

787-
Lrc::new(builder.levels.build_map())
787+
tcx.arena.alloc(builder.levels.build_map())
788788
}
789789

790790
struct LintLevelMapBuilder<'a, 'tcx: 'a> {

src/librustc/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ rustc_queries! {
6767
desc { "looking up the native libraries of a linked crate" }
6868
}
6969

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

0 commit comments

Comments
 (0)