Rollup merge of #69563 - andre-richter:fix_no_std_match, r=Mark-Simulacrum

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
This commit is contained in:
Dylan DPC 2020-02-29 02:16:23 +01:00 committed by GitHub
commit 1bb6760968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,7 @@ pub struct Target {
impl Target { impl Target {
pub fn from_triple(triple: &str) -> Self { pub fn from_triple(triple: &str) -> Self {
let mut target: Self = Default::default(); 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.no_std = true;
} }
target target