replace usages of fn_sig query with bound_fn_sig
This commit is contained in:
parent
d7948c843d
commit
e982971ff2
66 changed files with 147 additions and 113 deletions
|
@ -214,7 +214,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
|
|||
}
|
||||
} else if attr.has_name(sym::cmse_nonsecure_entry) {
|
||||
if validate_fn_only_attr(attr.span)
|
||||
&& !matches!(tcx.fn_sig(did).abi(), abi::Abi::C { .. })
|
||||
&& !matches!(tcx.bound_fn_sig(did.into()).skip_binder().abi(), abi::Abi::C { .. })
|
||||
{
|
||||
struct_span_err!(
|
||||
tcx.sess,
|
||||
|
@ -234,7 +234,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
|
|||
} else if attr.has_name(sym::track_caller) {
|
||||
if !tcx.is_closure(did.to_def_id())
|
||||
&& validate_fn_only_attr(attr.span)
|
||||
&& tcx.fn_sig(did).abi() != abi::Abi::Rust
|
||||
&& tcx.bound_fn_sig(did.into()).skip_binder().abi() != abi::Abi::Rust
|
||||
{
|
||||
struct_span_err!(tcx.sess, attr.span, E0737, "`#[track_caller]` requires Rust ABI")
|
||||
.emit();
|
||||
|
@ -266,7 +266,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
|
|||
}
|
||||
} else if attr.has_name(sym::target_feature) {
|
||||
if !tcx.is_closure(did.to_def_id())
|
||||
&& tcx.fn_sig(did).unsafety() == hir::Unsafety::Normal
|
||||
&& tcx.bound_fn_sig(did.into()).skip_binder().unsafety() == hir::Unsafety::Normal
|
||||
{
|
||||
if tcx.sess.target.is_like_wasm || tcx.sess.opts.actually_rustdoc {
|
||||
// The `#[target_feature]` attribute is allowed on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue