From 5f3b8d0883ac699729a8f7801068574349e6d404 Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Wed, 17 Apr 2019 18:19:14 +0900 Subject: [PATCH 1/8] Rename diagnostics to error_codes --- src/librustc/{diagnostics.rs => error_codes.rs} | 0 src/librustc_borrowck/{diagnostics.rs => error_codes.rs} | 0 src/librustc_codegen_llvm/{diagnostics.rs => error_codes.rs} | 0 src/librustc_codegen_ssa/{diagnostics.rs => error_codes.rs} | 0 src/librustc_lint/{diagnostics.rs => error_codes.rs} | 0 src/librustc_metadata/{diagnostics.rs => error_codes.rs} | 0 src/librustc_mir/{diagnostics.rs => error_codes.rs} | 0 src/librustc_passes/{diagnostics.rs => error_codes.rs} | 0 src/librustc_plugin/{diagnostics.rs => error_codes.rs} | 0 src/librustc_privacy/{diagnostics.rs => error_codes.rs} | 0 src/librustc_resolve/{diagnostics.rs => error_codes.rs} | 0 src/librustc_typeck/{diagnostics.rs => error_codes.rs} | 0 src/libsyntax_ext/{diagnostics.rs => error_codes.rs} | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename src/librustc/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_borrowck/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_codegen_llvm/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_codegen_ssa/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_lint/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_metadata/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_mir/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_passes/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_plugin/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_privacy/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_resolve/{diagnostics.rs => error_codes.rs} (100%) rename src/librustc_typeck/{diagnostics.rs => error_codes.rs} (100%) rename src/libsyntax_ext/{diagnostics.rs => error_codes.rs} (100%) diff --git a/src/librustc/diagnostics.rs b/src/librustc/error_codes.rs similarity index 100% rename from src/librustc/diagnostics.rs rename to src/librustc/error_codes.rs diff --git a/src/librustc_borrowck/diagnostics.rs b/src/librustc_borrowck/error_codes.rs similarity index 100% rename from src/librustc_borrowck/diagnostics.rs rename to src/librustc_borrowck/error_codes.rs diff --git a/src/librustc_codegen_llvm/diagnostics.rs b/src/librustc_codegen_llvm/error_codes.rs similarity index 100% rename from src/librustc_codegen_llvm/diagnostics.rs rename to src/librustc_codegen_llvm/error_codes.rs diff --git a/src/librustc_codegen_ssa/diagnostics.rs b/src/librustc_codegen_ssa/error_codes.rs similarity index 100% rename from src/librustc_codegen_ssa/diagnostics.rs rename to src/librustc_codegen_ssa/error_codes.rs diff --git a/src/librustc_lint/diagnostics.rs b/src/librustc_lint/error_codes.rs similarity index 100% rename from src/librustc_lint/diagnostics.rs rename to src/librustc_lint/error_codes.rs diff --git a/src/librustc_metadata/diagnostics.rs b/src/librustc_metadata/error_codes.rs similarity index 100% rename from src/librustc_metadata/diagnostics.rs rename to src/librustc_metadata/error_codes.rs diff --git a/src/librustc_mir/diagnostics.rs b/src/librustc_mir/error_codes.rs similarity index 100% rename from src/librustc_mir/diagnostics.rs rename to src/librustc_mir/error_codes.rs diff --git a/src/librustc_passes/diagnostics.rs b/src/librustc_passes/error_codes.rs similarity index 100% rename from src/librustc_passes/diagnostics.rs rename to src/librustc_passes/error_codes.rs diff --git a/src/librustc_plugin/diagnostics.rs b/src/librustc_plugin/error_codes.rs similarity index 100% rename from src/librustc_plugin/diagnostics.rs rename to src/librustc_plugin/error_codes.rs diff --git a/src/librustc_privacy/diagnostics.rs b/src/librustc_privacy/error_codes.rs similarity index 100% rename from src/librustc_privacy/diagnostics.rs rename to src/librustc_privacy/error_codes.rs diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/error_codes.rs similarity index 100% rename from src/librustc_resolve/diagnostics.rs rename to src/librustc_resolve/error_codes.rs diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/error_codes.rs similarity index 100% rename from src/librustc_typeck/diagnostics.rs rename to src/librustc_typeck/error_codes.rs diff --git a/src/libsyntax_ext/diagnostics.rs b/src/libsyntax_ext/error_codes.rs similarity index 100% rename from src/libsyntax_ext/diagnostics.rs rename to src/libsyntax_ext/error_codes.rs From 90821add810c69c9a04669614c9ab993d1a434c7 Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Wed, 17 Apr 2019 18:21:17 +0900 Subject: [PATCH 2/8] Rename error_reporting to diagnostics --- src/librustc_resolve/{error_reporting.rs => diagnostics.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/librustc_resolve/{error_reporting.rs => diagnostics.rs} (100%) diff --git a/src/librustc_resolve/error_reporting.rs b/src/librustc_resolve/diagnostics.rs similarity index 100% rename from src/librustc_resolve/error_reporting.rs rename to src/librustc_resolve/diagnostics.rs From 9ad56e3b949ede66000ed7f10b557e9d9fe401ac Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Wed, 17 Apr 2019 07:35:54 +0900 Subject: [PATCH 3/8] Rename modules --- src/librustc/lib.rs | 2 +- src/librustc_codegen_llvm/lib.rs | 2 +- src/librustc_codegen_ssa/lib.rs | 2 +- src/librustc_lint/lib.rs | 2 +- src/librustc_metadata/lib.rs | 2 +- src/librustc_mir/lib.rs | 2 +- src/librustc_passes/lib.rs | 2 +- src/librustc_plugin/lib.rs | 2 +- src/librustc_privacy/lib.rs | 2 +- src/librustc_resolve/lib.rs | 4 ++-- src/librustc_typeck/lib.rs | 2 +- src/libsyntax_ext/lib.rs | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index c5c2cbfcb8940..a50ef55a2fde8 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -99,7 +99,7 @@ mod macros; // N.B., this module needs to be declared first so diagnostics are // registered before they are used. -pub mod diagnostics; +pub mod error_codes; #[macro_use] pub mod query; diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index da91217e95e3d..c2eee59fbb0ac 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -70,7 +70,7 @@ use rustc_mir::monomorphize; use rustc_codegen_ssa::ModuleCodegen; use rustc_codegen_utils::codegen_backend::CodegenBackend; -mod diagnostics; +mod error_codes; mod back { mod archive; diff --git a/src/librustc_codegen_ssa/lib.rs b/src/librustc_codegen_ssa/lib.rs index e2917578c0ece..14caca84a9f48 100644 --- a/src/librustc_codegen_ssa/lib.rs +++ b/src/librustc_codegen_ssa/lib.rs @@ -41,7 +41,7 @@ use syntax_pos::symbol::Symbol; // N.B., this module needs to be declared first so diagnostics are // registered before they are used. -mod diagnostics; +mod error_codes; pub mod common; pub mod traits; diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 9354f203e4e4e..cd967f5b71361 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -25,7 +25,7 @@ #[macro_use] extern crate rustc; -mod diagnostics; +mod error_codes; mod nonstandard_style; pub mod builtin; mod types; diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 4078171733fc3..873d36c454420 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -26,7 +26,7 @@ extern crate rustc; #[macro_use] extern crate rustc_data_structures; -mod diagnostics; +mod error_codes; mod index_builder; mod index; diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index deeed9a0b9846..299fe26652829 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -40,7 +40,7 @@ extern crate serialize as rustc_serialize; // used by deriving #[macro_use] extern crate syntax; -mod diagnostics; +mod error_codes; mod borrow_check; mod build; diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index 20442a4a566ec..6cf5bf6494671 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -19,7 +19,7 @@ extern crate rustc; use rustc::ty::query::Providers; -mod diagnostics; +mod error_codes; pub mod ast_validation; pub mod rvalue_promotion; diff --git a/src/librustc_plugin/lib.rs b/src/librustc_plugin/lib.rs index 351ba7f04d3b1..3775dbb79c6fd 100644 --- a/src/librustc_plugin/lib.rs +++ b/src/librustc_plugin/lib.rs @@ -61,7 +61,7 @@ pub use registry::Registry; -mod diagnostics; +mod error_codes; pub mod registry; pub mod load; pub mod build; diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 44621e5dc95d1..9d187cea1ce6c 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -33,7 +33,7 @@ use syntax_pos::Span; use std::{cmp, fmt, mem}; use std::marker::PhantomData; -mod diagnostics; +mod error_codes; //////////////////////////////////////////////////////////////////////////////// /// Generic infrastructure used to implement specific visitors below. diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 96aac97729797..bd5f87af6a967 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -65,7 +65,7 @@ use std::mem::replace; use rustc_data_structures::ptr_key::PtrKey; use rustc_data_structures::sync::Lrc; -use error_reporting::{find_span_of_binding_until_next_binding, extend_span_to_previous_binding}; +use diagnostics::{find_span_of_binding_until_next_binding, extend_span_to_previous_binding}; use resolve_imports::{ImportDirective, ImportDirectiveSubclass, NameResolution, ImportResolver}; use macros::{InvocationData, LegacyBinding, ParentScope}; @@ -73,8 +73,8 @@ type Def = def::Def; // N.B., this module needs to be declared first so diagnostics are // registered before they are used. +mod error_codes; mod diagnostics; -mod error_reporting; mod macros; mod check_unused; mod build_reduced_graph; diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 21d1af229ddc2..64b91289dfe4c 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -81,7 +81,7 @@ This API is completely unstable and subject to change. // N.B., this module needs to be declared first so diagnostics are // registered before they are used. -mod diagnostics; +mod error_codes; mod astconv; mod check; diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index ee0b86963f31d..2847525caada3 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -17,7 +17,7 @@ extern crate proc_macro; -mod diagnostics; +mod error_codes; mod asm; mod assert; From b9599d1210e1e8c073229bc451df9537d80bd7b8 Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Wed, 17 Apr 2019 18:40:45 +0900 Subject: [PATCH 4/8] Rename filename --- src/tools/tidy/src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/tidy/src/errors.rs b/src/tools/tidy/src/errors.rs index 76ebc9b601099..f24496aab596a 100644 --- a/src/tools/tidy/src/errors.rs +++ b/src/tools/tidy/src/errors.rs @@ -15,7 +15,7 @@ pub fn check(path: &Path, bad: &mut bool) { &mut |path| super::filter_dirs(path) || path.ends_with("src/test"), &mut |file| { let filename = file.file_name().unwrap().to_string_lossy(); - if filename != "diagnostics.rs" && filename != "diagnostic_list.rs" { + if filename != "error_codes.rs" && filename != "diagnostic_list.rs" { return } From c97b2589ec99ff1be0b4ebf9fac88ebe0f56305a Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Thu, 18 Apr 2019 06:20:07 +0900 Subject: [PATCH 5/8] Rename files in doc --- src/doc/rustc-ux-guidelines.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/doc/rustc-ux-guidelines.md b/src/doc/rustc-ux-guidelines.md index 93e94e5586302..e3684fc9f320a 100644 --- a/src/doc/rustc-ux-guidelines.md +++ b/src/doc/rustc-ux-guidelines.md @@ -61,17 +61,17 @@ for details on how to format and write long error codes. * All of them are accessible [online](http://doc.rust-lang.org/error-index.html), which are auto-generated from rustc source code in different places: - [librustc](https://github.com/rust-lang/rust/blob/master/src/librustc/diagnostics.rs), - [libsyntax](https://github.com/rust-lang/rust/blob/master/src/libsyntax/diagnostics.rs), - [librustc_borrowck](https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/diagnostics.rs), - [librustc_metadata](https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/diagnostics.rs), - [librustc_mir](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/diagnostics.rs), - [librustc_passes](https://github.com/rust-lang/rust/blob/master/src/librustc_passes/diagnostics.rs), - [librustc_privacy](https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/diagnostics.rs), - [librustc_resolve](https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/diagnostics.rs), - [librustc_codegen_llvm](https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_llvm/diagnostics.rs), - [librustc_plugin](https://github.com/rust-lang/rust/blob/master/src/librustc_plugin/diagnostics.rs), - [librustc_typeck](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/diagnostics.rs). + [librustc](https://github.com/rust-lang/rust/blob/master/src/librustc/error_codes.rs), + [libsyntax](https://github.com/rust-lang/rust/blob/master/src/libsyntax/error_codes.rs), + [librustc_borrowck](https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/error_codes.rs), + [librustc_metadata](https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/error_codes.rs), + [librustc_mir](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/error_codes.rs), + [librustc_passes](https://github.com/rust-lang/rust/blob/master/src/librustc_passes/error_codes.rs), + [librustc_privacy](https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/error_codes.rs), + [librustc_resolve](https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/error_codes.rs), + [librustc_codegen_llvm](https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_llvm/error_codes.rs), + [librustc_plugin](https://github.com/rust-lang/rust/blob/master/src/librustc_plugin/error_codes.rs), + [librustc_typeck](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/error_codes.rs). * Explanations have full markdown support. Use it, especially to highlight code with backticks. * When talking about the compiler, call it `the compiler`, not `Rust` or From 53084ff92e48d0e0dd819daa7acb485e4a910599 Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Thu, 18 Apr 2019 06:21:30 +0900 Subject: [PATCH 6/8] Rename diagnositc_list into error_codes --- src/libsyntax/{diagnostic_list.rs => error_codes.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/libsyntax/{diagnostic_list.rs => error_codes.rs} (100%) diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/error_codes.rs similarity index 100% rename from src/libsyntax/diagnostic_list.rs rename to src/libsyntax/error_codes.rs From 3ec0219432d86a6116f5ff09876403e22d83357e Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Thu, 18 Apr 2019 06:22:48 +0900 Subject: [PATCH 7/8] Remove unnecessary condition --- src/tools/tidy/src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/tidy/src/errors.rs b/src/tools/tidy/src/errors.rs index f24496aab596a..ef1000ee5065a 100644 --- a/src/tools/tidy/src/errors.rs +++ b/src/tools/tidy/src/errors.rs @@ -15,7 +15,7 @@ pub fn check(path: &Path, bad: &mut bool) { &mut |path| super::filter_dirs(path) || path.ends_with("src/test"), &mut |file| { let filename = file.file_name().unwrap().to_string_lossy(); - if filename != "error_codes.rs" && filename != "diagnostic_list.rs" { + if filename != "error_codes.rs" { return } From a1d2f7222cf1f5c4344a918251c7f37d252c2434 Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Thu, 18 Apr 2019 06:27:30 +0900 Subject: [PATCH 8/8] Rename module --- src/libsyntax/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 9905b981395c0..9963dbca66174 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -114,7 +114,7 @@ pub mod diagnostics { // N.B., this module needs to be declared first so diagnostics are // registered before they are used. -pub mod diagnostic_list; +pub mod error_codes; pub mod util { pub mod lev_distance;