Do not store visibility in *ItemRef.

This commit is contained in:
Camille GILLOT
2021-07-15 22:19:39 +02:00
parent 5ecc8ad846
commit d7795d302a
16 changed files with 49 additions and 70 deletions

View File

@@ -99,7 +99,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
num_lifetimes,
parenthesized_generic_args,
itctx.reborrow(),
None,
)
},
)),
@@ -147,7 +146,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
0,
ParenthesizedGenericArgs::Err,
itctx.reborrow(),
None,
));
let qpath = hir::QPath::TypeRelative(ty, hir_segment);
@@ -178,7 +176,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
res: Res,
p: &Path,
param_mode: ParamMode,
explicit_owner: Option<NodeId>,
) -> &'hir hir::Path<'hir> {
self.arena.alloc(hir::Path {
res,
@@ -190,7 +187,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
0,
ParenthesizedGenericArgs::Err,
ImplTraitContext::disallowed(),
explicit_owner,
)
})),
span: self.lower_span(p.span),
@@ -205,7 +201,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
) -> &'hir hir::Path<'hir> {
let res = self.expect_full_res(id);
let res = self.lower_res(res);
self.lower_path_extra(res, p, param_mode, None)
self.lower_path_extra(res, p, param_mode)
}
crate fn lower_path_segment(
@@ -216,7 +212,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
expected_lifetimes: usize,
parenthesized_generic_args: ParenthesizedGenericArgs,
itctx: ImplTraitContext<'_, 'hir>,
explicit_owner: Option<NodeId>,
) -> hir::PathSegment<'hir> {
debug!(
"path_span: {:?}, lower_path_segment(segment: {:?}, expected_lifetimes: {:?})",
@@ -354,11 +349,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
let res = self.expect_full_res(segment.id);
let id = if let Some(owner) = explicit_owner {
self.lower_node_id_with_owner(segment.id, owner)
} else {
self.lower_node_id(segment.id)
};
let id = self.lower_node_id(segment.id);
debug!(
"lower_path_segment: ident={:?} original-id={:?} new-id={:?}",
segment.ident, segment.id, id,