From 7cf2bfb6578281b568735847549305059a3d6a48 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Fri, 28 Feb 2020 21:51:16 +0100 Subject: [PATCH] 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 https://github.com/rust-lang/rust/pull/68334 --- src/bootstrap/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 746cddbabd639..56164b74f3088 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -180,7 +180,7 @@ pub struct Target { impl Target { pub fn from_triple(triple: &str) -> Self { let mut target: Self = Default::default(); - if triple.contains("-none-") || triple.contains("nvptx") { + if triple.contains("-none") || triple.contains("nvptx") { target.no_std = true; } target