10000 Remove Spans from HIR -- 2/N -- Small HIR nodes by cjgillot · Pull Request #73094 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Remove Spans from HIR -- 2/N -- Small HIR nodes #73094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
625594f
Remove useless Clone bound in IndexVec.
cjgillot May 19, 2020
6758a85
Introduce HirIdVec.
cjgillot May 19, 2020
0b793a3
Collect spans during lowering.
cjgillot May 1, 2020
e69a8df
Introduce a query for HIR spans.
cjgillot May 1, 2020
0d98c91
Don't pass spans in hir::map::blocks.
cjgillot May 2, 2020
3947c9e
Stop passing the Span in HIR visiting.
cjgillot May 2, 2020
973d19b
Pass HirId in save_analysis.
cjgillot Jun 7, 2020
700d697
Remove Span parameter from HIR collector.
cjgillot Jun 3, 2020
05dc82a
Fix fulldeps tests.
cjgillot Dec 13, 2020
7b9999c
Fix clippy.
cjgillot Dec 13, 2020
3dd2859
Remove span from hir::Param.
cjgillot May 1, 2020
5dada24
Remove span from hir::Variant.
cjgillot May 1, 2020
e92e9f7
Remove span from hir::StructField.
cjgillot May 1, 2020
f94bbef
Remove span from hir::Stmt.
cjgillot May 1, 2020
2bc251c
Remove span from hir::Block.
cjgillot May 1, 2020
fcae632
Remove span from hir::MacroDef.
cjgillot May 2, 2020
1641026
Remove span from hir::GenericParam.
cjgillot May 2, 2020
521bc45
Remove span from hir::Arm.
cjgillot May 2, 2020
0373228
Remove span from hir::FieldPat.
cjgillot May 2, 2020
afc6e69
Remove span from hir::Local.
cjgillot May 2, 2020
732ae69
Remove span from hir::Pat.
cjgillot May 2, 2020
96b8564
Remove span from hir::Field.
cjgillot May 2, 2020
e6c0698
Remove GenericArg::span.
cjgillot May 3, 2020
4491f82
Remove Span from hir::TypeBinding.
cjgillot May 8, 2020
fdd2c7d
Remove Span from hir::ConstArg.
cjgillot Jun 1, 2020
ba8fc92
Remove Span from hir::TraitItemRef.
cjgillot Jun 1, 2020
272df28
Remove Span from hir::ImplItemRef.
cjgillot Jun 1, 2020
a0b4ad1
Remove span from hir::ForeignItemRef.
cjgillot Dec 11, 2020
b604b5e
Fix fulldeps tests.
cjgillot May 9, 2020
7ec01a6
Fortify find_entry.
cjgillot Dec 13, 2020
304bdec
Remove Span from hir::CrateItem.
cjgillot Dec 10, 2020
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
Remove Span from hir::TypeBinding.
  • Loading branch information
cjgillot committed Jan 6, 2021
commit 4491f82d5a607b6db715cdaa3c440b123caeee6b
1 change: 0 additions & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
hir_id: self.lower_node_id(constraint.id, constraint.span),
ident: constraint.ident,
kind,
span: constraint.span,
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_lowering/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
.args
.first()
.map(|a| self.spans[a.id()])
.or_else(|| generic_args.bindings.first().map(|b| b.span));
.or_else(|| generic_args.bindings.first().map(|b| self.spans[b.hir_id]));
if !generic_args.parenthesized && !has_lifetimes {
generic_args.args = self
.elided_path_lifetimes(
Expand Down Expand Up @@ -425,6 +425,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
) -> hir::TypeBinding<'hir> {
let ident = Ident::with_dummy_span(hir::FN_OUTPUT_NAME);
let kind = hir::TypeBindingKind::Equality { ty };
hir::TypeBinding { hir_id: self.next_id(span), span, ident, kind }
hir::TypeBinding { hir_id: self.next_id(span), ident, kind }
}
}
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,6 @@ pub struct TypeBinding<'hir> {
#[stable_hasher(project(name))]
pub ident: Ident,
pub kind: TypeBindingKind<'hir>,
pub span: Span,
}

// Represents the two kinds of type bindings.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/astconv/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
}

if position != GenericArgPosition::Type && !args.bindings.is_empty() {
AstConv::prohibit_assoc_ty_binding(tcx, args.bindings[0].span);
AstConv::prohibit_assoc_ty_binding(tcx, tcx.hir().span(args.bindings[0].hir_id));
}

let explicit_late_bound =
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_typeck/src/astconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
ConvertedBindingKind::Constraint(bounds)
}
};
ConvertedBinding { item_name: binding.ident, kind, span: binding.span }
ConvertedBinding {
item_name: binding.ident,
kind,
span: tcx.hir().span(binding.hir_id),
}
})
.collect();

Expand Down Expand Up @@ -1798,7 +1802,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// Only emit the first error to avoid overloading the user with error messages.
if let [binding, ..] = segment.generic_args().bindings {
has_err = true;
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
Self::prohibit_assoc_ty_binding(self.tcx(), self.tcx().hir().span(binding.hir_id));
}
}
has_err
Expand Down
0