Auto merge of #101333 - matthiaskrgr:rollup-qpf1otj, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #100121 (Try normalizing types without RevealAll in ParamEnv in MIR validation)
 - #100200 (Change implementation of `-Z gcc-ld` and `lld-wrapper` again)
 - #100814 ( Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1)
 - #101215 (Also replace the version placeholder in rustc_attr)
 - #101260 (Use `FILE_ATTRIBUTE_TAG_INFO` to get reparse tag)
 - #101323 (Remove unused .toggle-label CSS rule)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2022-09-02 18:40:21 +00:00
commit 9ba169a73a
28 changed files with 303 additions and 144 deletions

View file

@ -1281,7 +1281,9 @@ impl Step for Assemble {
compiler: build_compiler,
target: target_compiler.host,
});
builder.copy(&lld_wrapper_exe, &gcc_ld_dir.join(exe("ld", target_compiler.host)));
for name in crate::LLD_FILE_NAMES {
builder.copy(&lld_wrapper_exe, &gcc_ld_dir.join(exe(name, target_compiler.host)));
}
}
if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) {

View file

@ -423,8 +423,11 @@ impl Step for Rustc {
let gcc_lld_src_dir = src_dir.join("gcc-ld");
let gcc_lld_dst_dir = dst_dir.join("gcc-ld");
t!(fs::create_dir(&gcc_lld_dst_dir));
let exe_name = exe("ld", compiler.host);
builder.copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
for name in crate::LLD_FILE_NAMES {
let exe_name = exe(name, compiler.host);
builder
.copy(&gcc_lld_src_dir.join(&exe_name), &gcc_lld_dst_dir.join(&exe_name));
}
}
// Man pages

View file

@ -187,6 +187,9 @@ const LLVM_TOOLS: &[&str] = &[
"opt", // used to optimize LLVM bytecode
];
/// LLD file names for all flavors.
const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
pub const VERSION: usize = 2;
/// Extra --check-cfg to add when building

View file

@ -1241,12 +1241,6 @@ h3.variant {
margin-left: 24px;
}
.toggle-label {
display: inline-block;
margin-left: 4px;
margin-top: 3px;
}
:target > code, :target > .code-header {
opacity: 1;
}

View file

@ -242,7 +242,6 @@ a.test-arrow:hover {
color: #c5c5c5;
}
.toggle-label,
.code-attribute {
color: #999;
}

View file

@ -197,7 +197,6 @@ a.test-arrow:hover{
background-color: #4e8bca;
}
.toggle-label,
.code-attribute {
color: #999;
}

View file

@ -182,7 +182,6 @@ a.test-arrow:hover{
background-color: #4e8bca;
}
.toggle-label,
.code-attribute {
color: #999;
}

View file

@ -0,0 +1,25 @@
// check-pass
pub trait Backend {
type DescriptorSetLayout;
}
pub struct Back;
impl Backend for Back {
type DescriptorSetLayout = u32;
}
pub struct HalSetLayouts {
vertex_layout: <Back as Backend>::DescriptorSetLayout,
}
impl HalSetLayouts {
pub fn iter<DSL>(self) -> DSL
where
Back: Backend<DescriptorSetLayout = DSL>,
{
self.vertex_layout
}
}
fn main() {}

View file

@ -8,8 +8,8 @@
//! make gcc/clang pass `-flavor <flavor>` as the first two arguments in the linker invocation
//! and since Windows does not support symbolic links for files this wrapper is used in place of a
//! symbolic link. It execs `../rust-lld -flavor <flavor>` by propagating the flavor argument
//! passed to the wrapper as the first two arguments. On Windows it spawns a `..\rust-lld.exe`
//! child process.
//! obtained from the wrapper's name as the first two arguments.
//! On Windows it spawns a `..\rust-lld.exe` child process.
use std::fmt::Display;
use std::path::{Path, PathBuf};
@ -53,29 +53,32 @@ fn get_rust_lld_path(current_exe_path: &Path) -> PathBuf {
rust_lld_path
}
/// Extract LLD flavor name from the lld-wrapper executable name.
fn get_lld_flavor(current_exe_path: &Path) -> Result<&'static str, String> {
let stem = current_exe_path.file_stem();
Ok(match stem.and_then(|s| s.to_str()) {
Some("ld.lld") => "gnu",
Some("ld64.lld") => "darwin",
Some("lld-link") => "link",
Some("wasm-ld") => "wasm",
_ => return Err(format!("{:?}", stem)),
})
}
/// Returns the command for invoking rust-lld with the correct flavor.
/// LLD only accepts the flavor argument at the first two arguments, so move it there.
/// LLD only accepts the flavor argument at the first two arguments, so pass it there.
///
/// Exits on error.
fn get_rust_lld_command(current_exe_path: &Path) -> process::Command {
let rust_lld_path = get_rust_lld_path(current_exe_path);
let mut command = process::Command::new(rust_lld_path);
let mut flavor = None;
let args = env::args_os()
.skip(1)
.filter(|arg| match arg.to_str().and_then(|s| s.strip_prefix("-rustc-lld-flavor=")) {
Some(suffix) => {
flavor = Some(suffix.to_string());
false
}
None => true,
})
.collect::<Vec<_>>();
let flavor =
get_lld_flavor(current_exe_path).unwrap_or_exit_with("executable has unexpected name");
command.arg("-flavor");
command.arg(flavor.unwrap_or_exit_with("-rustc-lld-flavor=<flavor> is not passed"));
command.args(args);
command.arg(flavor);
command.args(env::args_os().skip(1));
command
}

View file

@ -14,7 +14,7 @@ fn main() {
walk::filter_dirs(path)
// We exempt these as they require the placeholder
// for their operation
|| path.ends_with("compiler/rustc_passes/src/lib_features.rs")
|| path.ends_with("compiler/rustc_attr/src/builtin.rs")
|| path.ends_with("src/tools/tidy/src/features/version.rs")
|| path.ends_with("src/tools/replace-version-placeholder")
},