forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#131547 - matthiaskrgr:rollup-ui4p744, r=matth…
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#129079 (Create `_imp__` symbols also when doing ThinLTO) - rust-lang#131208 (ABI: Pass aggregates by value on AIX) - rust-lang#131394 (fix(rustdoc): add space between struct fields and their descriptions) - rust-lang#131519 (Use Default visibility for rustc-generated C symbol declarations) - rust-lang#131541 (compiletest: Extract auxiliary-crate properties to their own module/struct) - rust-lang#131542 (next-solver: remove outdated FIXMEs) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
225 additions
and
95 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
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
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
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,60 @@ | ||
//! Code for dealing with test directives that request an "auxiliary" crate to | ||
//! be built and made available to the test in some way. | ||
|
||
use std::iter; | ||
|
||
use crate::common::Config; | ||
use crate::header::directives::{AUX_BIN, AUX_BUILD, AUX_CODEGEN_BACKEND, AUX_CRATE}; | ||
|
||
/// Properties parsed from `aux-*` test directives. | ||
#[derive(Clone, Debug, Default)] | ||
pub(crate) struct AuxProps { | ||
/// Other crates that should be built and made available to this test. | ||
/// These are filenames relative to `./auxiliary/` in the test's directory. | ||
pub(crate) builds: Vec<String>, | ||
/// Auxiliary crates that should be compiled as `#![crate_type = "bin"]`. | ||
pub(crate) bins: Vec<String>, | ||
/// Similar to `builds`, but a list of NAME=somelib.rs of dependencies | ||
/// to build and pass with the `--extern` flag. | ||
pub(crate) crates: Vec<(String, String)>, | ||
/// Similar to `builds`, but also uses the resulting dylib as a | ||
/// `-Zcodegen-backend` when compiling the test file. | ||
pub(crate) codegen_backend: Option<String>, | ||
} | ||
|
||
impl AuxProps { | ||
/// Yields all of the paths (relative to `./auxiliary/`) that have been | ||
/// specified in `aux-*` directives for this test. | ||
pub(crate) fn all_aux_path_strings(&self) -> impl Iterator<Item = &str> { | ||
let Self { builds, bins, crates, codegen_backend } = self; | ||
|
||
iter::empty() | ||
.chain(builds.iter().map(String::as_str)) | ||
.chain(bins.iter().map(String::as_str)) | ||
.chain(crates.iter().map(|(_, path)| path.as_str())) | ||
.chain(codegen_backend.iter().map(String::as_str)) | ||
} | ||
} | ||
|
||
/// If the given test directive line contains an `aux-*` directive, parse it | ||
/// and update [`AuxProps`] accordingly. | ||
pub(super) fn parse_and_update_aux(config: &Config, ln: &str, aux: &mut AuxProps) { | ||
if !ln.starts_with("aux-") { | ||
return; | ||
} | ||
|
||
config.push_name_value_directive(ln, AUX_BUILD, &mut aux.builds, |r| r.trim().to_string()); | ||
config.push_name_value_directive(ln, AUX_BIN, &mut aux.bins, |r| r.trim().to_string()); | ||
config.push_name_value_directive(ln, AUX_CRATE, &mut aux.crates, parse_aux_crate); | ||
if let Some(r) = config.parse_name_value_directive(ln, AUX_CODEGEN_BACKEND) { | ||
aux.codegen_backend = Some(r.trim().to_owned()); | ||
} | ||
} | ||
|
||
fn parse_aux_crate(r: String) -> (String, String) { | ||
let mut parts = r.trim().splitn(2, '='); | ||
( | ||
parts.next().expect("missing aux-crate name (e.g. log=log.rs)").to_string(), | ||
parts.next().expect("missing aux-crate value (e.g. log=log.rs)").to_string(), | ||
) | ||
} |
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 |
---|---|---|
|
@@ -242,7 +242,8 @@ fn aux_build() { | |
//@ aux-build: b.rs | ||
" | ||
) | ||
.aux, | ||
.aux | ||
.builds, | ||
vec!["a.rs", "b.rs"], | ||
); | ||
} | ||
|
Oops, something went wrong.