diff options
| author | bors <bors@rust-lang.org> | 2024-03-07 22:43:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-07 22:43:18 +0000 |
| commit | 9823f173150baf893b2491513466ac024ae63e40 (patch) | |
| tree | 538ea5bd9a39b38420474478aeed68f7283d0130 /src | |
| parent | 9c3ad802d9b9633d60d3a74668eb1be819212d34 (diff) | |
| parent | 92d7e02bb29d4341203dbae28aaa46acec930b28 (diff) | |
Auto merge of #122151 - GuillaumeGomez:rollup-hfxr9kv, r=GuillaumeGomez
Rollup of 10 pull requests Successful merges: - #119888 (Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute) - #121089 (Remove `feed_local_def_id`) - #122004 (AST validation: Improve handling of inherent impls nested within functions and anon consts) - #122087 (Add missing background color for top-level rust documentation page and increase contrast by setting text color to black) - #122136 (Include all library files in artifact summary on CI) - #122137 (Don't pass a break scope to `Builder::break_for_else`) - #122138 (Record mtime in bootstrap's LLVM linker script) - #122141 (sync (try_)instantiate_mir_and_normalize_erasing_regions implementation) - #122142 (cleanup rustc_infer) - #122147 (Make `std::os::unix::ucred` module private) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/dist.rs | 10 | ||||
| -rw-r--r-- | src/doc/rust.css | 4 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/language-features/diagnostic-namespace.md | 84 | ||||
| -rw-r--r-- | src/tools/opt-dist/src/utils/artifact_size.rs | 15 |
4 files changed, 12 insertions, 101 deletions
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index c8c32fb8699..1090edc9c92 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -2047,7 +2047,15 @@ fn install_llvm_file( // projects like miri link against librustc_driver.so. We don't use a symlink, as // these are not allowed inside rustup components. let link = t!(fs::read_link(source)); - t!(std::fs::write(full_dest, format!("INPUT({})\n", link.display()))); + let mut linker_script = t!(fs::File::create(full_dest)); + t!(write!(linker_script, "INPUT({})\n", link.display())); + + // We also want the linker script to have the same mtime as the source, otherwise it + // can trigger rebuilds. + let meta = t!(fs::metadata(source)); + if let Ok(mtime) = meta.modified() { + t!(linker_script.set_modified(mtime)); + } } } else { builder.install(&source, destination, 0o644); diff --git a/src/doc/rust.css b/src/doc/rust.css index e0bf64c33bc..bd2e0b94518 100644 --- a/src/doc/rust.css +++ b/src/doc/rust.css @@ -5,12 +5,13 @@ body { margin: 0 auto; padding: 0 15px; font-size: 18px; - color: #333; + color: #000; line-height: 1.428571429; -webkit-box-sizing: unset; -moz-box-sizing: unset; box-sizing: unset; + background: #fff; } @media (min-width: 768px) { body { @@ -39,7 +40,6 @@ h4, h5, h6 { padding: 5px 10px; } h5, h6 { - color: black; text-decoration: underline; } diff --git a/src/doc/unstable-book/src/language-features/diagnostic-namespace.md b/src/doc/unstable-book/src/language-features/diagnostic-namespace.md deleted file mode 100644 index 7c46811a27a..00000000000 --- a/src/doc/unstable-book/src/language-features/diagnostic-namespace.md +++ /dev/null @@ -1,84 +0,0 @@ -# `diagnostic_namespace` - -The tracking issue for this feature is: [#111996] - -[#111996]: https://github.com/rust-lang/rust/issues/111996 - ------------------------- - -The `diagnostic_namespace` feature permits customization of compilation errors. - -## diagnostic::on_unimplemented - -With [#114452] support for `diagnostic::on_unimplemented` was added. - -When used on a trait declaration, the following options are available: - -* `message` to customize the primary error message -* `note` to add a customized note message to an error message -* `label` to customize the label part of the error message - -The attribute will hint to the compiler to use these in error messages: -```rust -// some library -#![feature(diagnostic_namespace)] - -#[diagnostic::on_unimplemented( - message = "cannot insert element", - label = "cannot be put into a table", - note = "see <link> for more information about the Table api" -)] -pub trait Element { - // ... -} -``` - -```rust,compile_fail,E0277 -# #![feature(diagnostic_namespace)] -# -# #[diagnostic::on_unimplemented( -# message = "cannot insert element", -# label = "cannot be put into a table", -# note = "see <link> for more information about the Table api" -# )] -# pub trait Element { -# // ... -# } -# struct Table; -# impl Table { -# fn insert<T: Element>(&self, element: T) { -# // .. -# } -# } -# fn main() { -# let table = Table; -# let element = (); -// user code -table.insert(element); -# } -``` - -```text -error[E0277]: cannot insert element - --> src/main.rs:24:18 - | -24 | table.insert(element); - | ------ ^^^^^^^ cannot be put into a table - | | - | required by a bound introduced by this call - | - = help: the trait `Element` is not implemented for `<type>` - = note: see <link> for more information about the Table api -note: required by a bound in `Table::insert` - --> src/main.rs:15:18 - | -15 | fn insert<T: Element>(&self, element: T) { - | ^^^^^^^ required by this bound in `Table::insert` - -For more information about this error, try `rustc --explain E0277`. -``` - -See [RFC 3368] for more information. - -[#114452]: https://github.com/rust-lang/rust/pull/114452 -[RFC 3368]: https://github.com/rust-lang/rfcs/blob/master/text/3368-diagnostic-attribute-namespace.md diff --git a/src/tools/opt-dist/src/utils/artifact_size.rs b/src/tools/opt-dist/src/utils/artifact_size.rs index 757f6d49709..b6c453fb40b 100644 --- a/src/tools/opt-dist/src/utils/artifact_size.rs +++ b/src/tools/opt-dist/src/utils/artifact_size.rs @@ -15,21 +15,8 @@ pub fn print_binary_sizes(env: &Environment) -> anyhow::Result<()> { let root = env.build_artifacts().join("stage2"); - let all_lib_files = get_files_from_dir(&root.join("lib"), None)?; - let mut files = get_files_from_dir(&root.join("bin"), None)?; - files.extend(get_files_from_dir(&root.join("lib"), Some(".so"))?); - - // libLLVM.so can be named libLLVM.so.<suffix>, so we try to explicitly add it here if it - // wasn't found by the above call. - if !files.iter().any(|f| f.file_name().unwrap_or_default().starts_with("libLLVM")) { - if let Some(llvm_lib) = - all_lib_files.iter().find(|f| f.file_name().unwrap_or_default().starts_with("libLLVM")) - { - files.push(llvm_lib.clone()); - } - } - + files.extend(get_files_from_dir(&root.join("lib"), None)?); files.sort_unstable(); let items: Vec<_> = files |
