-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove uses of unstable feature(cfg_target_has_atomic)
- Loading branch information
Showing
25 changed files
with
253 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![warn(rust_2018_idioms)] | ||
|
||
use std::env; | ||
|
||
include!("no_atomic_cas.rs"); | ||
|
||
// The rustc-cfg strings below are *not* public API. Please let us know by | ||
// opening a GitHub issue if your build environment requires some way to enable | ||
// these cfgs other than by executing our build script. | ||
fn main() { | ||
let target = match env::var("TARGET") { | ||
Ok(target) => target, | ||
Err(e) => { | ||
println!( | ||
"cargo:warning={}: unable to get TARGET environment variable: {}", | ||
env!("CARGO_PKG_NAME"), | ||
e | ||
); | ||
return; | ||
} | ||
}; | ||
|
||
// Note that this is `no_*`, not `has_*`. This allows treating | ||
// `cfg(target_has_atomic = "ptr")` as true when the build script doesn't | ||
// run. This is needed for compatibility with non-cargo build systems that | ||
// don't run the build script. | ||
if NO_ATOMIC_CAS_TARGETS.contains(&&*target) { | ||
println!("cargo:rustc-cfg=crossbeam_no_atomic_cas"); | ||
} | ||
|
||
println!("cargo:rerun-if-changed=no_atomic_cas.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Update the list of targets that do not support atomic CAS operations. | ||
# | ||
# Usage: | ||
# ./ci/no_atomic_cas.sh | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
cd "$(cd "$(dirname "$0")" && pwd)"/.. | ||
|
||
file="no_atomic_cas.rs" | ||
|
||
{ | ||
echo "// This file is @generated by $(basename "$0")." | ||
echo "// It is not intended for manual editing." | ||
echo "" | ||
echo "const NO_ATOMIC_CAS_TARGETS: &[&str] = &[" | ||
} >"$file" | ||
|
||
for target in $(rustc --print target-list); do | ||
res=$(rustc --print target-spec-json -Z unstable-options --target "$target" \ | ||
| jq -r "select(.\"atomic-cas\" == false)") | ||
[[ -z "$res" ]] || echo " \"$target\"," >>"$file" | ||
done | ||
|
||
echo "];" >>"$file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![warn(rust_2018_idioms)] | ||
|
||
use std::env; | ||
|
||
include!("no_atomic_cas.rs"); | ||
|
||
// The rustc-cfg strings below are *not* public API. Please let us know by | ||
// opening a GitHub issue if your build environment requires some way to enable | ||
// these cfgs other than by executing our build script. | ||
fn main() { | ||
let target = match env::var("TARGET") { | ||
Ok(target) => target, | ||
Err(e) => { | ||
println!( | ||
"cargo:warning={}: unable to get TARGET environment variable: {}", | ||
env!("CARGO_PKG_NAME"), | ||
e | ||
); | ||
return; | ||
} | ||
}; | ||
|
||
// Note that this is `no_*`, not `has_*`. This allows treating | ||
// `cfg(target_has_atomic = "ptr")` as true when the build script doesn't | ||
// run. This is needed for compatibility with non-cargo build systems that | ||
// don't run the build script. | ||
if NO_ATOMIC_CAS_TARGETS.contains(&&*target) { | ||
println!("cargo:rustc-cfg=crossbeam_no_atomic_cas"); | ||
} | ||
|
||
println!("cargo:rerun-if-changed=no_atomic_cas.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../no_atomic_cas.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![warn(rust_2018_idioms)] | ||
|
||
use std::env; | ||
|
||
include!("no_atomic_cas.rs"); | ||
|
||
// The rustc-cfg strings below are *not* public API. Please let us know by | ||
// opening a GitHub issue if your build environment requires some way to enable | ||
// these cfgs other than by executing our build script. | ||
fn main() { | ||
let target = match env::var("TARGET") { | ||
Ok(target) => target, | ||
Err(e) => { | ||
println!( | ||
"cargo:warning={}: unable to get TARGET environment variable: {}", | ||
env!("CARGO_PKG_NAME"), | ||
e | ||
); | ||
return; | ||
} | ||
}; | ||
|
||
// Note that this is `no_*`, not `has_*`. This allows treating | ||
// `cfg(target_has_atomic = "ptr")` as true when the build script doesn't | ||
// run. This is needed for compatibility with non-cargo build systems that | ||
// don't run the build script. | ||
if NO_ATOMIC_CAS_TARGETS.contains(&&*target) { | ||
println!("cargo:rustc-cfg=crossbeam_no_atomic_cas"); | ||
} | ||
|
||
println!("cargo:rerun-if-changed=no_atomic_cas.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../no_atomic_cas.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![warn(rust_2018_idioms)] | ||
|
||
use std::env; | ||
|
||
include!("no_atomic_cas.rs"); | ||
|
||
// The rustc-cfg strings below are *not* public API. Please let us know by | ||
// opening a GitHub issue if your build environment requires some way to enable | ||
// these cfgs other than by executing our build script. | ||
fn main() { | ||
let target = match env::var("TARGET") { | ||
Ok(target) => target, | ||
Err(e) => { | ||
println!( | ||
"cargo:warning={}: unable to get TARGET environment variable: {}", | ||
env!("CARGO_PKG_NAME"), | ||
e | ||
); | ||
return; | ||
} | ||
}; | ||
|
||
// Note that this is `no_*`, not `has_*`. This allows treating | ||
// `cfg(target_has_atomic = "ptr")` as true when the build script doesn't | ||
// run. This is needed for compatibility with non-cargo build systems that | ||
// don't run the build script. | ||
if NO_ATOMIC_CAS_TARGETS.contains(&&*target) { | ||
println!("cargo:rustc-cfg=crossbeam_no_atomic_cas"); | ||
} | ||
|
||
println!("cargo:rerun-if-changed=no_atomic_cas.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../no_atomic_cas.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.