forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#136943 - GuillaumeGomez:rollup-amtd3mq, r=Gui…
…llaumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#136758 (tests: `-Copt-level=3` instead of `-O` in assembly tests) - rust-lang#136761 (tests: `-Copt-level=3` instead of `-O` in codegen tests) - rust-lang#136784 (Nuke `Buffer` abstraction from `librustdoc`, take 2 💣) - rust-lang#136838 (Check whole `Unsize` predicate for escaping bound vars) - rust-lang#136848 (add docs and ut for bootstrap util cache) - rust-lang#136871 (dev-guide: Link to `t-lang` procedures for new features) - rust-lang#136890 (Change swap_nonoverlapping from lang to library UB) - rust-lang#136901 (compiler: give `ExternAbi` truly stable `Hash` and `Ord`) - rust-lang#136907 (compiler: Make middle errors `pub(crate)` and bury the dead code) - rust-lang#136916 (use cc archiver as default in `cc2ar`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
302 changed files
with
1,434 additions
and
1,222 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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
use std::assert_matches::assert_matches; | ||
use std::str::FromStr; | ||
|
||
use super::*; | ||
|
||
#[allow(non_snake_case)] | ||
#[test] | ||
fn lookup_Rust() { | ||
let abi = lookup("Rust"); | ||
assert!(abi.is_ok() && abi.unwrap().data().name == "Rust"); | ||
let abi = ExternAbi::from_str("Rust"); | ||
assert!(abi.is_ok() && abi.unwrap().as_str() == "Rust"); | ||
} | ||
|
||
#[test] | ||
fn lookup_cdecl() { | ||
let abi = lookup("cdecl"); | ||
assert!(abi.is_ok() && abi.unwrap().data().name == "cdecl"); | ||
let abi = ExternAbi::from_str("cdecl"); | ||
assert!(abi.is_ok() && abi.unwrap().as_str() == "cdecl"); | ||
} | ||
|
||
#[test] | ||
fn lookup_baz() { | ||
let abi = lookup("baz"); | ||
assert_matches!(abi, Err(AbiUnsupported {})); | ||
let abi = ExternAbi::from_str("baz"); | ||
assert_matches!(abi, Err(AbiFromStrErr::Unknown)); | ||
} | ||
|
||
#[test] | ||
fn indices_are_correct() { | ||
for (i, abi_data) in AbiDatas.iter().enumerate() { | ||
assert_eq!(i, abi_data.abi.index()); | ||
} | ||
fn guarantee_lexicographic_ordering() { | ||
let abis = ExternAbi::ALL_VARIANTS; | ||
let mut sorted_abis = abis.to_vec(); | ||
sorted_abis.sort_unstable(); | ||
assert_eq!(abis, sorted_abis); | ||
} |
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
Oops, something went wrong.