From ae1259769c89daa76d3bcc35028b26c761091332 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 29 Mar 2022 14:53:28 -0500 Subject: [PATCH 1/5] Don't build the full compiler before running unit tests This has been present since `builder.ensure` was first added in https://github.com/rust-lang/rust/pull/43059. It's unclear to me why it was added then - I tested these changes locally with `x test compiler/rustc_data_structures --stage 0` and they worked fine. Fixes https://github.com/rust-lang/rust/issues/51748. --- src/bootstrap/test.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index c8b76809abad7..339b7a8d1e6fb 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1998,7 +1998,6 @@ impl Step for Crate { compile::std_cargo(builder, target, compiler.stage, &mut cargo); } Mode::Rustc => { - builder.ensure(compile::Rustc { compiler, target }); compile::rustc_cargo(builder, &mut cargo, target); } _ => panic!("can only test libraries"), From a4a9fff5947df86292a6a5700782aeaaa7a645ca Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 30 Mar 2022 14:30:46 +0200 Subject: [PATCH 2/5] Fix last rustdoc-gui spurious test --- src/test/rustdoc-gui/search-result-display.goml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/rustdoc-gui/search-result-display.goml b/src/test/rustdoc-gui/search-result-display.goml index 823ea67b1b055..ff792eced703a 100644 --- a/src/test/rustdoc-gui/search-result-display.goml +++ b/src/test/rustdoc-gui/search-result-display.goml @@ -2,8 +2,7 @@ goto: file://|DOC_PATH|/test_docs/index.html size: (900, 1000) write: (".search-input", "test") -// Waiting for the search results to appear... -wait-for: "#titles" +wait-for: "#search-settings" // The width is returned by "getComputedStyle" which returns the exact number instead of the // CSS rule which is "50%"... assert-css: (".search-results div.desc", {"width": "295px"}) From d65b9a19db62d18895f329a1ab6d5c0ff96fa960 Mon Sep 17 00:00:00 2001 From: InfRandomness Date: Wed, 30 Mar 2022 17:53:29 +0200 Subject: [PATCH 3/5] Add note to the lint diagnostic --- compiler/rustc_monomorphize/src/collector.rs | 1 + src/test/ui/async-await/large_moves.attribute.stderr | 7 +++++++ src/test/ui/async-await/large_moves.option.stderr | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 1477bc28cff44..3f6c24a769e72 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -859,6 +859,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { |lint| { let mut err = lint.build(&format!("moving {} bytes", layout.size.bytes())); err.span_label(source_info.span, "value moved from here"); + err.note(&format!(r#"The current maximum size is {}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`"#, limit.bytes())); err.emit(); }, ); diff --git a/src/test/ui/async-await/large_moves.attribute.stderr b/src/test/ui/async-await/large_moves.attribute.stderr index 39b7e7cb345bd..8d3f0b77f434d 100644 --- a/src/test/ui/async-await/large_moves.attribute.stderr +++ b/src/test/ui/async-await/large_moves.attribute.stderr @@ -15,24 +15,31 @@ note: the lint level is defined here | LL | #![deny(large_assignments)] | ^^^^^^^^^^^^^^^^^ + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: moving 10024 bytes --> $DIR/large_moves.rs:18:14 | LL | let z = (x, 42); | ^ value moved from here + | + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: moving 10024 bytes --> $DIR/large_moves.rs:18:13 | LL | let z = (x, 42); | ^^^^^^^ value moved from here + | + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: moving 10024 bytes --> $DIR/large_moves.rs:20:13 | LL | let a = z.0; | ^^^ value moved from here + | + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: aborting due to 4 previous errors diff --git a/src/test/ui/async-await/large_moves.option.stderr b/src/test/ui/async-await/large_moves.option.stderr index 39b7e7cb345bd..8d3f0b77f434d 100644 --- a/src/test/ui/async-await/large_moves.option.stderr +++ b/src/test/ui/async-await/large_moves.option.stderr @@ -15,24 +15,31 @@ note: the lint level is defined here | LL | #![deny(large_assignments)] | ^^^^^^^^^^^^^^^^^ + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: moving 10024 bytes --> $DIR/large_moves.rs:18:14 | LL | let z = (x, 42); | ^ value moved from here + | + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: moving 10024 bytes --> $DIR/large_moves.rs:18:13 | LL | let z = (x, 42); | ^^^^^^^ value moved from here + | + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: moving 10024 bytes --> $DIR/large_moves.rs:20:13 | LL | let a = z.0; | ^^^ value moved from here + | + = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` error: aborting due to 4 previous errors From 8c0a8f5f89725aae216e7d5646729ed021b93149 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 30 Mar 2022 21:13:15 +0200 Subject: [PATCH 4/5] Remove unneeded `to_string` call --- src/librustdoc/html/render/print_item.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 6c9a5a955d76e..1223b6c8002da 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -465,7 +465,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) -> fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::Function) { let header = it.fn_header(cx.tcx()).expect("printing a function which isn't a function"); let constness = print_constness_with_space(&header.constness, it.const_stability(cx.tcx())); - let unsafety = header.unsafety.print_with_space().to_string(); + let unsafety = header.unsafety.print_with_space(); let abi = print_abi_with_space(header.abi).to_string(); let asyncness = header.asyncness.print_with_space(); let visibility = it.visibility.print_with_space(it.def_id, cx).to_string(); From c89f11e1dbdbeb15057a3850e1a2348445caa4c2 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 30 Mar 2022 18:06:21 -0700 Subject: [PATCH 5/5] Fix library/std compilation on openbsd. Fix a minor typo from #95241 which prevented compilation on x86_64-unknown-openbsd. --- library/std/src/sys/unix/thread.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/unix/thread.rs index be70d00cb1ace..bb4e4ee9aa75b 100644 --- a/library/std/src/sys/unix/thread.rs +++ b/library/std/src/sys/unix/thread.rs @@ -522,7 +522,7 @@ pub mod guard { // new thread stack_ptr.addr() - current_stack.ss_size }; - Some(stack_ptr.with_addr(stack_addr)) + Some(stack_ptr.with_addr(stackaddr)) } #[cfg(any(