Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU"
This reverts commitacb4e8b625
, reversing changes made to100fde5246
.
This commit is contained in:
parent
1a1cc050d8
commit
47e6b5deed
25 changed files with 27 additions and 511 deletions
|
@ -747,35 +747,12 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
|||
Target::Field | Target::Arm | Target::MacroDef => {
|
||||
self.inline_attr_str_error_with_macro_def(hir_id, attr, "target_feature");
|
||||
}
|
||||
Target::Struct if self.tcx.features().struct_target_features => {
|
||||
let ty = self.tcx.hir_node(hir_id).expect_item();
|
||||
match ty.kind {
|
||||
ItemKind::Struct(data, _) => {
|
||||
if data.fields().len() != 0 {
|
||||
self.dcx().emit_err(errors::AttrShouldBeAppliedToFnOrUnitStruct {
|
||||
attr_span: attr.span,
|
||||
defn_span: span,
|
||||
});
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
panic!("Target::Struct for a non-struct");
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if self.tcx.features().struct_target_features {
|
||||
self.dcx().emit_err(errors::AttrShouldBeAppliedToFnOrUnitStruct {
|
||||
attr_span: attr.span,
|
||||
defn_span: span,
|
||||
});
|
||||
} else {
|
||||
self.dcx().emit_err(errors::AttrShouldBeAppliedToFn {
|
||||
attr_span: attr.span,
|
||||
defn_span: span,
|
||||
on_crate: hir_id == CRATE_HIR_ID,
|
||||
});
|
||||
}
|
||||
self.dcx().emit_err(errors::AttrShouldBeAppliedToFn {
|
||||
attr_span: attr.span,
|
||||
defn_span: span,
|
||||
on_crate: hir_id == CRATE_HIR_ID,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,15 +82,6 @@ pub(crate) struct AttrShouldBeAppliedToFn {
|
|||
pub on_crate: bool,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(passes_should_be_applied_to_fn_or_unit_struct)]
|
||||
pub(crate) struct AttrShouldBeAppliedToFnOrUnitStruct {
|
||||
#[primary_span]
|
||||
pub attr_span: Span,
|
||||
#[label]
|
||||
pub defn_span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(passes_should_be_applied_to_fn, code = E0739)]
|
||||
pub(crate) struct TrackedCallerWrongLocation {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue