review
This commit is contained in:
parent
d371ebe117
commit
32b13ac928
11 changed files with 73 additions and 59 deletions
|
@ -375,12 +375,8 @@ impl<'tcx> UnsafetyChecker<'_, 'tcx> {
|
|||
}
|
||||
|
||||
let callee_features = &self.tcx.codegen_fn_attrs(func_did).target_features;
|
||||
// Constants don't have codegen attributes, so the body might not have codegen attributes.
|
||||
let self_features: &[_] = if self.tcx.has_codegen_attrs(self.tcx.def_kind(self.body_did)) {
|
||||
&self.tcx.codegen_fn_attrs(self.body_did).target_features
|
||||
} else {
|
||||
&[]
|
||||
};
|
||||
// The body might be a constant, so it doesn't have codegen attributes.
|
||||
let self_features = &self.tcx.body_codegen_attrs(self.body_did.to_def_id()).target_features;
|
||||
|
||||
// Is `callee_features` a subset of `calling_features`?
|
||||
if !callee_features.iter().all(|feature| self_features.contains(feature)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue