From d280b8ca14edea616af39f0f0642f1aeb6714243 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Mon, 29 Jul 2024 00:51:33 +0200 Subject: CI: rfl: build the generated doctests We were already generating the doctests, which should already catch most issues with our hack around `--test-builder` and `--no-run`. However, we were not building the result of that transformation, thus build it for completeness and to ensure the hack may not have produced something completely broken. In the worst case, we can revert it. Signed-off-by: Miguel Ojeda --- src/ci/docker/scripts/rfl-build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ci/docker/scripts/rfl-build.sh b/src/ci/docker/scripts/rfl-build.sh index 3acc09e0b9b..4e3079b35ca 100755 --- a/src/ci/docker/scripts/rfl-build.sh +++ b/src/ci/docker/scripts/rfl-build.sh @@ -65,4 +65,5 @@ make -C linux LLVM=1 -j$(($(nproc) + 1)) \ make -C linux LLVM=1 -j$(($(nproc) + 1)) \ samples/rust/rust_minimal.o \ samples/rust/rust_print.o \ - drivers/net/phy/ax88796b_rust.o + drivers/net/phy/ax88796b_rust.o \ + rust/doctests_kernel_generated.o -- cgit 1.4.1-3-g733a5 From 77cc18fd79073beada6dcd1e392be7996683503d Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Mon, 29 Jul 2024 23:03:26 +0200 Subject: CI: rfl: build the documentation Since the `rfl` CI job has not had almost any issue for some weeks, it is a good time to try to increase a bit the scope of what it tests. The kernel does not use any particular `rustdoc` unstable issue (apart from the doctests ones) so far, so in principle it should not introduce extra issues here, and may be a good extra test case for Rust. In addition, it may help to test new unstable features in the future. In the worst case, we can revert it. Signed-off-by: Miguel Ojeda --- src/ci/docker/scripts/rfl-build.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ci/docker/scripts/rfl-build.sh b/src/ci/docker/scripts/rfl-build.sh index 4e3079b35ca..d690aac27fa 100755 --- a/src/ci/docker/scripts/rfl-build.sh +++ b/src/ci/docker/scripts/rfl-build.sh @@ -67,3 +67,6 @@ make -C linux LLVM=1 -j$(($(nproc) + 1)) \ samples/rust/rust_print.o \ drivers/net/phy/ax88796b_rust.o \ rust/doctests_kernel_generated.o + +make -C linux LLVM=1 -j$(($(nproc) + 1)) \ + rustdoc -- cgit 1.4.1-3-g733a5 From cc7e7bc0964ed29963bb3c455f2b89c9e06c5a87 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 30 Jul 2024 12:12:41 +0200 Subject: cargo-miri: better error when we seem to run inside bootstrap but something is wrong --- src/tools/miri/cargo-miri/src/setup.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/miri/cargo-miri/src/setup.rs b/src/tools/miri/cargo-miri/src/setup.rs index fe67aad465c..0cf6f1a375c 100644 --- a/src/tools/miri/cargo-miri/src/setup.rs +++ b/src/tools/miri/cargo-miri/src/setup.rs @@ -100,7 +100,10 @@ pub fn setup( // for target crates. let cargo_miri_path = std::env::current_exe().expect("current executable path invalid"); if env::var_os("RUSTC_STAGE").is_some() { - assert!(env::var_os("RUSTC").is_some()); + assert!( + env::var_os("RUSTC").is_some() && env::var_os("RUSTC_WRAPPER").is_some(), + "cargo-miri setup is running inside rustc bootstrap but RUSTC or RUST_WRAPPER is not set" + ); command.env("RUSTC_REAL", &cargo_miri_path); } else { command.env("RUSTC", &cargo_miri_path); -- cgit 1.4.1-3-g733a5 From 4776ac0f885044685c6f6127632f42522a88c05d Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 30 Jul 2024 10:10:36 -0400 Subject: Suppress must_use on eat calls in rustfmt --- src/tools/rustfmt/src/parse/macros/lazy_static.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/tools/rustfmt/src/parse/macros/lazy_static.rs b/src/tools/rustfmt/src/parse/macros/lazy_static.rs index 7baac247e22..b6de5f8691c 100644 --- a/src/tools/rustfmt/src/parse/macros/lazy_static.rs +++ b/src/tools/rustfmt/src/parse/macros/lazy_static.rs @@ -33,15 +33,17 @@ pub(crate) fn parse_lazy_static( } while parser.token.kind != TokenKind::Eof { // Parse a `lazy_static!` item. + // FIXME: These `eat_*` calls should be converted to `parse_or` to avoid + // silently formatting malformed lazy-statics. let vis = parse_or!(parse_visibility, rustc_parse::parser::FollowedByType::No); - parser.eat_keyword(kw::Static); - parser.eat_keyword(kw::Ref); + let _ = parser.eat_keyword(kw::Static); + let _ = parser.eat_keyword(kw::Ref); let id = parse_or!(parse_ident); - parser.eat(&TokenKind::Colon); + let _ = parser.eat(&TokenKind::Colon); let ty = parse_or!(parse_ty); - parser.eat(&TokenKind::Eq); + let _ = parser.eat(&TokenKind::Eq); let expr = parse_or!(parse_expr); - parser.eat(&TokenKind::Semi); + let _ = parser.eat(&TokenKind::Semi); result.push((vis, id, ty, expr)); } -- cgit 1.4.1-3-g733a5 From b1b48dc58480cc6c36ba88f842144a8190aa589c Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 30 Jul 2024 09:35:12 -0500 Subject: tidy: Fix quote in error message --- src/tools/tidy/src/error_codes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/tidy/src/error_codes.rs b/src/tools/tidy/src/error_codes.rs index 8ddacc07c6f..e2d1b85797f 100644 --- a/src/tools/tidy/src/error_codes.rs +++ b/src/tools/tidy/src/error_codes.rs @@ -319,7 +319,7 @@ fn check_error_codes_tests( if !found_code { verbose_print!( verbose, - "warning: Error code {code}`` has a UI test file, but doesn't contain its own error code!" + "warning: Error code `{code}` has a UI test file, but doesn't contain its own error code!" ); } } -- cgit 1.4.1-3-g733a5