Change span field accesses to method calls
This commit is contained in:
parent
f43e549b88
commit
115b3b03b0
27 changed files with 264 additions and 202 deletions
|
@ -1114,7 +1114,7 @@ fn check_impl_items_against_trait<'tcx>(
|
|||
if let Some(missing_items) = must_implement_one_of {
|
||||
let attr_span = tcx
|
||||
.get_attr(trait_ref.def_id, sym::rustc_must_implement_one_of)
|
||||
.map(|attr| attr.span);
|
||||
.map(|attr| attr.span());
|
||||
|
||||
missing_items_must_implement_one_of_err(
|
||||
tcx,
|
||||
|
@ -1422,7 +1422,7 @@ fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId) {
|
|||
if let Some(attr) = tcx.get_attrs(def_id, sym::repr).next() {
|
||||
struct_span_code_err!(
|
||||
tcx.dcx(),
|
||||
attr.span,
|
||||
attr.span(),
|
||||
E0084,
|
||||
"unsupported representation for zero-variant enum"
|
||||
)
|
||||
|
|
|
@ -99,7 +99,7 @@ fn check_main_fn_ty(tcx: TyCtxt<'_>, main_def_id: DefId) {
|
|||
}
|
||||
|
||||
for attr in tcx.get_attrs(main_def_id, sym::track_caller) {
|
||||
tcx.dcx().emit_err(errors::TrackCallerOnMain { span: attr.span, annotated: main_span });
|
||||
tcx.dcx().emit_err(errors::TrackCallerOnMain { span: attr.span(), annotated: main_span });
|
||||
error = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1202,7 +1202,7 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
|
|||
// and that they are all identifiers
|
||||
.and_then(|attr| match attr.meta_item_list() {
|
||||
Some(items) if items.len() < 2 => {
|
||||
tcx.dcx().emit_err(errors::MustImplementOneOfAttribute { span: attr.span });
|
||||
tcx.dcx().emit_err(errors::MustImplementOneOfAttribute { span: attr.span() });
|
||||
|
||||
None
|
||||
}
|
||||
|
@ -1214,7 +1214,7 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
|
|||
tcx.dcx().emit_err(errors::MustBeNameOfAssociatedFunction { span });
|
||||
})
|
||||
.ok()
|
||||
.zip(Some(attr.span)),
|
||||
.zip(Some(attr.span())),
|
||||
// Error is reported by `rustc_attr!`
|
||||
None => None,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue