Skip to content

Commit 8a5829c

Browse files
committed
Re-order mod declarations
1 parent 6cf7b5f commit 8a5829c

File tree

40 files changed

+122
-121
lines changed

40 files changed

+122
-121
lines changed

crates/base-db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
#![warn(rust_2018_idioms, unused_lifetimes)]
44

5-
mod input;
65
mod change;
6+
mod input;
77

88
use std::panic;
99

crates/hir-def/src/body.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Defines `Body`: a lowered representation of bodies of functions, statics and
22
//! consts.
33
mod lower;
4+
mod pretty;
5+
pub mod scope;
46
#[cfg(test)]
57
mod tests;
6-
pub mod scope;
7-
mod pretty;
88

99
use std::ops::Index;
1010

crates/hir-def/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//!
1313
//! See also a neighboring `body` module.
1414
15-
pub mod type_ref;
1615
pub mod format_args;
16+
pub mod type_ref;
1717

1818
use std::fmt;
1919

crates/hir-def/src/macro_expansion_tests/mbe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! Tests specific to declarative macros, aka macros by example. This covers
22
//! both stable `macro_rules!` macros as well as unstable `macro` macros.
33
4-
mod tt_conversion;
54
mod matching;
65
mod meta_syntax;
76
mod metavar_expr;
87
mod regression;
8+
mod tt_conversion;
99

1010
use expect_test::expect;
1111

crates/hir-def/src/macro_expansion_tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
//! write unit-tests (in fact, we used to do that), but that makes tests brittle
1010
//! and harder to understand.
1111
12-
mod mbe;
13-
mod builtin_fn_macro;
1412
mod builtin_derive_macro;
13+
mod builtin_fn_macro;
14+
mod mbe;
1515
mod proc_macros;
1616

1717
use std::{iter, ops::Range, sync};

crates/hir-def/src/nameres.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
//! the result
4949
5050
pub mod attr_resolution;
51-
pub mod proc_macro;
52-
pub mod diagnostics;
5351
mod collector;
52+
pub mod diagnostics;
5453
mod mod_resolution;
5554
mod path_resolution;
55+
pub mod proc_macro;
5656

5757
#[cfg(test)]
5858
mod tests;

crates/hir-expand/src/declarative.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Compiled declarative macro expanders (`macro_rules!`` and `macro`)
12
use std::sync::OnceLock;
23

34
use base_db::{CrateId, Edition, VersionReq};

crates/hir-ty/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Type inference-based diagnostics.
2+
mod decl_check;
23
mod expr;
34
mod match_check;
45
mod unsafe_check;
5-
mod decl_check;
66

77
pub use crate::diagnostics::{
88
decl_check::{incorrect_case, CaseType, IncorrectCase},

crates/hir-ty/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ pub mod mir;
4141
pub mod primitive;
4242
pub mod traits;
4343

44-
#[cfg(test)]
45-
mod tests;
4644
#[cfg(test)]
4745
mod test_db;
46+
#[cfg(test)]
47+
mod tests;
4848

4949
use std::{
5050
collections::hash_map::Entry,

crates/hir-ty/src/mir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ use hir_def::{
2121
};
2222
use la_arena::{Arena, ArenaMap, Idx, RawIdx};
2323

24+
mod borrowck;
2425
mod eval;
2526
mod lower;
26-
mod borrowck;
27-
mod pretty;
2827
mod monomorphization;
28+
mod pretty;
2929

3030
pub use borrowck::{borrowck_query, BorrowckResult, MutabilityReason};
3131
pub use eval::{

crates/hir-ty/src/tests.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
mod never_type;
21
mod coercion;
2+
mod diagnostics;
3+
mod display_source_code;
4+
mod incremental;
5+
mod macros;
6+
mod method_resolution;
7+
mod never_type;
8+
mod patterns;
39
mod regression;
410
mod simple;
5-
mod patterns;
611
mod traits;
7-
mod method_resolution;
8-
mod macros;
9-
mod display_source_code;
10-
mod incremental;
11-
mod diagnostics;
1212

1313
use std::{collections::HashMap, env};
1414

crates/ide-assists/src/lib.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ mod handlers {
111111
mod add_label_to_loop;
112112
mod add_lifetime_to_type;
113113
mod add_missing_impl_members;
114+
mod add_missing_match_arms;
115+
mod add_return_type;
114116
mod add_turbo_fish;
115117
mod apply_demorgan;
116118
mod auto_import;
@@ -124,30 +126,30 @@ mod handlers {
124126
mod convert_iter_for_each_to_for;
125127
mod convert_let_else_to_match;
126128
mod convert_match_to_let_else;
129+
mod convert_named_struct_to_tuple_struct;
127130
mod convert_nested_function_to_closure;
131+
mod convert_to_guarded_return;
128132
mod convert_tuple_return_type_to_struct;
129133
mod convert_tuple_struct_to_named_struct;
130-
mod convert_named_struct_to_tuple_struct;
131-
mod convert_to_guarded_return;
132134
mod convert_two_arm_bool_match_to_matches_macro;
133135
mod convert_while_to_loop;
134-
mod desugar_doc_comment;
135136
mod destructure_tuple_binding;
137+
mod desugar_doc_comment;
136138
mod expand_glob_import;
137139
mod extract_expressions_from_format_string;
138140
mod extract_function;
139141
mod extract_module;
140142
mod extract_struct_from_enum_variant;
141143
mod extract_type_alias;
142144
mod extract_variable;
143-
mod add_missing_match_arms;
144145
mod fix_visibility;
145146
mod flip_binexpr;
146147
mod flip_comma;
147148
mod flip_trait_bound;
148149
mod generate_constant;
149150
mod generate_default_from_enum_variant;
150151
mod generate_default_from_new;
152+
mod generate_delegate_methods;
151153
mod generate_delegate_trait;
152154
mod generate_deref;
153155
mod generate_derive;
@@ -162,62 +164,60 @@ mod handlers {
162164
mod generate_is_empty_from_len;
163165
mod generate_mut_trait_impl;
164166
mod generate_new;
165-
mod generate_delegate_methods;
166167
mod generate_trait_from_impl;
167-
mod add_return_type;
168168
mod inline_call;
169169
mod inline_const_as_literal;
170170
mod inline_local_variable;
171171
mod inline_macro;
172172
mod inline_type_alias;
173+
mod into_to_qualified_from;
174+
mod introduce_named_generic;
173175
mod introduce_named_lifetime;
174176
mod invert_if;
175177
mod merge_imports;
176178
mod merge_match_arms;
179+
mod merge_nested_if;
177180
mod move_bounds;
178181
mod move_const_to_impl;
182+
mod move_from_mod_rs;
179183
mod move_guard;
180184
mod move_module_to_file;
181185
mod move_to_mod_rs;
182-
mod move_from_mod_rs;
183186
mod number_representation;
184187
mod promote_local_to_const;
185188
mod pull_assignment_up;
186-
mod qualify_path;
187189
mod qualify_method_call;
190+
mod qualify_path;
188191
mod raw_string;
189192
mod remove_dbg;
190193
mod remove_mut;
194+
mod remove_parentheses;
191195
mod remove_unused_imports;
192196
mod remove_unused_param;
193-
mod remove_parentheses;
194197
mod reorder_fields;
195198
mod reorder_impl_items;
196-
mod replace_try_expr_with_match;
199+
mod replace_arith_op;
197200
mod replace_derive_with_manual_impl;
198201
mod replace_if_let_with_match;
199202
mod replace_is_method_with_if_let_method;
200-
mod replace_method_eager_lazy;
201-
mod replace_arith_op;
202-
mod introduce_named_generic;
203203
mod replace_let_with_if_let;
204+
mod replace_method_eager_lazy;
204205
mod replace_named_generic_with_impl;
205206
mod replace_qualified_name_with_use;
206207
mod replace_string_with_char;
208+
mod replace_try_expr_with_match;
207209
mod replace_turbofish_with_explicit_type;
208-
mod split_import;
209-
mod unmerge_match_arm;
210-
mod unwrap_tuple;
211210
mod sort_items;
211+
mod split_import;
212212
mod toggle_ignore;
213+
mod unmerge_match_arm;
213214
mod unmerge_use;
214215
mod unnecessary_async;
216+
mod unqualify_method_call;
215217
mod unwrap_block;
216218
mod unwrap_result_return_type;
217-
mod unqualify_method_call;
219+
mod unwrap_tuple;
218220
mod wrap_return_type_in_result;
219-
mod into_to_qualified_from;
220-
mod merge_nested_if;
221221

222222
pub(crate) fn all() -> &'static [Handler] {
223223
&[

crates/ide-assists/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use syntax::{
2323

2424
use crate::assist_context::{AssistContext, SourceChangeBuilder};
2525

26-
pub(crate) mod suggest_name;
2726
mod gen_trait_fn_body;
27+
pub(crate) mod suggest_name;
2828

2929
pub(crate) fn unwrap_trivial_block(block_expr: ast::BlockExpr) -> ast::Expr {
3030
extract_trivial_expression(&block_expr)

crates/ide-completion/src/completions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
33
pub(crate) mod attribute;
44
pub(crate) mod dot;
5+
pub(crate) mod env_vars;
56
pub(crate) mod expr;
67
pub(crate) mod extern_abi;
8+
pub(crate) mod extern_crate;
79
pub(crate) mod field;
810
pub(crate) mod flyimport;
911
pub(crate) mod fn_param;
@@ -19,8 +21,6 @@ pub(crate) mod snippet;
1921
pub(crate) mod r#type;
2022
pub(crate) mod use_;
2123
pub(crate) mod vis;
22-
pub(crate) mod env_vars;
23-
pub(crate) mod extern_crate;
2424

2525
use std::iter;
2626

crates/ide-completion/src/completions/attribute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use crate::{
2525
mod cfg;
2626
mod derive;
2727
mod lint;
28-
mod repr;
2928
mod macro_use;
29+
mod repr;
3030

3131
pub(crate) use self::derive::complete_derive_path;
3232

crates/ide-completion/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ mod context;
88
mod item;
99
mod render;
1010

11+
mod snippet;
1112
#[cfg(test)]
1213
mod tests;
13-
mod snippet;
1414

1515
use ide_db::{
1616
base_db::FilePosition,

crates/ide-completion/src/render.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! `render` module provides utilities for rendering completion suggestions
22
//! into code pieces that will be presented to user.
33
4-
pub(crate) mod macro_;
5-
pub(crate) mod function;
64
pub(crate) mod const_;
5+
pub(crate) mod function;
6+
pub(crate) mod literal;
7+
pub(crate) mod macro_;
78
pub(crate) mod pattern;
89
pub(crate) mod type_alias;
9-
pub(crate) mod variant;
1010
pub(crate) mod union_literal;
11-
pub(crate) mod literal;
11+
pub(crate) mod variant;
1212

1313
use hir::{AsAssocItem, HasAttrs, HirDisplay, ModuleDef, ScopeDef, Type};
1414
use ide_db::{

crates/ide-completion/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ mod attribute;
1212
mod expression;
1313
mod flyimport;
1414
mod fn_param;
15-
mod item_list;
1615
mod item;
16+
mod item_list;
1717
mod pattern;
1818
mod predicate;
1919
mod proc_macros;

crates/ide-db/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mod apply_change;
99
pub mod active_parameter;
1010
pub mod assists;
1111
pub mod defs;
12+
pub mod documentation;
1213
pub mod famous_defs;
1314
pub mod helpers;
1415
pub mod items_locator;
@@ -22,7 +23,6 @@ pub mod symbol_index;
2223
pub mod traits;
2324
pub mod ty_filter;
2425
pub mod use_trivial_constructor;
25-
pub mod documentation;
2626

2727
pub mod imports {
2828
pub mod import_assets;
@@ -35,10 +35,10 @@ pub mod generated {
3535
}
3636

3737
pub mod syntax_helpers {
38-
pub mod node_ext;
39-
pub mod insert_whitespace_into_node;
4038
pub mod format_string;
4139
pub mod format_string_exprs;
40+
pub mod insert_whitespace_into_node;
41+
pub mod node_ext;
4242

4343
pub use parser::LexedStr;
4444
}
@@ -414,6 +414,6 @@ impl SnippetCap {
414414

415415
#[cfg(test)]
416416
mod tests {
417-
mod sourcegen_lints;
418417
mod line_index;
418+
mod sourcegen_lints;
419419
}

0 commit comments

Comments
 (0)