about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-06-10 22:32:32 +0200
committerGitHub <noreply@github.com>2022-06-10 22:32:32 +0200
commit4ea862f95321ef9d8fa5d8f02f26f9bd1a265484 (patch)
tree583f240bbdf23376d9351b40e18f90a29113ed85
parent30a8903821e35c7c7cee7f393917aecaadc92e93 (diff)
parent6227d89d6aad396a1ff5a7a9bf390baa4fad93f1 (diff)
downloadrust-4ea862f95321ef9d8fa5d8f02f26f9bd1a265484.tar.gz
rust-4ea862f95321ef9d8fa5d8f02f26f9bd1a265484.zip
Rollup merge of #97941 - CorinJG:error_naming_conventions, r=compiler-errors
nit: Fixed several error_codes/Exxxx.md messages which used UpperCamelCase…

… instead of snake_case for module names
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0451.md12
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0574.md10
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0577.md6
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0603.md10
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0742.md16
5 files changed, 27 insertions, 27 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0451.md b/compiler/rustc_error_codes/src/error_codes/E0451.md
index 821073fe16e..a12378a206d 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0451.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0451.md
@@ -3,14 +3,14 @@ A struct constructor with private fields was invoked.
 Erroneous code example:
 
 ```compile_fail,E0451
-mod Bar {
+mod bar {
     pub struct Foo {
         pub a: isize,
         b: isize,
     }
 }
 
-let f = Bar::Foo{ a: 0, b: 0 }; // error: field `b` of struct `Bar::Foo`
+let f = bar::Foo{ a: 0, b: 0 }; // error: field `b` of struct `bar::Foo`
                                 //        is private
 ```
 
@@ -18,20 +18,20 @@ To fix this error, please ensure that all the fields of the struct are public,
 or implement a function for easy instantiation. Examples:
 
 ```
-mod Bar {
+mod bar {
     pub struct Foo {
         pub a: isize,
         pub b: isize, // we set `b` field public
     }
 }
 
-let f = Bar::Foo{ a: 0, b: 0 }; // ok!
+let f = bar::Foo{ a: 0, b: 0 }; // ok!
 ```
 
 Or:
 
 ```
-mod Bar {
+mod bar {
     pub struct Foo {
         pub a: isize,
         b: isize, // still private
@@ -44,5 +44,5 @@ mod Bar {
     }
 }
 
-let f = Bar::Foo::new(); // ok!
+let f = bar::Foo::new(); // ok!
 ```
diff --git a/compiler/rustc_error_codes/src/error_codes/E0574.md b/compiler/rustc_error_codes/src/error_codes/E0574.md
index 8154d5b782e..4881f61d0bc 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0574.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0574.md
@@ -4,9 +4,9 @@ expected.
 Erroneous code example:
 
 ```compile_fail,E0574
-mod Mordor {}
+mod mordor {}
 
-let sauron = Mordor { x: () }; // error!
+let sauron = mordor { x: () }; // error!
 
 enum Jak {
     Daxter { i: isize },
@@ -19,17 +19,17 @@ match eco {
 ```
 
 In all these errors, a type was expected. For example, in the first error,
-we tried to instantiate the `Mordor` module, which is impossible. If you want
+we tried to instantiate the `mordor` module, which is impossible. If you want
 to instantiate a type inside a module, you can do it as follow:
 
 ```
-mod Mordor {
+mod mordor {
     pub struct TheRing {
         pub x: usize,
     }
 }
 
-let sauron = Mordor::TheRing { x: 1 }; // ok!
+let sauron = mordor::TheRing { x: 1 }; // ok!
 ```
 
 In the second error, we tried to bind the `Jak` enum directly, which is not
diff --git a/compiler/rustc_error_codes/src/error_codes/E0577.md b/compiler/rustc_error_codes/src/error_codes/E0577.md
index 1feb9c0acf3..eba2d3b1417 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0577.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0577.md
@@ -11,13 +11,13 @@ fn main() {}
 ```
 
 `Sea` is not a module, therefore it is invalid to use it in a visibility path.
-To fix this error we need to ensure `Sea` is a module.
+To fix this error we need to ensure `sea` is a module.
 
 Please note that the visibility scope can only be applied on ancestors!
 
 ```edition2018
-pub mod Sea {
-    pub (in crate::Sea) struct Shark; // ok!
+pub mod sea {
+    pub (in crate::sea) struct Shark; // ok!
 }
 
 fn main() {}
diff --git a/compiler/rustc_error_codes/src/error_codes/E0603.md b/compiler/rustc_error_codes/src/error_codes/E0603.md
index 69fefce3908..eb293118acc 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0603.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0603.md
@@ -3,13 +3,13 @@ A private item was used outside its scope.
 Erroneous code example:
 
 ```compile_fail,E0603
-mod SomeModule {
+mod foo {
     const PRIVATE: u32 = 0x_a_bad_1dea_u32; // This const is private, so we
                                             // can't use it outside of the
-                                            // `SomeModule` module.
+                                            // `foo` module.
 }
 
-println!("const value: {}", SomeModule::PRIVATE); // error: constant `PRIVATE`
+println!("const value: {}", foo::PRIVATE); // error: constant `PRIVATE`
                                                   //        is private
 ```
 
@@ -17,10 +17,10 @@ In order to fix this error, you need to make the item public by using the `pub`
 keyword. Example:
 
 ```
-mod SomeModule {
+mod foo {
     pub const PRIVATE: u32 = 0x_a_bad_1dea_u32; // We set it public by using the
                                                 // `pub` keyword.
 }
 
-println!("const value: {}", SomeModule::PRIVATE); // ok!
+println!("const value: {}", foo::PRIVATE); // ok!
 ```
diff --git a/compiler/rustc_error_codes/src/error_codes/E0742.md b/compiler/rustc_error_codes/src/error_codes/E0742.md
index fed9f1f4cee..e10c1639dd3 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0742.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0742.md
@@ -4,18 +4,18 @@ item.
 Erroneous code example:
 
 ```compile_fail,E0742,edition2018
-pub mod Sea {}
+pub mod sea {}
 
-pub (in crate::Sea) struct Shark; // error!
+pub (in crate::sea) struct Shark; // error!
 
 fn main() {}
 ```
 
-To fix this error, we need to move the `Shark` struct inside the `Sea` module:
+To fix this error, we need to move the `Shark` struct inside the `sea` module:
 
 ```edition2018
-pub mod Sea {
-    pub (in crate::Sea) struct Shark; // ok!
+pub mod sea {
+    pub (in crate::sea) struct Shark; // ok!
 }
 
 fn main() {}
@@ -25,9 +25,9 @@ Of course, you can do it as long as the module you're referring to is an
 ancestor:
 
 ```edition2018
-pub mod Earth {
-    pub mod Sea {
-        pub (in crate::Earth) struct Shark; // ok!
+pub mod earth {
+    pub mod sea {
+        pub (in crate::earth) struct Shark; // ok!
     }
 }