From e4250a014e57fd4e4c49b968f9104cb784157c34 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Sun, 2 May 2021 16:15:27 -0400 Subject: [PATCH 1/7] Add link to Issue #34202 in udp docs Signed-off-by: wcampbell --- library/std/src/net/udp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs index b9af5992dffdf..18297139b7bb6 100644 --- a/library/std/src/net/udp.rs +++ b/library/std/src/net/udp.rs @@ -159,7 +159,7 @@ impl UdpSocket { /// This will return an error when the IP version of the local socket /// does not match that returned from [`ToSocketAddrs`]. /// - /// See issue #34202 for more details. + /// See [Issue #34202] for more details. /// /// # Examples /// @@ -169,6 +169,8 @@ impl UdpSocket { /// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address"); /// socket.send_to(&[0; 10], "127.0.0.1:4242").expect("couldn't send data"); /// ``` + /// + /// [Issue #34202]: https://github.com/rust-lang/rust/issues/34202 #[stable(feature = "rust1", since = "1.0.0")] pub fn send_to(&self, buf: &[u8], addr: A) -> io::Result { match addr.to_socket_addrs()?.next() { From 8db7973f1952ab07c0ceb83cfb134f9bda518552 Mon Sep 17 00:00:00 2001 From: mautamu Date: Mon, 3 May 2021 02:14:56 -0500 Subject: [PATCH 2/7] Change librustdoc write(.. \n) to writeln(..); fix comment in grammar More grammar --- src/librustdoc/html/highlight.rs | 4 ++-- src/librustdoc/html/render/mod.rs | 2 +- src/librustdoc/html/sources.rs | 2 +- src/librustdoc/theme.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 0030ef67c075d..7130a6bc1e888 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -46,7 +46,7 @@ crate fn render_with_highlighting( } fn write_header(out: &mut Buffer, class: Option<&str>) { - write!(out, "
\n", class.unwrap_or_default());
+    writeln!(out, "
", class.unwrap_or_default());
 }
 
 fn write_code(out: &mut Buffer, src: &str, edition: Edition) {
@@ -62,7 +62,7 @@ fn write_code(out: &mut Buffer, src: &str, edition: Edition) {
 }
 
 fn write_footer(out: &mut Buffer, playground_button: Option<&str>) {
-    write!(out, "
{}
\n", playground_button.unwrap_or_default()); + writeln!(out, "
{}
", playground_button.unwrap_or_default()); } /// How a span of text is classified. Mostly corresponds to token kinds. diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 811c423338602..1271b54debd16 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -964,7 +964,7 @@ fn attributes(it: &clean::Item) -> Vec { // a whitespace prefix and newline. fn render_attributes_in_pre(w: &mut Buffer, it: &clean::Item, prefix: &str) { for a in attributes(it) { - write!(w, "{}{}\n", prefix, a); + writeln!(w, "{}{}", prefix, a); } } diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs index 3d4d8df0a7198..14e2d65d94ef8 100644 --- a/src/librustdoc/html/sources.rs +++ b/src/librustdoc/html/sources.rs @@ -177,7 +177,7 @@ fn print_src(buf: &mut Buffer, s: &str, edition: Edition) { } buf.write_str("
");
     for i in 1..=lines {
-        write!(buf, "{0:1$}\n", i, cols);
+        writeln!(buf, "{0:1$}", i, cols);
     }
     buf.write_str("
"); highlight::render_with_highlighting(s, buf, None, None, None, edition); diff --git a/src/librustdoc/theme.rs b/src/librustdoc/theme.rs index 24d5770541273..b8b3f9634e582 100644 --- a/src/librustdoc/theme.rs +++ b/src/librustdoc/theme.rs @@ -17,7 +17,7 @@ crate struct CssPath { // This PartialEq implementation IS NOT COMMUTATIVE!!! // // The order is very important: the second object must have all first's rules. -// However, the first doesn't require to have all second's rules. +// However, the first is not required to have all of the second's rules. impl PartialEq for CssPath { fn eq(&self, other: &CssPath) -> bool { if self.name != other.name { From f758eb664e99d84e77a3a2c8155243a82a9eb4dc Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Mon, 3 May 2021 16:02:54 +0800 Subject: [PATCH 3/7] use double quotes for E0761 --- compiler/rustc_expand/src/module.rs | 2 +- .../ui/modules_and_files_visibility/mod_file_disambig.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_expand/src/module.rs b/compiler/rustc_expand/src/module.rs index c5ce0baaa8f6a..fd25b8f0440ca 100644 --- a/compiler/rustc_expand/src/module.rs +++ b/compiler/rustc_expand/src/module.rs @@ -269,7 +269,7 @@ impl ModError<'_> { diag, span, E0761, - "file for module `{}` found at both {} and {}", + "file for module `{}` found at both \"{}\" and \"{}\"", ident, default_path_short, secondary_path_short, diff --git a/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr b/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr index 3a3d2e2ddddb3..804947d38d9ca 100644 --- a/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr +++ b/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr @@ -1,4 +1,4 @@ -error[E0761]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs +error[E0761]: file for module `mod_file_disambig_aux` found at both "mod_file_disambig_aux.rs" and "mod_file_disambig_aux/mod.rs" --> $DIR/mod_file_disambig.rs:1:1 | LL | mod mod_file_disambig_aux; From 2247d46b117e60f8eba258372574e212a09432a9 Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 3 May 2021 10:28:19 +0100 Subject: [PATCH 4/7] Correct stability of ErrorKind::OutOfMemory --- library/std/src/io/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index ae896d1240ea5..56e6f08268ca3 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -189,7 +189,7 @@ pub enum ErrorKind { /// An operation could not be completed, because it failed /// to allocate enough memory. - #[stable(feature = "out_of_memory_error", since = "1.53.0")] + #[stable(feature = "out_of_memory_error", since = "1.54.0")] OutOfMemory, } From 461f52071d8065dbb7c57189e181dc1f72e8b10f Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Mon, 3 May 2021 18:57:48 +0800 Subject: [PATCH 5/7] use full path for E0761 --- compiler/rustc_expand/src/module.rs | 12 +++++------- .../mod_file_disambig.stderr | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_expand/src/module.rs b/compiler/rustc_expand/src/module.rs index fd25b8f0440ca..993522d01d867 100644 --- a/compiler/rustc_expand/src/module.rs +++ b/compiler/rustc_expand/src/module.rs @@ -37,7 +37,7 @@ pub enum ModError<'a> { CircularInclusion(Vec), ModInBlock(Option), FileNotFound(Ident, PathBuf), - MultipleCandidates(Ident, String, String), + MultipleCandidates(Ident, PathBuf, PathBuf), ParserError(DiagnosticBuilder<'a>), } @@ -220,9 +220,7 @@ pub fn default_submod_path<'a>( dir_ownership: DirOwnership::Owned { relative: None }, }), (false, false) => Err(ModError::FileNotFound(ident, default_path)), - (true, true) => { - Err(ModError::MultipleCandidates(ident, default_path_str, secondary_path_str)) - } + (true, true) => Err(ModError::MultipleCandidates(ident, default_path, secondary_path)), } } @@ -264,15 +262,15 @@ impl ModError<'_> { )); err } - ModError::MultipleCandidates(ident, default_path_short, secondary_path_short) => { + ModError::MultipleCandidates(ident, default_path, secondary_path) => { let mut err = struct_span_err!( diag, span, E0761, "file for module `{}` found at both \"{}\" and \"{}\"", ident, - default_path_short, - secondary_path_short, + default_path.display(), + secondary_path.display(), ); err.help("delete or rename one of them to remove the ambiguity"); err diff --git a/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr b/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr index 804947d38d9ca..a2c99396987ef 100644 --- a/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr +++ b/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr @@ -1,4 +1,4 @@ -error[E0761]: file for module `mod_file_disambig_aux` found at both "mod_file_disambig_aux.rs" and "mod_file_disambig_aux/mod.rs" +error[E0761]: file for module `mod_file_disambig_aux` found at both "$DIR/mod_file_disambig_aux.rs" and "$DIR/mod_file_disambig_aux/mod.rs" --> $DIR/mod_file_disambig.rs:1:1 | LL | mod mod_file_disambig_aux; From eb9f168e1e8a447e24b2cda2a57d7ba05d6ab71e Mon Sep 17 00:00:00 2001 From: LingMan Date: Mon, 3 May 2021 13:00:34 +0200 Subject: [PATCH 6/7] Fix stability attributes of byte-to-string specialization --- library/alloc/src/string.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 509ff9ce4d130..4aeb3de659283 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2288,7 +2288,7 @@ impl ToString for char { } } -#[stable(feature = "u8_to_string_specialization", since = "1.999.0")] +#[stable(feature = "u8_to_string_specialization", since = "1.54.0")] impl ToString for u8 { #[inline] fn to_string(&self) -> String { @@ -2307,7 +2307,7 @@ impl ToString for u8 { } } -#[stable(feature = "i8_to_string_specialization", since = "1.999.0")] +#[stable(feature = "i8_to_string_specialization", since = "1.54.0")] impl ToString for i8 { #[inline] fn to_string(&self) -> String { From 9ed197b93c68bb08e39e1c04182d6adb3c20b076 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Mon, 3 May 2021 13:48:56 +0200 Subject: [PATCH 7/7] Link to MCP from target tier policy --- src/doc/rustc/src/target-tier-policy.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/doc/rustc/src/target-tier-policy.md b/src/doc/rustc/src/target-tier-policy.md index a2cb03519160e..cc02b294b4469 100644 --- a/src/doc/rustc/src/target-tier-policy.md +++ b/src/doc/rustc/src/target-tier-policy.md @@ -102,7 +102,7 @@ place minimal requirements on the introduction of targets. A proposed new tier 3 target must be reviewed and approved by a member of the compiler team based on these requirements. The reviewer may choose to gauge -broader compiler team consensus via a Major Change Proposal (MCP). +broader compiler team consensus via a [Major Change Proposal (MCP)][MCP]. A proposed target or target-specific patch that substantially changes code shared with other targets (not just target-specific code) must be reviewed and @@ -223,8 +223,8 @@ patches that fail to build on a target. Thus, we place requirements that ensure the target will not block forward progress of the Rust project. A proposed new tier 2 target must be reviewed and approved by the compiler team -based on these requirements. Such review and approval may occur via a Major -Change Proposal (MCP). +based on these requirements. Such review and approval may occur via a [Major +Change Proposal (MCP)][MCP]. In addition, the infrastructure team must approve the integration of the target into Continuous Integration (CI), and the tier 2 CI-related requirements. This @@ -391,7 +391,7 @@ development platform, not just a compilation target. A proposed new tier 2 target with host tools must be reviewed and approved by the compiler team based on these requirements. Such review and approval may -occur via a Major Change Proposal (MCP). +occur via a [Major Change Proposal (MCP)][MCP]. In addition, the infrastructure team must approve the integration of the target's host tools into Continuous Integration (CI), and the CI-related @@ -648,3 +648,5 @@ for demotion of a tier 1 target (with or without host tools) requires a full RFC process, with approval by the compiler and release teams. Any such proposal will be communicated widely to the Rust community, both when initially proposed and before being dropped from a stable release. + +[MCP]: https://forge.rust-lang.org/compiler/mcp.html