Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres.rs')
| -rw-r--r-- | crates/hir-def/src/nameres.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/hir-def/src/nameres.rs b/crates/hir-def/src/nameres.rs index c67046dfda..3949fbb6e7 100644 --- a/crates/hir-def/src/nameres.rs +++ b/crates/hir-def/src/nameres.rs @@ -48,8 +48,8 @@ //! the result pub mod attr_resolution; -pub mod diagnostics; mod collector; +pub mod diagnostics; mod mod_resolution; mod path_resolution; mod proc_macro; @@ -57,10 +57,11 @@ mod proc_macro; #[cfg(test)] mod tests; -use std::sync::Arc; +use std::{cmp::Ord, sync::Arc}; use base_db::{CrateId, Edition, FileId}; use hir_expand::{name::Name, InFile, MacroDefId}; +use itertools::Itertools; use la_arena::Arena; use profile::Count; use rustc_hash::FxHashMap; @@ -431,7 +432,9 @@ impl DefMap { map.modules[module].scope.dump(buf); - for (name, child) in map.modules[module].children.iter() { + for (name, child) in + map.modules[module].children.iter().sorted_by(|a, b| Ord::cmp(&a.0, &b.0)) + { let path = format!("{}::{}", path, name); buf.push('\n'); go(buf, map, &path, *child); |