Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ec91f26
Fix SGX implementations of read/write_vectored.
sfackler Mar 8, 2019
ab8e1d2
Always call read/write from default vectored io methods
sfackler Mar 8, 2019
9aa89b2
When encountetring `||{}()`, suggest the likely intended `(||{})()`
estebank Mar 9, 2019
94a6936
Track embedded-book in the toolstate
kennytm Mar 9, 2019
967e7f4
resolve: Account for new importable entities
petrochenkov Mar 9, 2019
a4ea084
Avoid some common false positives in intra doc link checking
Manishearth Mar 9, 2019
3a83cb2
Fix ICE in MIR pretty printing
dlrobertson Mar 9, 2019
135b686
Update src/tools/publish_toolstate.py
jamesmunns Mar 10, 2019
d6f5100
Fix tidy
kennytm Mar 10, 2019
8371377
CI: Set job names.
ehuss Mar 9, 2019
4888b1f
we can now skip should_panic tests with the libtest harness
RalfJung Mar 10, 2019
52d9fa8
enabled too many tests
RalfJung Mar 10, 2019
8629fd3
Improvements to comments in libstd, libcore, liballoc.
alexreg Feb 9, 2019
e25df32
consistent naming for duration_float methods and additional f32 methods
newpavlov Mar 11, 2019
35c19c5
move MAX_NANOS_F64/32 to methods
newpavlov Mar 11, 2019
d4b2071
Resolved nits raised in review.
alexreg Mar 11, 2019
02f26e3
Add peer_addr function to UdpSocket
LinusU Mar 11, 2019
980871a
fix tests
newpavlov Mar 11, 2019
197efb0
fix test
newpavlov Mar 11, 2019
b9d12ed
Be more discerning on when to attempt suggesting a comma in a macro i…
estebank Mar 11, 2019
78b248d
fix typo
newpavlov Mar 12, 2019
df2dce3
Mark UdpSocket peer_addr unstable w/ tracking issue
LinusU Mar 12, 2019
54bf8e0
Document UdpSocket peer_addr NotConnected error
LinusU Mar 12, 2019
5074489
Unregress using scalar unions in constants.
oli-obk Mar 12, 2019
79695ea
Add test for UdpSocket peer_addr
LinusU Mar 12, 2019
ca32fe4
Fix test names regarding ip version
LinusU Mar 12, 2019
df05fbf
rustc: fix ICE when trait alias has bare Self
seanmonstar Mar 11, 2019
795d307
Suggest return lifetime when there's only one named lifetime
estebank Mar 12, 2019
f923476
review comments
estebank Mar 12, 2019
adbd0a6
Make std time tests more robust for platform differences
Mar 12, 2019
0ea9b58
Suggest adding lifetime to struct field
estebank Mar 13, 2019
27abd52
Fix operator precedence
estebank Mar 13, 2019
311025e
Fix generic argument lookup for Self
Mar 7, 2019
856b081
middle: replace NodeId with HirId in AccessLevels
ljedrz Mar 11, 2019
ba9323f
Rollup merge of #59009 - sfackler:fix-sgx-vectors, r=alexcrichton
emilyalbini Mar 13, 2019
ae5856f
Rollup merge of #59025 - aoikonomopoulos:issue-57924, r=varkor
emilyalbini Mar 13, 2019
321ed9a
Rollup merge of #59035 - estebank:closure-instacall, r=davidtwco
emilyalbini Mar 13, 2019
a0f0b1b
Rollup merge of #59036 - dlrobertson:fix_59021, r=estebank
emilyalbini Mar 13, 2019
b0d7611
Rollup merge of #59037 - Manishearth:intra-doc-false, r=QuietMisdreavus
emilyalbini Mar 13, 2019
33bb3dc
Rollup merge of #59038 - kennytm:track-embedded-book, r=oli-obk
emilyalbini Mar 13, 2019
3da9ee8
Rollup merge of #59047 - petrochenkov:modnodefid, r=Centril
emilyalbini Mar 13, 2019
298265c
Rollup merge of #59055 - ehuss:ci-job-name, r=alexcrichton
emilyalbini Mar 13, 2019
03b2462
Rollup merge of #59072 - RalfJung:miri-alloc-tests, r=kennytm
emilyalbini Mar 13, 2019
e2ef3e2
Rollup merge of #59082 - alexreg:cosmetic-2-doc-comments, r=Centril
emilyalbini Mar 13, 2019
153fd15
Rollup merge of #59096 - ljedrz:HirIdify_AccessLevel, r=Zoxc
emilyalbini Mar 13, 2019
a7ecf5f
Rollup merge of #59102 - newpavlov:duration_float, r=alexcrichton
emilyalbini Mar 13, 2019
5b613a8
Rollup merge of #59106 - LinusU:udp-peer-addr, r=kennytm
emilyalbini Mar 13, 2019
4f01679
Rollup merge of #59116 - estebank:comma-sugg, r=petrochenkov
emilyalbini Mar 13, 2019
005debc
Rollup merge of #59118 - seanmonstar:alias-where-self-ice, r=alexreg
emilyalbini Mar 13, 2019
7be9dec
Rollup merge of #59139 - oli-obk:unions_are_a_good_thing, r=RalfJung
emilyalbini Mar 13, 2019
fd3de6a
Rollup merge of #59146 - estebank:suggest-return-lt, r=varkor
emilyalbini Mar 13, 2019
4769f8f
Rollup merge of #59147 - jethrogb:jb/time-tests, r=sfackler
emilyalbini Mar 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
middle: replace NodeId with HirId in AccessLevels
  • Loading branch information
ljedrz committed Mar 13, 2019
commit 856b081eb2ae3264da07434debd55d734fba7eb4
2 changes: 1 addition & 1 deletion src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ fn create_and_seed_worklist<'a, 'tcx>(
) -> (Vec<hir::HirId>, FxHashMap<hir::HirId, hir::HirId>) {
let worklist = access_levels.map.iter().filter_map(|(&id, level)| {
if level >= &privacy::AccessLevel::Reachable {
Some(tcx.hir().node_to_hir_id(id))
Some(id)
} else {
None
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/privacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//! outside their scopes. This pass will also generate a set of exported items
//! which are available for use externally when compiled as a library.

use crate::hir::HirId;
use crate::util::nodemap::{DefIdSet, FxHashMap};

use std::hash::Hash;
use std::fmt;
use syntax::ast::NodeId;
use rustc_macros::HashStable;

// Accessibility levels, sorted in ascending order
Expand All @@ -27,7 +27,7 @@ pub enum AccessLevel {

// Accessibility levels for reachable HIR nodes
#[derive(Clone)]
pub struct AccessLevels<Id = NodeId> {
pub struct AccessLevels<Id = HirId> {
pub map: FxHashMap<Id, AccessLevel>
}

Expand Down
5 changes: 2 additions & 3 deletions src/librustc/middle/reachable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a,

// We need only trait impls here, not inherent impls, and only non-exported ones
if let hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) = item.node {
let node_id = self.tcx.hir().hir_to_node_id(item.hir_id);
if !self.access_levels.is_reachable(node_id) {
if !self.access_levels.is_reachable(item.hir_id) {
self.worklist.extend(impl_item_refs.iter().map(|ii_ref| ii_ref.id.hir_id));

let trait_def_id = match trait_ref.path.def {
Expand Down Expand Up @@ -415,7 +414,7 @@ fn reachable_set<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum) ->
// use the lang items, so we need to be sure to mark them as
// exported.
reachable_context.worklist.extend(
access_levels.map.iter().map(|(id, _)| tcx.hir().node_to_hir_id(*id)));
access_levels.map.iter().map(|(id, _)| *id));
for item in tcx.lang_items().items().iter() {
if let Some(did) = *item {
if let Some(hir_id) = tcx.hir().as_local_hir_id(did) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl<'a, 'tcx: 'a> MissingStabilityAnnotations<'a, 'tcx> {
let stab = self.tcx.stability().local_stability(hir_id);
let is_error = !self.tcx.sess.opts.test &&
stab.is_none() &&
self.access_levels.is_reachable(self.tcx.hir().hir_to_node_id(hir_id));
self.access_levels.is_reachable(hir_id);
if is_error {
self.tcx.sess.span_err(
span,
Expand Down
12 changes: 4 additions & 8 deletions src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ impl MissingDoc {
// It's an option so the crate root can also use this function (it doesn't
// have a NodeId).
if let Some(id) = id {
let node_id = cx.tcx.hir().hir_to_node_id(id);
if !cx.access_levels.is_exported(node_id) {
if !cx.access_levels.is_exported(id) {
return;
}
}
Expand Down Expand Up @@ -557,8 +556,7 @@ impl LintPass for MissingCopyImplementations {

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingCopyImplementations {
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
let node_id = cx.tcx.hir().hir_to_node_id(item.hir_id);
if !cx.access_levels.is_reachable(node_id) {
if !cx.access_levels.is_reachable(item.hir_id) {
return;
}
let (def, ty) = match item.node {
Expand Down Expand Up @@ -629,8 +627,7 @@ impl LintPass for MissingDebugImplementations {

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
let node_id = cx.tcx.hir().hir_to_node_id(item.hir_id);
if !cx.access_levels.is_reachable(node_id) {
if !cx.access_levels.is_reachable(item.hir_id) {
return;
}

Expand Down Expand Up @@ -1169,9 +1166,8 @@ impl UnreachablePub {
fn perform_lint(&self, cx: &LateContext<'_, '_>, what: &str, id: hir::HirId,
vis: &hir::Visibility, span: Span, exportable: bool) {
let mut applicability = Applicability::MachineApplicable;
let node_id = cx.tcx.hir().hir_to_node_id(id);
match vis.node {
hir::VisibilityKind::Public if !cx.access_levels.is_reachable(node_id) => {
hir::VisibilityKind::Public if !cx.access_levels.is_reachable(id) => {
if span.ctxt().outer().expn_info().is_some() {
applicability = Applicability::MaybeIncorrect;
}
Expand Down
25 changes: 9 additions & 16 deletions src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ impl VisibilityLike for Option<AccessLevel> {
// (which require reaching the `DefId`s in them).
const SHALLOW: bool = true;
fn new_min<'a, 'tcx>(find: &FindMin<'a, 'tcx, Self>, def_id: DefId) -> Self {
cmp::min(if let Some(node_id) = find.tcx.hir().as_local_node_id(def_id) {
find.access_levels.map.get(&node_id).cloned()
cmp::min(if let Some(hir_id) = find.tcx.hir().as_local_hir_id(def_id) {
find.access_levels.map.get(&hir_id).cloned()
} else {
Self::MAX
}, find.min)
Expand Down Expand Up @@ -410,17 +410,15 @@ struct ReachEverythingInTheInterfaceVisitor<'b, 'a: 'b, 'tcx: 'a> {

impl<'a, 'tcx> EmbargoVisitor<'a, 'tcx> {
fn get(&self, id: hir::HirId) -> Option<AccessLevel> {
let node_id = self.tcx.hir().hir_to_node_id(id);
self.access_levels.map.get(&node_id).cloned()
self.access_levels.map.get(&id).cloned()
}

// Updates node level and returns the updated level.
fn update(&mut self, id: hir::HirId, level: Option<AccessLevel>) -> Option<AccessLevel> {
let old_level = self.get(id);
// Accessibility levels can only grow.
if level > old_level {
let node_id = self.tcx.hir().hir_to_node_id(id);
self.access_levels.map.insert(node_id, level.unwrap());
self.access_levels.map.insert(id, level.unwrap());
self.changed = true;
level
} else {
Expand Down Expand Up @@ -1197,8 +1195,7 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
fn trait_is_public(&self, trait_id: hir::HirId) -> bool {
// FIXME: this would preferably be using `exported_items`, but all
// traits are exported currently (see `EmbargoVisitor.exported_trait`).
let node_id = self.tcx.hir().hir_to_node_id(trait_id);
self.access_levels.is_public(node_id)
self.access_levels.is_public(trait_id)
}

fn check_generic_bound(&mut self, bound: &hir::GenericBound) {
Expand All @@ -1210,8 +1207,7 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
}

fn item_is_public(&self, id: &hir::HirId, vis: &hir::Visibility) -> bool {
let node_id = self.tcx.hir().hir_to_node_id(*id);
self.access_levels.is_reachable(node_id) || vis.node.is_pub()
self.access_levels.is_reachable(*id) || vis.node.is_pub()
}
}

Expand Down Expand Up @@ -1325,8 +1321,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
hir::ImplItemKind::Const(..) |
hir::ImplItemKind::Method(..) => {
self.access_levels.is_reachable(
self.tcx.hir().hir_to_node_id(
impl_item_ref.id.hir_id))
impl_item_ref.id.hir_id)
}
hir::ImplItemKind::Existential(..) |
hir::ImplItemKind::Type(_) => false,
Expand Down Expand Up @@ -1455,8 +1450,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
}

fn visit_foreign_item(&mut self, item: &'tcx hir::ForeignItem) {
let node_id = self.tcx.hir().hir_to_node_id(item.hir_id);
if self.access_levels.is_reachable(node_id) {
if self.access_levels.is_reachable(item.hir_id) {
intravisit::walk_foreign_item(self, item)
}
}
Expand All @@ -1474,8 +1468,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
v: &'tcx hir::Variant,
g: &'tcx hir::Generics,
item_id: hir::HirId) {
let node_id = self.tcx.hir().hir_to_node_id(v.node.data.hir_id());
if self.access_levels.is_reachable(node_id) {
if self.access_levels.is_reachable(v.node.data.hir_id()) {
self.in_variant = true;
intravisit::walk_variant(self, v, g, item_id);
self.in_variant = false;
Expand Down
51 changes: 33 additions & 18 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,19 @@ macro_rules! down_cast_data {
}

macro_rules! access_from {
($save_ctxt:expr, $vis:expr, $id:expr) => {
($save_ctxt:expr, $item:expr, $id:expr) => {
Access {
public: $vis.node.is_pub(),
public: $item.vis.node.is_pub(),
reachable: $save_ctxt.access_levels.is_reachable($id),
}
};
}

($save_ctxt:expr, $item:expr) => {
macro_rules! access_from_vis {
($save_ctxt:expr, $vis:expr, $id:expr) => {
Access {
public: $item.vis.node.is_pub(),
reachable: $save_ctxt.access_levels.is_reachable($item.id),
public: $vis.node.is_pub(),
reachable: $save_ctxt.access_levels.is_reachable($id),
}
};
}
Expand Down Expand Up @@ -303,7 +305,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {

method_data.value = sig_str;
method_data.sig = sig::method_signature(id, ident, generics, sig, &self.save_ctxt);
self.dumper.dump_def(&access_from!(self.save_ctxt, vis, id), method_data);
let hir_id = self.tcx.hir().node_to_hir_id(id);
self.dumper.dump_def(&access_from_vis!(self.save_ctxt, vis, hir_id), method_data);
}

// walk arg and return types
Expand All @@ -324,7 +327,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
fn process_struct_field_def(&mut self, field: &ast::StructField, parent_id: NodeId) {
let field_data = self.save_ctxt.get_field_data(field, parent_id);
if let Some(field_data) = field_data {
self.dumper.dump_def(&access_from!(self.save_ctxt, field), field_data);
let hir_id = self.tcx.hir().node_to_hir_id(field.id);
self.dumper.dump_def(&access_from!(self.save_ctxt, field, hir_id), field_data);
}
}

Expand Down Expand Up @@ -389,7 +393,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
|v| v.process_formals(&decl.inputs, &fn_data.qualname),
);
self.process_generic_params(ty_params, &fn_data.qualname, item.id);
self.dumper.dump_def(&access_from!(self.save_ctxt, item), fn_data);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
self.dumper.dump_def(&access_from!(self.save_ctxt, item, hir_id), fn_data);
}

for arg in &decl.inputs {
Expand All @@ -409,10 +414,11 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
typ: &'l ast::Ty,
expr: &'l ast::Expr,
) {
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
self.nest_tables(item.id, |v| {
if let Some(var_data) = v.save_ctxt.get_item_data(item) {
down_cast_data!(var_data, DefData, item.span);
v.dumper.dump_def(&access_from!(v.save_ctxt, item), var_data);
v.dumper.dump_def(&access_from!(v.save_ctxt, item, hir_id), var_data);
}
v.visit_ty(&typ);
v.visit_expr(expr);
Expand All @@ -434,9 +440,10 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
if !self.span.filter_generated(ident.span) {
let sig = sig::assoc_const_signature(id, ident.name, typ, expr, &self.save_ctxt);
let span = self.span_from_span(ident.span);
let hir_id = self.tcx.hir().node_to_hir_id(id);

self.dumper.dump_def(
&access_from!(self.save_ctxt, vis, id),
&access_from_vis!(self.save_ctxt, vis, hir_id),
Def {
kind: DefKind::Const,
id: id_from_node_id(id, &self.save_ctxt),
Expand Down Expand Up @@ -510,8 +517,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {

if !self.span.filter_generated(item.ident.span) {
let span = self.span_from_span(item.ident.span);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
self.dumper.dump_def(
&access_from!(self.save_ctxt, item),
&access_from!(self.save_ctxt, item, hir_id),
Def {
kind,
id: id_from_node_id(item.id, &self.save_ctxt),
Expand Down Expand Up @@ -550,7 +558,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
};
down_cast_data!(enum_data, DefData, item.span);

let access = access_from!(self.save_ctxt, item);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
let access = access_from!(self.save_ctxt, item, hir_id);

for variant in &enum_definition.variants {
let name = variant.node.ident.name.to_string();
Expand Down Expand Up @@ -698,8 +707,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
.iter()
.map(|i| id_from_node_id(i.id, &self.save_ctxt))
.collect();
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
self.dumper.dump_def(
&access_from!(self.save_ctxt, item),
&access_from!(self.save_ctxt, item, hir_id),
Def {
kind: DefKind::Trait,
id,
Expand Down Expand Up @@ -757,7 +767,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
fn process_mod(&mut self, item: &ast::Item) {
if let Some(mod_data) = self.save_ctxt.get_item_data(item) {
down_cast_data!(mod_data, DefData, item.span);
self.dumper.dump_def(&access_from!(self.save_ctxt, item), mod_data);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
self.dumper.dump_def(&access_from!(self.save_ctxt, item, hir_id), mod_data);
}
}

Expand Down Expand Up @@ -1197,7 +1208,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {

// The access is calculated using the current tree ID, but with the root tree's visibility
// (since nested trees don't have their own visibility).
let access = access_from!(self.save_ctxt, root_item.vis, id);
let hir_id = self.tcx.hir().node_to_hir_id(id);
let access = access_from!(self.save_ctxt, root_item, hir_id);

// The parent def id of a given use tree is always the enclosing item.
let parent = self.save_ctxt.tcx.hir().opt_local_def_id(id)
Expand Down Expand Up @@ -1394,9 +1406,10 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
if !self.span.filter_generated(item.ident.span) {
let span = self.span_from_span(item.ident.span);
let id = id_from_node_id(item.id, &self.save_ctxt);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);

self.dumper.dump_def(
&access_from!(self.save_ctxt, item),
&access_from!(self.save_ctxt, item, hir_id),
Def {
kind: DefKind::Type,
id,
Expand Down Expand Up @@ -1424,9 +1437,10 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
if !self.span.filter_generated(item.ident.span) {
let span = self.span_from_span(item.ident.span);
let id = id_from_node_id(item.id, &self.save_ctxt);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);

self.dumper.dump_def(
&access_from!(self.save_ctxt, item),
&access_from!(self.save_ctxt, item, hir_id),
Def {
kind: DefKind::Type,
id,
Expand Down Expand Up @@ -1624,7 +1638,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
}

fn visit_foreign_item(&mut self, item: &'l ast::ForeignItem) {
let access = access_from!(self.save_ctxt, item);
let hir_id = self.tcx.hir().node_to_hir_id(item.id);
let access = access_from!(self.save_ctxt, item, hir_id);

match item.node {
ast::ForeignItemKind::Fn(ref decl, ref generics) => {
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
sess.abort_if_errors();

let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
// Convert from a NodeId set to a DefId set since we don't always have easy access
// to the map from defid -> nodeid
// Convert from a HirId set to a DefId set since we don't always have easy access
// to the map from defid -> hirid
let access_levels = AccessLevels {
map: access_levels.map.iter()
.map(|(&k, &v)| (tcx.hir().local_def_id(k), v))
.map(|(&k, &v)| (tcx.hir().local_def_id_from_hir_id(k), v))
.collect()
};

Expand Down