You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #118333 - eduardosm:print-missing-target-features, r=est31
Print list of missing target features when calling a function with target features outside an unsafe block
Fixes#108680
Supersedes #109710. I used the same wording for the messages, but the implementation is different.
r? `@est31`
Copy file name to clipboardexpand all lines: compiler/rustc_mir_transform/messages.ftl
+12-1
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,19 @@ mir_transform_requires_unsafe = {$details} is unsafe and requires unsafe {$op_in
42
42
}
43
43
.not_inherited = items do not inherit unsafety from separate enclosing items
44
44
45
+
mir_transform_target_feature_call_help = in order for the call to be safe, the context requires the following additional target {$missing_target_features_count->
46
+
[1] feature
47
+
*[count] features
48
+
}: {$missing_target_features}
49
+
45
50
mir_transform_target_feature_call_label = call to function with `#[target_feature]`
46
-
mir_transform_target_feature_call_note = can only be called if the required target features are available
51
+
mir_transform_target_feature_call_note = the {$build_target_features} target {$build_target_features_count->
52
+
[1] feature
53
+
*[count] features
54
+
} being enabled in the build configuration does not remove the requirement to list {$build_target_features_count->
55
+
[1] it
56
+
*[count] them
57
+
} in `#[target_feature]`
47
58
48
59
mir_transform_unaligned_packed_ref = reference to packed field is unaligned
49
60
.note = packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
0 commit comments