Skip to content

Commit

Permalink
Re-order mod declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Jan 27, 2024
1 parent 6cf7b5f commit 8a5829c
Show file tree
Hide file tree
Showing 40 changed files with 122 additions and 121 deletions.
2 changes: 1 addition & 1 deletion crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#![warn(rust_2018_idioms, unused_lifetimes)]

mod input;
mod change;
mod input;

use std::panic;

Expand Down
4 changes: 2 additions & 2 deletions crates/hir-def/src/body.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/macro_expansion_tests/mbe.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
4 changes: 2 additions & 2 deletions crates/hir-def/src/macro_expansion_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-def/src/nameres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions crates/hir-expand/src/declarative.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Compiled declarative macro expanders (`macro_rules!`` and `macro`)
use std::sync::OnceLock;

use base_db::{CrateId, Edition, VersionReq};
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ pub mod mir;
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,
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
14 changes: 7 additions & 7 deletions crates/hir-ty/src/tests.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
38 changes: 19 additions & 19 deletions crates/ide-assists/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -124,30 +126,30 @@ 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;
mod extract_module;
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;
mod flip_trait_bound;
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;
Expand All @@ -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] {
&[
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-assists/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crates/ide-completion/src/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/ide-completion/src/completions/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/ide-completion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ mod context;
mod item;
mod render;

mod snippet;
#[cfg(test)]
mod tests;
mod snippet;

use ide_db::{
base_db::FilePosition,
Expand Down
8 changes: 4 additions & 4 deletions crates/ide-completion/src/render.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-completion/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions crates/ide-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -414,6 +414,6 @@ impl SnippetCap {

#[cfg(test)]
mod tests {
mod sourcegen_lints;
mod line_index;
mod sourcegen_lints;
}
Loading

0 comments on commit 8a5829c

Please sign in to comment.