1
Fork 0

only_local: always check for misuse

This commit is contained in:
lcnr 2022-05-02 09:31:56 +02:00
parent fc128b6764
commit 6c8265dc56
36 changed files with 343 additions and 382 deletions

View file

@ -568,11 +568,8 @@ impl<T> Trait<T> for X {
}
}
TargetFeatureCast(def_id) => {
let attrs = self.get_attrs(*def_id);
let target_spans = attrs
.iter()
.filter(|attr| attr.has_name(sym::target_feature))
.map(|attr| attr.span);
let target_spans =
self.get_attrs(*def_id, sym::target_feature).map(|attr| attr.span);
diag.note(
"functions with `#[target_feature]` can only be coerced to `unsafe` function pointers"
);