From 8a45eed31c90ca9f0795d1743c706222f990c975 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 19 Oct 2023 08:39:28 +0300 Subject: [PATCH 1/8] fix bootstrap paths in triagebot.toml Signed-off-by: onur-ozkan --- triagebot.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/triagebot.toml b/triagebot.toml index fbdc28787ff0a..893908eb7e3dc 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -23,10 +23,10 @@ allow-unauthenticated = [ "needs-triage", ] -[review-submitted] -# This label is added when a "request changes" review is submitted. -reviewed_label = "S-waiting-on-author" -# These labels are removed when a "request changes" review is submitted. +[review-submitted] +# This label is added when a "request changes" review is submitted. +reviewed_label = "S-waiting-on-author" +# These labels are removed when a "request changes" review is submitted. review_labels = ["S-waiting-on-review"] [review-requested] @@ -586,17 +586,17 @@ message = "`src/tools/x` was changed. Bump version of Cargo.toml in `src/tools/x message = "Third-party dependency whitelist may have been modified! You must ensure that any new dependencies have compatible licenses before merging." cc = ["@davidtwco", "@wesleywiser"] -[mentions."src/bootstrap/config.rs"] -message = "This PR changes `src/bootstrap/config.rs`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/lib.rs` and `change-id` in `config.example.toml`." +[mentions."src/bootstrap/src/core/config"] +message = "This PR modifies `src/bootstrap/src/core/config`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/src/lib.rs` and `change-id` in `config.example.toml`." [mentions."config.example.toml"] -message = "This PR changes `config.example.toml`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/lib.rs` and `change-id` in `config.example.toml`." +message = "This PR changes `config.example.toml`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/src/lib.rs` and `change-id` in `config.example.toml`." [mentions."src/bootstrap/defaults/config.compiler.toml"] message = "This PR changes src/bootstrap/defaults/config.compiler.toml. If appropriate, please also update `config.codegen.toml` so the defaults are in sync." [mentions."src/bootstrap/defaults/config.codegen.toml"] message = "This PR changes src/bootstrap/defaults/config.codegen.toml. If appropriate, please also update `config.compiler.toml` so the defaults are in sync." -[mentions."src/bootstrap/llvm.rs"] +[mentions."src/bootstrap/src/core/build_steps/llvm.rs"] message = "This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp." [mentions."tests/ui/deriving/deriving-all-codegen.stdout"] From 0c55576a06a948f7bad9249c63688caed080a79d Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 19 Oct 2023 08:39:55 +0300 Subject: [PATCH 2/8] trigger the triagebot for modifications to bootstrap/defaults Signed-off-by: onur-ozkan --- triagebot.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/triagebot.toml b/triagebot.toml index 893908eb7e3dc..e3c4233c843b8 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -588,6 +588,8 @@ cc = ["@davidtwco", "@wesleywiser"] [mentions."src/bootstrap/src/core/config"] message = "This PR modifies `src/bootstrap/src/core/config`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/src/lib.rs` and `change-id` in `config.example.toml`." +[mentions."src/bootstrap/defaults"] +message = "This PR modifies `src/bootstrap/defaults`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/src/lib.rs` and `change-id` in `config.example.toml`." [mentions."config.example.toml"] message = "This PR changes `config.example.toml`. If appropriate, please also update `CONFIG_CHANGE_HISTORY` in `src/bootstrap/src/lib.rs` and `change-id` in `config.example.toml`." From d7256a6a0d81a6c6cd182aab22e724f43e702a0c Mon Sep 17 00:00:00 2001 From: Claes Gill Date: Thu, 19 Oct 2023 22:32:11 +0200 Subject: [PATCH 3/8] Updated README with expandable table of content. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index f0c45f341d812..a88ee4b8bf061 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,20 @@ standard library, and documentation. If you wish to _contribute_ to the compiler, you should read [CONTRIBUTING.md](CONTRIBUTING.md) instead. +
+Table of content + +- [Quick Start](#quick-start) +- [Installing from Source](#installing-from-source) +- [Building Documentation](#building-documentation) +- [Notes](#notes) +- [Getting Help](#getting-help) +- [Contributing](#contributing) +- [License](#license) +- [Trademark](#trademark) + +
+ ## Quick Start Read ["Installation"] from [The Book]. From 63790138761f3c77389df5521dd2f40ee0be2982 Mon Sep 17 00:00:00 2001 From: Caio Date: Thu, 19 Oct 2023 20:18:51 -0300 Subject: [PATCH 4/8] Initiate the inner usage of `cfg_match` --- Cargo.lock | 2 -- compiler/rustc_data_structures/Cargo.toml | 1 - compiler/rustc_data_structures/src/flock.rs | 13 +++++--- compiler/rustc_data_structures/src/lib.rs | 33 ++++++++++--------- compiler/rustc_data_structures/src/marker.rs | 31 ++++++++--------- .../rustc_data_structures/src/profiling.rs | 13 +++++--- compiler/rustc_data_structures/src/sync.rs | 7 ++-- compiler/rustc_span/Cargo.toml | 1 - .../rustc_span/src/analyze_source_file.rs | 8 ++--- compiler/rustc_span/src/lib.rs | 21 +++++++----- 10 files changed, 66 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa2f9c4147e3b..55d6146395f9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3664,7 +3664,6 @@ version = "0.0.0" dependencies = [ "arrayvec", "bitflags 1.3.2", - "cfg-if", "elsa", "ena", "indexmap 2.0.0", @@ -4496,7 +4495,6 @@ dependencies = [ name = "rustc_span" version = "0.0.0" dependencies = [ - "cfg-if", "indexmap 2.0.0", "md-5", "rustc_arena", diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index f77bd53e76c6a..dce4e199e17ea 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -8,7 +8,6 @@ edition = "2021" [dependencies] arrayvec = { version = "0.7", default-features = false } bitflags = "1.2.1" -cfg-if = "1.0" ena = "0.14.2" indexmap = { version = "2.0.0" } jobserver_crate = { version = "0.1.13", package = "jobserver" } diff --git a/compiler/rustc_data_structures/src/flock.rs b/compiler/rustc_data_structures/src/flock.rs index efdb44248d1d7..008565e4c7b97 100644 --- a/compiler/rustc_data_structures/src/flock.rs +++ b/compiler/rustc_data_structures/src/flock.rs @@ -4,17 +4,20 @@ //! green/native threading. This is just a bare-bones enough solution for //! librustdoc, it is not production quality at all. -cfg_if! { - if #[cfg(target_os = "linux")] { +cfg_match! { + cfg(target_os = "linux") => { mod linux; use linux as imp; - } else if #[cfg(unix)] { + } + cfg(unix) => { mod unix; use unix as imp; - } else if #[cfg(windows)] { + } + cfg(windows) => { mod windows; use self::windows as imp; - } else { + } + _ => { mod unsupported; use unsupported as imp; } diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 9511f1700e10c..5d7f385c6e4a6 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -6,43 +6,44 @@ //! //! This API is completely unstable and subject to change. +// tidy-alphabetical-start +#![allow(internal_features)] +#![allow(rustc::default_hash_types)] +#![allow(rustc::potential_query_instability)] #![cfg_attr(not(bootstrap), doc(rust_logo))] #![cfg_attr(not(bootstrap), feature(rustdoc_internals))] +#![deny(rustc::diagnostic_outside_of_impl)] +#![deny(rustc::untranslatable_diagnostic)] +#![deny(unsafe_op_in_unsafe_fn)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +#![feature(allocator_api)] #![feature(array_windows)] #![feature(auto_traits)] #![feature(cell_leak)] +#![feature(cfg_match)] #![feature(core_intrinsics)] #![feature(extend_one)] #![feature(hash_raw_entry)] #![feature(hasher_prefixfree_extras)] +#![feature(lazy_cell)] +#![feature(lint_reasons)] +#![feature(macro_metavar_expr)] #![feature(maybe_uninit_uninit_array)] #![feature(min_specialization)] +#![feature(negative_impls)] #![feature(never_type)] -#![feature(type_alias_impl_trait)] -#![feature(lazy_cell)] +#![feature(ptr_alignment_type)] #![feature(rustc_attrs)] -#![feature(negative_impls)] +#![feature(strict_provenance)] #![feature(test)] #![feature(thread_id_value)] -#![feature(allocator_api)] -#![feature(lint_reasons)] +#![feature(type_alias_impl_trait)] #![feature(unwrap_infallible)] -#![feature(strict_provenance)] -#![feature(ptr_alignment_type)] -#![feature(macro_metavar_expr)] -#![allow(rustc::default_hash_types)] -#![allow(rustc::potential_query_instability)] -#![deny(rustc::untranslatable_diagnostic)] -#![deny(rustc::diagnostic_outside_of_impl)] -#![allow(internal_features)] -#![deny(unsafe_op_in_unsafe_fn)] +// tidy-alphabetical-end #[macro_use] extern crate tracing; #[macro_use] -extern crate cfg_if; -#[macro_use] extern crate rustc_macros; use std::fmt; diff --git a/compiler/rustc_data_structures/src/marker.rs b/compiler/rustc_data_structures/src/marker.rs index b067f9d4502df..a8c442377fbc2 100644 --- a/compiler/rustc_data_structures/src/marker.rs +++ b/compiler/rustc_data_structures/src/marker.rs @@ -1,11 +1,12 @@ -cfg_if!( - if #[cfg(not(parallel_compiler))] { +cfg_match! { + cfg(not(parallel_compiler)) => { pub auto trait DynSend {} pub auto trait DynSync {} impl DynSend for T {} impl DynSync for T {} - } else { + } + _ => { #[rustc_on_unimplemented( message = "`{Self}` doesn't implement `DynSend`. \ Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Send`" @@ -48,13 +49,10 @@ cfg_if!( [std::io::StdoutLock<'_>] [std::io::StderrLock<'_>] ); - cfg_if!( - // Consistent with `std` - // `os_imp::Env` is `!Send` in these platforms - if #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] { - impl !DynSend for std::env::VarsOs {} - } - ); + + #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] + // Consistent with `std`, `os_imp::Env` is `!Sync` in these platforms + impl !DynSend for std::env::VarsOs {} macro_rules! already_send { ($([$ty: ty])*) => { @@ -123,13 +121,10 @@ cfg_if!( [std::sync::mpsc::Receiver where T] [std::sync::mpsc::Sender where T] ); - cfg_if!( - // Consistent with `std` - // `os_imp::Env` is `!Sync` in these platforms - if #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] { - impl !DynSync for std::env::VarsOs {} - } - ); + + #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] + // Consistent with `std`, `os_imp::Env` is `!Sync` in these platforms + impl !DynSync for std::env::VarsOs {} macro_rules! already_sync { ($([$ty: ty])*) => { @@ -183,7 +178,7 @@ cfg_if!( [thin_vec::ThinVec where T: DynSync] ); } -); +} pub fn assert_dyn_sync() {} pub fn assert_dyn_send() {} diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index e688feb5fe176..ef7375a732064 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -859,8 +859,8 @@ fn get_thread_id() -> u32 { } // Memory reporting -cfg_if! { - if #[cfg(windows)] { +cfg_match! { + cfg(windows) => { pub fn get_resident_set_size() -> Option { use std::mem; @@ -885,7 +885,8 @@ cfg_if! { Some(pmc.WorkingSetSize) } - } else if #[cfg(target_os = "macos")] { + } + cfg(target_os = "macos") => { pub fn get_resident_set_size() -> Option { use libc::{c_int, c_void, getpid, proc_pidinfo, proc_taskinfo, PROC_PIDTASKINFO}; use std::mem; @@ -903,7 +904,8 @@ cfg_if! { } } } - } else if #[cfg(unix)] { + } + cfg(unix) => { pub fn get_resident_set_size() -> Option { let field = 1; let contents = fs::read("/proc/self/statm").ok()?; @@ -912,7 +914,8 @@ cfg_if! { let npages = s.parse::().ok()?; Some(npages * 4096) } - } else { + } + _ => { pub fn get_resident_set_size() -> Option { None } diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index cca043ba0d18d..62fff604f8133 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -109,8 +109,8 @@ mod mode { pub use mode::{is_dyn_thread_safe, set_dyn_thread_safe_mode}; -cfg_if! { - if #[cfg(not(parallel_compiler))] { +cfg_match! { + cfg(not(parallel_compiler)) => { use std::ops::Add; use std::cell::Cell; @@ -251,7 +251,8 @@ cfg_if! { MTLock(self.0.clone()) } } - } else { + } + _ => { pub use std::marker::Send as Send; pub use std::marker::Sync as Sync; diff --git a/compiler/rustc_span/Cargo.toml b/compiler/rustc_span/Cargo.toml index ee93f74e750df..31c2a56faa539 100644 --- a/compiler/rustc_span/Cargo.toml +++ b/compiler/rustc_span/Cargo.toml @@ -13,7 +13,6 @@ rustc_index = { path = "../rustc_index" } rustc_arena = { path = "../rustc_arena" } scoped-tls = "1.0" unicode-width = "0.1.4" -cfg-if = "1.0" tracing = "0.1" sha1 = "0.10.0" sha2 = "0.10.1" diff --git a/compiler/rustc_span/src/analyze_source_file.rs b/compiler/rustc_span/src/analyze_source_file.rs index 450d5455ff938..7da7dc610ecf1 100644 --- a/compiler/rustc_span/src/analyze_source_file.rs +++ b/compiler/rustc_span/src/analyze_source_file.rs @@ -33,8 +33,8 @@ pub fn analyze_source_file( (lines, multi_byte_chars, non_narrow_chars) } -cfg_if::cfg_if! { - if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { +cfg_match! { + cfg(any(target_arch = "x86", target_arch = "x86_64")) => { fn analyze_source_file_dispatch(src: &str, lines: &mut Vec, multi_byte_chars: &mut Vec, @@ -172,8 +172,8 @@ cfg_if::cfg_if! { non_narrow_chars); } } - } else { - + } + _ => { // The target (or compiler version) does not support SSE2 ... fn analyze_source_file_dispatch(src: &str, lines: &mut Vec, diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index e62efab5793f2..661dfa64d33fc 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -13,21 +13,24 @@ //! //! This API is completely unstable and subject to change. -#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] +// tidy-alphabetical-start +#![allow(internal_features)] #![cfg_attr(not(bootstrap), doc(rust_logo))] #![cfg_attr(not(bootstrap), feature(rustdoc_internals))] +#![deny(rustc::diagnostic_outside_of_impl)] +#![deny(rustc::untranslatable_diagnostic)] +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(array_windows)] +#![feature(cfg_match)] #![feature(if_let_guard)] -#![feature(negative_impls)] -#![feature(min_specialization)] -#![feature(rustc_attrs)] #![feature(let_chains)] -#![feature(round_char_boundary)] -#![feature(read_buf)] +#![feature(min_specialization)] +#![feature(negative_impls)] #![feature(new_uninit)] -#![deny(rustc::untranslatable_diagnostic)] -#![deny(rustc::diagnostic_outside_of_impl)] -#![allow(internal_features)] +#![feature(read_buf)] +#![feature(round_char_boundary)] +#![feature(rustc_attrs)] +// tidy-alphabetical-end #[macro_use] extern crate rustc_macros; From 31daed1b64352348498302154740eb64c485047a Mon Sep 17 00:00:00 2001 From: dirreke Date: Sat, 21 Oct 2023 23:42:09 +0800 Subject: [PATCH 5/8] update the registers of csky --- compiler/rustc_target/src/asm/csky.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_target/src/asm/csky.rs b/compiler/rustc_target/src/asm/csky.rs index 6f0e7f7994959..db3d8106040b6 100644 --- a/compiler/rustc_target/src/asm/csky.rs +++ b/compiler/rustc_target/src/asm/csky.rs @@ -64,9 +64,9 @@ def_regs! { r20: reg = ["r20","t4"],// feature high-register r21: reg = ["r21","t5"],// feature high-register r22: reg = ["r22","t6"],// feature high-register - r23: reg = ["r23","t7", "fp"],// feature high-register - r24: reg = ["r24","t8", "sop"],// feature high-register - r25: reg = ["r25","t9","tp", "bsp"],// feature high-register + r23: reg = ["r23","t7"],// feature high-register + r24: reg = ["r24","t8"],// feature high-register + r25: reg = ["r25","t9"],// feature high-register f0: freg = ["fr0","vr0"], f1: freg = ["fr1","vr1"], f2: freg = ["fr2","vr2"], From 2cca4357173901107770472a24f211cff3f47ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Fri, 20 Oct 2023 20:03:44 +0000 Subject: [PATCH 6/8] Mention the syntax for `use` on `mod foo;` if `foo` doesn't exist Newcomers might get confused that `mod` is the only way of defining scopes, and that it can be used as if it were `use`. Fix #69492. --- compiler/rustc_expand/messages.ftl | 1 + compiler/rustc_expand/src/errors.rs | 1 + tests/run-make/unknown-mod-stdin/unknown-mod.stderr | 1 + tests/ui/error-codes/E0583.stderr | 1 + .../invalid-module-declaration.stderr | 1 + tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr | 1 + .../missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr | 1 + tests/ui/modules/special_module_name.stderr | 2 ++ tests/ui/parser/mod_file_not_exist.stderr | 1 + tests/ui/parser/mod_file_not_exist_windows.stderr | 1 + tests/ui/parser/unsafe-mod.stderr | 1 + .../mod_file_nonascii_forbidden.stderr | 1 + 12 files changed, 13 insertions(+) diff --git a/compiler/rustc_expand/messages.ftl b/compiler/rustc_expand/messages.ftl index 6c7e68246ea5f..8b93829623dbf 100644 --- a/compiler/rustc_expand/messages.ftl +++ b/compiler/rustc_expand/messages.ftl @@ -86,6 +86,7 @@ expand_module_circular = expand_module_file_not_found = file not found for module `{$name}` .help = to create the module `{$name}`, create file "{$default_path}" or "{$secondary_path}" + .note = if there is a `mod {$name}` elsewhere in the crate already, import it with `use crate::...` instead expand_module_in_block = cannot declare a non-inline module inside a block unless it has a path attribute diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index e3a0ae3570eb0..d86632c47fc5d 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -350,6 +350,7 @@ pub(crate) struct ModuleInBlockName { #[derive(Diagnostic)] #[diag(expand_module_file_not_found, code = "E0583")] #[help] +#[note] pub(crate) struct ModuleFileNotFound { #[primary_span] pub span: Span, diff --git a/tests/run-make/unknown-mod-stdin/unknown-mod.stderr b/tests/run-make/unknown-mod-stdin/unknown-mod.stderr index d7258fe4f68d8..81ff83938378c 100644 --- a/tests/run-make/unknown-mod-stdin/unknown-mod.stderr +++ b/tests/run-make/unknown-mod-stdin/unknown-mod.stderr @@ -5,6 +5,7 @@ error[E0583]: file not found for module `unknown` | ^^^^^^^^^^^^ | = help: to create the module `unknown`, create file "unknown.rs" or "unknown/mod.rs" + = note: if there is a `mod unknown` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to previous error diff --git a/tests/ui/error-codes/E0583.stderr b/tests/ui/error-codes/E0583.stderr index c7bbbf114997d..6707f2864f23c 100644 --- a/tests/ui/error-codes/E0583.stderr +++ b/tests/ui/error-codes/E0583.stderr @@ -5,6 +5,7 @@ LL | mod module_that_doesnt_exist; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: to create the module `module_that_doesnt_exist`, create file "$DIR/module_that_doesnt_exist.rs" or "$DIR/module_that_doesnt_exist/mod.rs" + = note: if there is a `mod module_that_doesnt_exist` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to previous error diff --git a/tests/ui/invalid-module-declaration/invalid-module-declaration.stderr b/tests/ui/invalid-module-declaration/invalid-module-declaration.stderr index 7bc8efd7e4a97..08aec25928c0d 100644 --- a/tests/ui/invalid-module-declaration/invalid-module-declaration.stderr +++ b/tests/ui/invalid-module-declaration/invalid-module-declaration.stderr @@ -5,6 +5,7 @@ LL | pub mod baz; | ^^^^^^^^^^^^ | = help: to create the module `baz`, create file "$DIR/auxiliary/foo/bar/baz.rs" or "$DIR/auxiliary/foo/bar/baz/mod.rs" + = note: if there is a `mod baz` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to previous error diff --git a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr b/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr index 31e4206a5463a..5f4d19439accd 100644 --- a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr +++ b/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr @@ -5,6 +5,7 @@ LL | mod missing; | ^^^^^^^^^^^^ | = help: to create the module `missing`, create file "$DIR/foo/missing.rs" or "$DIR/foo/missing/mod.rs" + = note: if there is a `mod missing` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to previous error diff --git a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr b/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr index 9d252398b7a14..d5f5ea8705971 100644 --- a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr +++ b/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr @@ -5,6 +5,7 @@ LL | mod missing; | ^^^^^^^^^^^^ | = help: to create the module `missing`, create file "$DIR/foo_inline/inline/missing.rs" or "$DIR/foo_inline/inline/missing/mod.rs" + = note: if there is a `mod missing` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to previous error diff --git a/tests/ui/modules/special_module_name.stderr b/tests/ui/modules/special_module_name.stderr index bc4b4f1b3181c..84473bf8c0bc6 100644 --- a/tests/ui/modules/special_module_name.stderr +++ b/tests/ui/modules/special_module_name.stderr @@ -5,6 +5,7 @@ LL | mod lib; | ^^^^^^^^ | = help: to create the module `lib`, create file "$DIR/lib.rs" or "$DIR/lib/mod.rs" + = note: if there is a `mod lib` elsewhere in the crate already, import it with `use crate::...` instead error[E0583]: file not found for module `main` --> $DIR/special_module_name.rs:4:1 @@ -13,6 +14,7 @@ LL | mod main; | ^^^^^^^^^ | = help: to create the module `main`, create file "$DIR/main.rs" or "$DIR/main/mod.rs" + = note: if there is a `mod main` elsewhere in the crate already, import it with `use crate::...` instead warning: found module declaration for lib.rs --> $DIR/special_module_name.rs:1:1 diff --git a/tests/ui/parser/mod_file_not_exist.stderr b/tests/ui/parser/mod_file_not_exist.stderr index 62456d518804f..c2f9d30d9ec40 100644 --- a/tests/ui/parser/mod_file_not_exist.stderr +++ b/tests/ui/parser/mod_file_not_exist.stderr @@ -5,6 +5,7 @@ LL | mod not_a_real_file; | ^^^^^^^^^^^^^^^^^^^^ | = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" + = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` --> $DIR/mod_file_not_exist.rs:7:16 diff --git a/tests/ui/parser/mod_file_not_exist_windows.stderr b/tests/ui/parser/mod_file_not_exist_windows.stderr index d5143dbe982ae..53b09d8ca53a0 100644 --- a/tests/ui/parser/mod_file_not_exist_windows.stderr +++ b/tests/ui/parser/mod_file_not_exist_windows.stderr @@ -5,6 +5,7 @@ LL | mod not_a_real_file; | ^^^^^^^^^^^^^^^^^^^^ | = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" + = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux` --> $DIR/mod_file_not_exist_windows.rs:7:16 diff --git a/tests/ui/parser/unsafe-mod.stderr b/tests/ui/parser/unsafe-mod.stderr index dac6e7a355056..fbe24aa10da42 100644 --- a/tests/ui/parser/unsafe-mod.stderr +++ b/tests/ui/parser/unsafe-mod.stderr @@ -5,6 +5,7 @@ LL | unsafe mod n; | ^^^^^^^^^^^^^ | = help: to create the module `n`, create file "$DIR/n.rs" or "$DIR/n/mod.rs" + = note: if there is a `mod n` elsewhere in the crate already, import it with `use crate::...` instead error: module cannot be declared unsafe --> $DIR/unsafe-mod.rs:1:1 diff --git a/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr index 7639ae9f6a4fd..8ca6a37c62518 100644 --- a/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr +++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr @@ -5,6 +5,7 @@ LL | mod řųśť; | ^^^^^^^^^ | = help: to create the module `řųśť`, create file "$DIR/řųśť.rs" or "$DIR/řųśť/mod.rs" + = note: if there is a `mod řųśť` elsewhere in the crate already, import it with `use crate::...` instead error[E0754]: trying to load file for module `řųśť` with non-ascii identifier name --> $DIR/mod_file_nonascii_forbidden.rs:1:5 From af871808459c84ba9e39aff0fb75a632cd8fb927 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sat, 21 Oct 2023 10:53:35 -0700 Subject: [PATCH 7/8] fix broken link to ayu theme in the rustdoc book --- src/doc/rustdoc/src/write-documentation/what-to-include.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustdoc/src/write-documentation/what-to-include.md b/src/doc/rustdoc/src/write-documentation/what-to-include.md index 16457ed0ff826..4bcae4d222c79 100644 --- a/src/doc/rustdoc/src/write-documentation/what-to-include.md +++ b/src/doc/rustdoc/src/write-documentation/what-to-include.md @@ -117,7 +117,7 @@ rustdoc --theme awesome.css src/lib.rs Here is an example of a new theme, [Ayu]. -[Ayu]: https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/static/css/themes/ayu.css +[Ayu]: https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/static/css/rustdoc.css#L2384-L2574 [API Guidelines]: https://rust-lang.github.io/api-guidelines/documentation.html#rustdoc-does-not-show-unhelpful-implementation-details-c-hidden [Documentation tests]: documentation-tests.md [on this blog]: https://blog.guillaume-gomez.fr/articles/2016-09-16+Generating+doc+with+rustdoc+and+a+custom+theme From 695beca219e795cae47dfeddb836c234ebadd551 Mon Sep 17 00:00:00 2001 From: Gimbles Date: Sat, 21 Oct 2023 23:41:32 +0530 Subject: [PATCH 8/8] Update boxed.rs --- library/alloc/src/boxed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 8ab851a0ea640..4a62013c685f8 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -207,7 +207,7 @@ impl Box { /// ``` /// let five = Box::new(5); /// ``` - #[cfg(all(not(no_global_oom_handling)))] + #[cfg(not(no_global_oom_handling))] #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[must_use]