about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-01-26 20:08:10 +0100
committerLukas Wirth <lukastw97@gmail.com>2024-01-27 11:02:34 +0100
commit8a5829cf286c8361d93aab090bbf4fc599e37fef (patch)
tree79093eb9655725b9e09b503d1b02adc05b35c061
parent6cf7b5f8d7e488ff6b14f8ed552b470ee5ec9cbf (diff)
downloadrust-8a5829cf286c8361d93aab090bbf4fc599e37fef.tar.gz
rust-8a5829cf286c8361d93aab090bbf4fc599e37fef.zip
Re-order mod declarations
-rw-r--r--crates/base-db/src/lib.rs2
-rw-r--r--crates/hir-def/src/body.rs4
-rw-r--r--crates/hir-def/src/hir.rs2
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mbe.rs2
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mod.rs4
-rw-r--r--crates/hir-def/src/nameres.rs4
-rw-r--r--crates/hir-expand/src/declarative.rs1
-rw-r--r--crates/hir-ty/src/diagnostics.rs2
-rw-r--r--crates/hir-ty/src/lib.rs4
-rw-r--r--crates/hir-ty/src/mir.rs4
-rw-r--r--crates/hir-ty/src/tests.rs14
-rw-r--r--crates/ide-assists/src/lib.rs38
-rw-r--r--crates/ide-assists/src/utils.rs2
-rw-r--r--crates/ide-completion/src/completions.rs4
-rw-r--r--crates/ide-completion/src/completions/attribute.rs2
-rw-r--r--crates/ide-completion/src/lib.rs2
-rw-r--r--crates/ide-completion/src/render.rs8
-rw-r--r--crates/ide-completion/src/tests.rs2
-rw-r--r--crates/ide-db/src/lib.rs8
-rw-r--r--crates/ide-diagnostics/src/lib.rs14
-rw-r--r--crates/ide-ssr/src/lib.rs2
-rw-r--r--crates/ide/src/inlay_hints.rs4
-rw-r--r--crates/ide/src/lib.rs14
-rw-r--r--crates/ide/src/syntax_highlighting.rs6
-rw-r--r--crates/mbe/src/lib.rs4
-rw-r--r--crates/parser/src/grammar.rs4
-rw-r--r--crates/parser/src/grammar/items.rs2
-rw-r--r--crates/parser/src/lib.rs8
-rw-r--r--crates/parser/src/tests.rs2
-rw-r--r--crates/proc-macro-srv/src/lib.rs2
-rw-r--r--crates/proc-macro-srv/src/server.rs2
-rw-r--r--crates/profile/src/lib.rs4
-rw-r--r--crates/project-model/src/lib.rs8
-rw-r--r--crates/rust-analyzer/src/cli.rs12
-rw-r--r--crates/rust-analyzer/src/lsp.rs4
-rw-r--r--crates/stdx/src/lib.rs6
-rw-r--r--crates/syntax/src/ast.rs12
-rw-r--r--crates/syntax/src/lib.rs12
-rw-r--r--lib/lsp-server/src/lib.rs6
-rw-r--r--xtask/src/main.rs6
40 files changed, 122 insertions, 121 deletions
diff --git a/crates/base-db/src/lib.rs b/crates/base-db/src/lib.rs
index 92d2b9c3f57..90da7efd4a8 100644
--- a/crates/base-db/src/lib.rs
+++ b/crates/base-db/src/lib.rs
@@ -2,8 +2,8 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-mod input;
 mod change;
+mod input;
 
 use std::panic;
 
diff --git a/crates/hir-def/src/body.rs b/crates/hir-def/src/body.rs
index 81132d73853..e4308c6b7f1 100644
--- a/crates/hir-def/src/body.rs
+++ b/crates/hir-def/src/body.rs
@@ -1,10 +1,10 @@
 //! Defines `Body`: a lowered representation of bodies of functions, statics and
 //! consts.
 mod lower;
+mod pretty;
+pub mod scope;
 #[cfg(test)]
 mod tests;
-pub mod scope;
-mod pretty;
 
 use std::ops::Index;
 
diff --git a/crates/hir-def/src/hir.rs b/crates/hir-def/src/hir.rs
index 1a33868a78c..ac44d379415 100644
--- a/crates/hir-def/src/hir.rs
+++ b/crates/hir-def/src/hir.rs
@@ -12,8 +12,8 @@
 //!
 //! See also a neighboring `body` module.
 
-pub mod type_ref;
 pub mod format_args;
+pub mod type_ref;
 
 use std::fmt;
 
diff --git a/crates/hir-def/src/macro_expansion_tests/mbe.rs b/crates/hir-def/src/macro_expansion_tests/mbe.rs
index 6d365bd93c0..d0ae1f59f7c 100644
--- a/crates/hir-def/src/macro_expansion_tests/mbe.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mbe.rs
@@ -1,11 +1,11 @@
 //! Tests specific to declarative macros, aka macros by example. This covers
 //! both stable `macro_rules!` macros as well as unstable `macro` macros.
 
-mod tt_conversion;
 mod matching;
 mod meta_syntax;
 mod metavar_expr;
 mod regression;
+mod tt_conversion;
 
 use expect_test::expect;
 
diff --git a/crates/hir-def/src/macro_expansion_tests/mod.rs b/crates/hir-def/src/macro_expansion_tests/mod.rs
index 550ce35f127..ec299405387 100644
--- a/crates/hir-def/src/macro_expansion_tests/mod.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mod.rs
@@ -9,9 +9,9 @@
 //! write unit-tests (in fact, we used to do that), but that makes tests brittle
 //! and harder to understand.
 
-mod mbe;
-mod builtin_fn_macro;
 mod builtin_derive_macro;
+mod builtin_fn_macro;
+mod mbe;
 mod proc_macros;
 
 use std::{iter, ops::Range, sync};
diff --git a/crates/hir-def/src/nameres.rs b/crates/hir-def/src/nameres.rs
index 7eb2f3adddb..2295df16fdc 100644
--- a/crates/hir-def/src/nameres.rs
+++ b/crates/hir-def/src/nameres.rs
@@ -48,11 +48,11 @@
 //! the result
 
 pub mod attr_resolution;
-pub mod proc_macro;
-pub mod diagnostics;
 mod collector;
+pub mod diagnostics;
 mod mod_resolution;
 mod path_resolution;
+pub mod proc_macro;
 
 #[cfg(test)]
 mod tests;
diff --git a/crates/hir-expand/src/declarative.rs b/crates/hir-expand/src/declarative.rs
index ff1a9625e11..37084ee8b93 100644
--- a/crates/hir-expand/src/declarative.rs
+++ b/crates/hir-expand/src/declarative.rs
@@ -1,3 +1,4 @@
+//! Compiled declarative macro expanders (`macro_rules!`` and `macro`)
 use std::sync::OnceLock;
 
 use base_db::{CrateId, Edition, VersionReq};
diff --git a/crates/hir-ty/src/diagnostics.rs b/crates/hir-ty/src/diagnostics.rs
index c1b3619009b..af4d2c9fc04 100644
--- a/crates/hir-ty/src/diagnostics.rs
+++ b/crates/hir-ty/src/diagnostics.rs
@@ -1,8 +1,8 @@
 //! Type inference-based diagnostics.
+mod decl_check;
 mod expr;
 mod match_check;
 mod unsafe_check;
-mod decl_check;
 
 pub use crate::diagnostics::{
     decl_check::{incorrect_case, CaseType, IncorrectCase},
diff --git a/crates/hir-ty/src/lib.rs b/crates/hir-ty/src/lib.rs
index 8d180f98617..54e91e7b29a 100644
--- a/crates/hir-ty/src/lib.rs
+++ b/crates/hir-ty/src/lib.rs
@@ -42,9 +42,9 @@ pub mod primitive;
 pub mod traits;
 
 #[cfg(test)]
-mod tests;
-#[cfg(test)]
 mod test_db;
+#[cfg(test)]
+mod tests;
 
 use std::{
     collections::hash_map::Entry,
diff --git a/crates/hir-ty/src/mir.rs b/crates/hir-ty/src/mir.rs
index 952a97e3d0f..494f1850b88 100644
--- a/crates/hir-ty/src/mir.rs
+++ b/crates/hir-ty/src/mir.rs
@@ -21,11 +21,11 @@ use hir_def::{
 };
 use la_arena::{Arena, ArenaMap, Idx, RawIdx};
 
+mod borrowck;
 mod eval;
 mod lower;
-mod borrowck;
-mod pretty;
 mod monomorphization;
+mod pretty;
 
 pub use borrowck::{borrowck_query, BorrowckResult, MutabilityReason};
 pub use eval::{
diff --git a/crates/hir-ty/src/tests.rs b/crates/hir-ty/src/tests.rs
index 671fd9ec3a4..9804910c878 100644
--- a/crates/hir-ty/src/tests.rs
+++ b/crates/hir-ty/src/tests.rs
@@ -1,14 +1,14 @@
-mod never_type;
 mod coercion;
+mod diagnostics;
+mod display_source_code;
+mod incremental;
+mod macros;
+mod method_resolution;
+mod never_type;
+mod patterns;
 mod regression;
 mod simple;
-mod patterns;
 mod traits;
-mod method_resolution;
-mod macros;
-mod display_source_code;
-mod incremental;
-mod diagnostics;
 
 use std::{collections::HashMap, env};
 
diff --git a/crates/ide-assists/src/lib.rs b/crates/ide-assists/src/lib.rs
index 1eb4903ab20..edcf52a9b38 100644
--- a/crates/ide-assists/src/lib.rs
+++ b/crates/ide-assists/src/lib.rs
@@ -111,6 +111,8 @@ mod handlers {
     mod add_label_to_loop;
     mod add_lifetime_to_type;
     mod add_missing_impl_members;
+    mod add_missing_match_arms;
+    mod add_return_type;
     mod add_turbo_fish;
     mod apply_demorgan;
     mod auto_import;
@@ -124,15 +126,15 @@ mod handlers {
     mod convert_iter_for_each_to_for;
     mod convert_let_else_to_match;
     mod convert_match_to_let_else;
+    mod convert_named_struct_to_tuple_struct;
     mod convert_nested_function_to_closure;
+    mod convert_to_guarded_return;
     mod convert_tuple_return_type_to_struct;
     mod convert_tuple_struct_to_named_struct;
-    mod convert_named_struct_to_tuple_struct;
-    mod convert_to_guarded_return;
     mod convert_two_arm_bool_match_to_matches_macro;
     mod convert_while_to_loop;
-    mod desugar_doc_comment;
     mod destructure_tuple_binding;
+    mod desugar_doc_comment;
     mod expand_glob_import;
     mod extract_expressions_from_format_string;
     mod extract_function;
@@ -140,7 +142,6 @@ mod handlers {
     mod extract_struct_from_enum_variant;
     mod extract_type_alias;
     mod extract_variable;
-    mod add_missing_match_arms;
     mod fix_visibility;
     mod flip_binexpr;
     mod flip_comma;
@@ -148,6 +149,7 @@ mod handlers {
     mod generate_constant;
     mod generate_default_from_enum_variant;
     mod generate_default_from_new;
+    mod generate_delegate_methods;
     mod generate_delegate_trait;
     mod generate_deref;
     mod generate_derive;
@@ -162,62 +164,60 @@ mod handlers {
     mod generate_is_empty_from_len;
     mod generate_mut_trait_impl;
     mod generate_new;
-    mod generate_delegate_methods;
     mod generate_trait_from_impl;
-    mod add_return_type;
     mod inline_call;
     mod inline_const_as_literal;
     mod inline_local_variable;
     mod inline_macro;
     mod inline_type_alias;
+    mod into_to_qualified_from;
+    mod introduce_named_generic;
     mod introduce_named_lifetime;
     mod invert_if;
     mod merge_imports;
     mod merge_match_arms;
+    mod merge_nested_if;
     mod move_bounds;
     mod move_const_to_impl;
+    mod move_from_mod_rs;
     mod move_guard;
     mod move_module_to_file;
     mod move_to_mod_rs;
-    mod move_from_mod_rs;
     mod number_representation;
     mod promote_local_to_const;
     mod pull_assignment_up;
-    mod qualify_path;
     mod qualify_method_call;
+    mod qualify_path;
     mod raw_string;
     mod remove_dbg;
     mod remove_mut;
+    mod remove_parentheses;
     mod remove_unused_imports;
     mod remove_unused_param;
-    mod remove_parentheses;
     mod reorder_fields;
     mod reorder_impl_items;
-    mod replace_try_expr_with_match;
+    mod replace_arith_op;
     mod replace_derive_with_manual_impl;
     mod replace_if_let_with_match;
     mod replace_is_method_with_if_let_method;
-    mod replace_method_eager_lazy;
-    mod replace_arith_op;
-    mod introduce_named_generic;
     mod replace_let_with_if_let;
+    mod replace_method_eager_lazy;
     mod replace_named_generic_with_impl;
     mod replace_qualified_name_with_use;
     mod replace_string_with_char;
+    mod replace_try_expr_with_match;
     mod replace_turbofish_with_explicit_type;
-    mod split_import;
-    mod unmerge_match_arm;
-    mod unwrap_tuple;
     mod sort_items;
+    mod split_import;
     mod toggle_ignore;
+    mod unmerge_match_arm;
     mod unmerge_use;
     mod unnecessary_async;
+    mod unqualify_method_call;
     mod unwrap_block;
     mod unwrap_result_return_type;
-    mod unqualify_method_call;
+    mod unwrap_tuple;
     mod wrap_return_type_in_result;
-    mod into_to_qualified_from;
-    mod merge_nested_if;
 
     pub(crate) fn all() -> &'static [Handler] {
         &[
diff --git a/crates/ide-assists/src/utils.rs b/crates/ide-assists/src/utils.rs
index 2420945f756..eeb3d80d07b 100644
--- a/crates/ide-assists/src/utils.rs
+++ b/crates/ide-assists/src/utils.rs
@@ -23,8 +23,8 @@ use syntax::{
 
 use crate::assist_context::{AssistContext, SourceChangeBuilder};
 
-pub(crate) mod suggest_name;
 mod gen_trait_fn_body;
+pub(crate) mod suggest_name;
 
 pub(crate) fn unwrap_trivial_block(block_expr: ast::BlockExpr) -> ast::Expr {
     extract_trivial_expression(&block_expr)
diff --git a/crates/ide-completion/src/completions.rs b/crates/ide-completion/src/completions.rs
index 4d3d0b4d1a6..ba3c0cf3fd6 100644
--- a/crates/ide-completion/src/completions.rs
+++ b/crates/ide-completion/src/completions.rs
@@ -2,8 +2,10 @@
 
 pub(crate) mod attribute;
 pub(crate) mod dot;
+pub(crate) mod env_vars;
 pub(crate) mod expr;
 pub(crate) mod extern_abi;
+pub(crate) mod extern_crate;
 pub(crate) mod field;
 pub(crate) mod flyimport;
 pub(crate) mod fn_param;
@@ -19,8 +21,6 @@ pub(crate) mod snippet;
 pub(crate) mod r#type;
 pub(crate) mod use_;
 pub(crate) mod vis;
-pub(crate) mod env_vars;
-pub(crate) mod extern_crate;
 
 use std::iter;
 
diff --git a/crates/ide-completion/src/completions/attribute.rs b/crates/ide-completion/src/completions/attribute.rs
index 8f7c3b5070b..a7a6cdebd36 100644
--- a/crates/ide-completion/src/completions/attribute.rs
+++ b/crates/ide-completion/src/completions/attribute.rs
@@ -25,8 +25,8 @@ use crate::{
 mod cfg;
 mod derive;
 mod lint;
-mod repr;
 mod macro_use;
+mod repr;
 
 pub(crate) use self::derive::complete_derive_path;
 
diff --git a/crates/ide-completion/src/lib.rs b/crates/ide-completion/src/lib.rs
index 6a98e109f6d..d26b6f431b5 100644
--- a/crates/ide-completion/src/lib.rs
+++ b/crates/ide-completion/src/lib.rs
@@ -8,9 +8,9 @@ mod context;
 mod item;
 mod render;
 
+mod snippet;
 #[cfg(test)]
 mod tests;
-mod snippet;
 
 use ide_db::{
     base_db::FilePosition,
diff --git a/crates/ide-completion/src/render.rs b/crates/ide-completion/src/render.rs
index 6fd988bfc0f..ad26280ae74 100644
--- a/crates/ide-completion/src/render.rs
+++ b/crates/ide-completion/src/render.rs
@@ -1,14 +1,14 @@
 //! `render` module provides utilities for rendering completion suggestions
 //! into code pieces that will be presented to user.
 
-pub(crate) mod macro_;
-pub(crate) mod function;
 pub(crate) mod const_;
+pub(crate) mod function;
+pub(crate) mod literal;
+pub(crate) mod macro_;
 pub(crate) mod pattern;
 pub(crate) mod type_alias;
-pub(crate) mod variant;
 pub(crate) mod union_literal;
-pub(crate) mod literal;
+pub(crate) mod variant;
 
 use hir::{AsAssocItem, HasAttrs, HirDisplay, ModuleDef, ScopeDef, Type};
 use ide_db::{
diff --git a/crates/ide-completion/src/tests.rs b/crates/ide-completion/src/tests.rs
index f13754e2ded..c421be51a0d 100644
--- a/crates/ide-completion/src/tests.rs
+++ b/crates/ide-completion/src/tests.rs
@@ -12,8 +12,8 @@ mod attribute;
 mod expression;
 mod flyimport;
 mod fn_param;
-mod item_list;
 mod item;
+mod item_list;
 mod pattern;
 mod predicate;
 mod proc_macros;
diff --git a/crates/ide-db/src/lib.rs b/crates/ide-db/src/lib.rs
index 1cc1e363299..2881748dd47 100644
--- a/crates/ide-db/src/lib.rs
+++ b/crates/ide-db/src/lib.rs
@@ -9,6 +9,7 @@ mod apply_change;
 pub mod active_parameter;
 pub mod assists;
 pub mod defs;
+pub mod documentation;
 pub mod famous_defs;
 pub mod helpers;
 pub mod items_locator;
@@ -22,7 +23,6 @@ pub mod symbol_index;
 pub mod traits;
 pub mod ty_filter;
 pub mod use_trivial_constructor;
-pub mod documentation;
 
 pub mod imports {
     pub mod import_assets;
@@ -35,10 +35,10 @@ pub mod generated {
 }
 
 pub mod syntax_helpers {
-    pub mod node_ext;
-    pub mod insert_whitespace_into_node;
     pub mod format_string;
     pub mod format_string_exprs;
+    pub mod insert_whitespace_into_node;
+    pub mod node_ext;
 
     pub use parser::LexedStr;
 }
@@ -414,6 +414,6 @@ impl SnippetCap {
 
 #[cfg(test)]
 mod tests {
-    mod sourcegen_lints;
     mod line_index;
+    mod sourcegen_lints;
 }
diff --git a/crates/ide-diagnostics/src/lib.rs b/crates/ide-diagnostics/src/lib.rs
index 7743b060c86..f35fc5b533a 100644
--- a/crates/ide-diagnostics/src/lib.rs
+++ b/crates/ide-diagnostics/src/lib.rs
@@ -44,30 +44,30 @@ mod handlers {
     pub(crate) mod private_assoc_item;
     pub(crate) mod private_field;
     pub(crate) mod replace_filter_map_next_with_find_map;
-    pub(crate) mod trait_impl_orphan;
     pub(crate) mod trait_impl_incorrect_safety;
     pub(crate) mod trait_impl_missing_assoc_item;
+    pub(crate) mod trait_impl_orphan;
     pub(crate) mod trait_impl_redundant_assoc_item;
-    pub(crate) mod typed_hole;
     pub(crate) mod type_mismatch;
+    pub(crate) mod typed_hole;
+    pub(crate) mod undeclared_label;
     pub(crate) mod unimplemented_builtin_macro;
+    pub(crate) mod unreachable_label;
     pub(crate) mod unresolved_assoc_item;
     pub(crate) mod unresolved_extern_crate;
     pub(crate) mod unresolved_field;
-    pub(crate) mod unresolved_method;
     pub(crate) mod unresolved_import;
     pub(crate) mod unresolved_macro_call;
+    pub(crate) mod unresolved_method;
     pub(crate) mod unresolved_module;
     pub(crate) mod unresolved_proc_macro;
-    pub(crate) mod undeclared_label;
-    pub(crate) mod unreachable_label;
     pub(crate) mod unused_variables;
 
     // The handlers below are unusual, the implement the diagnostics as well.
     pub(crate) mod field_shorthand;
-    pub(crate) mod useless_braces;
-    pub(crate) mod unlinked_file;
     pub(crate) mod json_is_not_rust;
+    pub(crate) mod unlinked_file;
+    pub(crate) mod useless_braces;
 }
 
 #[cfg(test)]
diff --git a/crates/ide-ssr/src/lib.rs b/crates/ide-ssr/src/lib.rs
index d756e7a63eb..b5bf510aeed 100644
--- a/crates/ide-ssr/src/lib.rs
+++ b/crates/ide-ssr/src/lib.rs
@@ -69,11 +69,11 @@
 // // foo($a, $b) ==>> ($a).foo($b)
 // ```
 
+mod fragments;
 mod from_comment;
 mod matching;
 mod nester;
 mod parsing;
-mod fragments;
 mod replacing;
 mod resolving;
 mod search;
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs
index 79fff15f050..46e5901852a 100644
--- a/crates/ide/src/inlay_hints.rs
+++ b/crates/ide/src/inlay_hints.rs
@@ -25,13 +25,13 @@ mod bind_pat;
 mod binding_mode;
 mod chaining;
 mod closing_brace;
-mod closure_ret;
 mod closure_captures;
+mod closure_ret;
 mod discriminant;
 mod fn_lifetime_fn;
+mod implicit_drop;
 mod implicit_static;
 mod param_name;
-mod implicit_drop;
 mod range_exclusive;
 
 #[derive(Clone, Debug, PartialEq, Eq)]
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index a50aa2e6dfb..e9f42d47855 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -21,24 +21,25 @@ macro_rules! eprintln {
 mod fixture;
 
 mod markup;
-mod prime_caches;
 mod navigation_target;
+mod prime_caches;
 
 mod annotations;
 mod call_hierarchy;
-mod signature_help;
 mod doc_links;
-mod highlight_related;
 mod expand_macro;
 mod extend_selection;
+mod fetch_crates;
 mod file_structure;
 mod folding_ranges;
 mod goto_declaration;
 mod goto_definition;
 mod goto_implementation;
 mod goto_type_definition;
+mod highlight_related;
 mod hover;
 mod inlay_hints;
+mod interpret_function;
 mod join_lines;
 mod markdown_remove;
 mod matching_brace;
@@ -48,6 +49,8 @@ mod parent_module;
 mod references;
 mod rename;
 mod runnables;
+mod shuffle_crate_graph;
+mod signature_help;
 mod ssr;
 mod static_index;
 mod status;
@@ -56,12 +59,9 @@ mod syntax_tree;
 mod typing;
 mod view_crate_graph;
 mod view_hir;
-mod view_mir;
-mod interpret_function;
 mod view_item_tree;
-mod shuffle_crate_graph;
-mod fetch_crates;
 mod view_memory_layout;
+mod view_mir;
 
 use std::ffi::OsStr;
 
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 3607c486d7d..8c6f5e2e9cb 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -3,11 +3,11 @@ pub(crate) mod tags;
 mod highlights;
 mod injector;
 
-mod highlight;
+mod escape;
 mod format;
-mod macro_;
+mod highlight;
 mod inject;
-mod escape;
+mod macro_;
 
 mod html;
 #[cfg(test)]
diff --git a/crates/mbe/src/lib.rs b/crates/mbe/src/lib.rs
index f968a89a441..62fdce36892 100644
--- a/crates/mbe/src/lib.rs
+++ b/crates/mbe/src/lib.rs
@@ -8,11 +8,11 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-mod parser;
 mod expander;
+mod parser;
 mod syntax_bridge;
-mod tt_iter;
 mod to_parser_input;
+mod tt_iter;
 
 #[cfg(test)]
 mod benchmark;
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs
index 19da297b58c..53fda3ae4fd 100644
--- a/crates/parser/src/grammar.rs
+++ b/crates/parser/src/grammar.rs
@@ -30,12 +30,12 @@
 
 mod attributes;
 mod expressions;
+mod generic_args;
+mod generic_params;
 mod items;
 mod params;
 mod paths;
 mod patterns;
-mod generic_args;
-mod generic_params;
 mod types;
 
 use crate::{
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
index caf2a005a7d..243a219525a 100644
--- a/crates/parser/src/grammar/items.rs
+++ b/crates/parser/src/grammar/items.rs
@@ -1,5 +1,5 @@
-mod consts;
 mod adt;
+mod consts;
 mod traits;
 mod use_item;
 
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index ed0aec3cab3..3ca285e787e 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -26,15 +26,15 @@ extern crate ra_ap_rustc_lexer as rustc_lexer;
 #[cfg(feature = "in-rust-tree")]
 extern crate rustc_lexer;
 
-mod lexed_str;
-mod token_set;
-mod syntax_kind;
 mod event;
-mod parser;
 mod grammar;
 mod input;
+mod lexed_str;
 mod output;
+mod parser;
 mod shortcuts;
+mod syntax_kind;
+mod token_set;
 
 #[cfg(test)]
 mod tests;
diff --git a/crates/parser/src/tests.rs b/crates/parser/src/tests.rs
index 2fec765bd78..c65219b28dc 100644
--- a/crates/parser/src/tests.rs
+++ b/crates/parser/src/tests.rs
@@ -1,6 +1,6 @@
+mod prefix_entries;
 mod sourcegen_inline_tests;
 mod top_entries;
-mod prefix_entries;
 
 use std::{
     fmt::Write,
diff --git a/crates/proc-macro-srv/src/lib.rs b/crates/proc-macro-srv/src/lib.rs
index 67b9f57a163..460a96c07f3 100644
--- a/crates/proc-macro-srv/src/lib.rs
+++ b/crates/proc-macro-srv/src/lib.rs
@@ -21,8 +21,8 @@ extern crate proc_macro;
 extern crate rustc_driver as _;
 
 mod dylib;
-mod server;
 mod proc_macros;
+mod server;
 
 use std::{
     collections::{hash_map::Entry, HashMap},
diff --git a/crates/proc-macro-srv/src/server.rs b/crates/proc-macro-srv/src/server.rs
index 1854322ddb5..ff8fd295d88 100644
--- a/crates/proc-macro-srv/src/server.rs
+++ b/crates/proc-macro-srv/src/server.rs
@@ -13,9 +13,9 @@ use proc_macro::bridge;
 mod token_stream;
 pub use token_stream::TokenStream;
 
-pub mod token_id;
 pub mod rust_analyzer_span;
 mod symbol;
+pub mod token_id;
 pub use symbol::*;
 use tt::Spacing;
 
diff --git a/crates/profile/src/lib.rs b/crates/profile/src/lib.rs
index fdd724e2aab..d86aa0c4144 100644
--- a/crates/profile/src/lib.rs
+++ b/crates/profile/src/lib.rs
@@ -2,11 +2,11 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-mod stop_watch;
-mod memory_usage;
 #[cfg(feature = "cpu_profiler")]
 mod google_cpu_profiler;
 mod hprof;
+mod memory_usage;
+mod stop_watch;
 mod tree;
 
 use std::cell::RefCell;
diff --git a/crates/project-model/src/lib.rs b/crates/project-model/src/lib.rs
index 5f9b708289d..5114c9c016d 100644
--- a/crates/project-model/src/lib.rs
+++ b/crates/project-model/src/lib.rs
@@ -17,15 +17,15 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-mod manifest_path;
+mod build_scripts;
 mod cargo_workspace;
 mod cfg_flag;
+mod manifest_path;
 mod project_json;
-mod sysroot;
-mod workspace;
 mod rustc_cfg;
-mod build_scripts;
+mod sysroot;
 pub mod target_data_layout;
+mod workspace;
 
 #[cfg(test)]
 mod tests;
diff --git a/crates/rust-analyzer/src/cli.rs b/crates/rust-analyzer/src/cli.rs
index de00c4192b4..00670f2cb4c 100644
--- a/crates/rust-analyzer/src/cli.rs
+++ b/crates/rust-analyzer/src/cli.rs
@@ -1,16 +1,16 @@
 //! Various batch processing tasks, intended primarily for debugging.
 
-pub mod flags;
-mod parse;
-mod symbols;
-mod highlight;
 mod analysis_stats;
 mod diagnostics;
-mod ssr;
+pub mod flags;
+mod highlight;
 mod lsif;
-mod scip;
+mod parse;
 mod run_tests;
 mod rustc_tests;
+mod scip;
+mod ssr;
+mod symbols;
 
 mod progress_report;
 
diff --git a/crates/rust-analyzer/src/lsp.rs b/crates/rust-analyzer/src/lsp.rs
index ac7e1a95e62..9e0d42faed4 100644
--- a/crates/rust-analyzer/src/lsp.rs
+++ b/crates/rust-analyzer/src/lsp.rs
@@ -2,11 +2,11 @@
 
 use core::fmt;
 
-pub(crate) mod utils;
-pub(crate) mod semantic_tokens;
 pub mod ext;
 pub(crate) mod from_proto;
+pub(crate) mod semantic_tokens;
 pub(crate) mod to_proto;
+pub(crate) mod utils;
 
 #[derive(Debug)]
 pub(crate) struct LspError {
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
index cd5285295a2..07b78272281 100644
--- a/crates/stdx/src/lib.rs
+++ b/crates/stdx/src/lib.rs
@@ -6,13 +6,13 @@ use std::io as sio;
 use std::process::Command;
 use std::{cmp::Ordering, ops, time::Instant};
 
+pub mod anymap;
 mod macros;
-pub mod process;
-pub mod panic_context;
 pub mod non_empty_vec;
+pub mod panic_context;
+pub mod process;
 pub mod rand;
 pub mod thread;
-pub mod anymap;
 
 pub use always_assert::{always, never};
 pub use itertools;
diff --git a/crates/syntax/src/ast.rs b/crates/syntax/src/ast.rs
index cc90d2dd1d5..e9ab7a4320b 100644
--- a/crates/syntax/src/ast.rs
+++ b/crates/syntax/src/ast.rs
@@ -1,15 +1,15 @@
 //! Abstract Syntax Tree, layered on top of untyped `SyntaxNode`s
 
-mod generated;
-mod traits;
-mod token_ext;
-mod node_ext;
-mod expr_ext;
-mod operators;
 pub mod edit;
 pub mod edit_in_place;
+mod expr_ext;
+mod generated;
 pub mod make;
+mod node_ext;
+mod operators;
 pub mod prec;
+mod token_ext;
+mod traits;
 
 use std::marker::PhantomData;
 
diff --git a/crates/syntax/src/lib.rs b/crates/syntax/src/lib.rs
index 21ed1310f56..62a0261d7a4 100644
--- a/crates/syntax/src/lib.rs
+++ b/crates/syntax/src/lib.rs
@@ -32,22 +32,22 @@ macro_rules! eprintln {
     ($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
 }
 
-mod syntax_node;
-mod syntax_error;
 mod parsing;
-mod validation;
 mod ptr;
-mod token_text;
+mod syntax_error;
+mod syntax_node;
 #[cfg(test)]
 mod tests;
+mod token_text;
+mod validation;
 
 pub mod algo;
 pub mod ast;
 #[doc(hidden)]
 pub mod fuzz;
-pub mod utils;
-pub mod ted;
 pub mod hacks;
+pub mod ted;
+pub mod utils;
 
 use std::marker::PhantomData;
 
diff --git a/lib/lsp-server/src/lib.rs b/lib/lsp-server/src/lib.rs
index f717f8e0d4b..e476f8c2d13 100644
--- a/lib/lsp-server/src/lib.rs
+++ b/lib/lsp-server/src/lib.rs
@@ -6,11 +6,11 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-mod msg;
-mod stdio;
 mod error;
-mod socket;
+mod msg;
 mod req_queue;
+mod socket;
+mod stdio;
 
 use std::{
     io,
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 49f8ae79baf..2d40ceb737d 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -12,11 +12,11 @@
 
 mod flags;
 
-mod install;
-mod release;
 mod dist;
-mod publish;
+mod install;
 mod metrics;
+mod publish;
+mod release;
 
 use anyhow::bail;
 use std::{