Skip to content

Commit 7cf2bfb

Browse files
committed
Fix no_std detection for target triples
The current check for wether a target is no_std or not is matching for the string "-none-" in a target triple. This doesn't work for triples that end in "-none", like "aarch64-unknown-none". Fix this by matching for "-none" instead. I checked for all the current target triples containing "none", and this should not generate any false positives. This fixes an issue encountered in #68334
1 parent eaa02f5 commit 7cf2bfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bootstrap/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub struct Target {
180180
impl Target {
181181
pub fn from_triple(triple: &str) -> Self {
182182
let mut target: Self = Default::default();
183-
if triple.contains("-none-") || triple.contains("nvptx") {
183+
if triple.contains("-none") || triple.contains("nvptx") {
184184
target.no_std = true;
185185
}
186186
target

0 commit comments

Comments
 (0)