Skip to content

Commit

Permalink
Rollup merge of rust-lang#69563 - andre-richter:fix_no_std_match, r=M…
Browse files Browse the repository at this point in the history
…ark-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 rust-lang#68334
  • Loading branch information
Dylan-DPC authored Feb 29, 2020
2 parents c8db7dc + 7cf2bfb commit 1bb6760
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1bb6760

Please sign in to comment.