Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres/tests/macros.rs')
| -rw-r--r-- | crates/hir-def/src/nameres/tests/macros.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir-def/src/nameres/tests/macros.rs b/crates/hir-def/src/nameres/tests/macros.rs index a5fd0488e7..c8eb968b35 100644 --- a/crates/hir-def/src/nameres/tests/macros.rs +++ b/crates/hir-def/src/nameres/tests/macros.rs @@ -784,7 +784,7 @@ macro_rules! foo { pub use core::clone::Clone; "#, - |map| assert_eq!(map.modules[DefMap::ROOT].scope.impls().len(), 1), + |map| assert_eq!(map.modules[map.root].scope.impls().len(), 1), ); } @@ -806,7 +806,7 @@ pub macro Copy {} #[rustc_builtin_macro] pub macro Clone {} "#, - |map| assert_eq!(map.modules[DefMap::ROOT].scope.impls().len(), 2), + |map| assert_eq!(map.modules[map.root].scope.impls().len(), 2), ); } @@ -849,7 +849,7 @@ pub macro derive($item:item) {} #[rustc_builtin_macro] pub macro Clone {} "#, - |map| assert_eq!(map.modules[DefMap::ROOT].scope.impls().len(), 1), + |map| assert_eq!(map.modules[map.root].scope.impls().len(), 1), ); } @@ -1502,7 +1502,7 @@ fn proc_attr(a: TokenStream, b: TokenStream) -> TokenStream { a } let krate = *db.all_crates().last().expect("no crate graph present"); let def_map = crate_def_map(&db, krate); - let root_module = &def_map[DefMap::ROOT].scope; + let root_module = &def_map[def_map.root].scope; assert!( root_module.legacy_macros().count() == 0, "`#[macro_use]` shouldn't bring macros into textual macro scope", @@ -1609,7 +1609,7 @@ macro_rules! derive { () => {} } #[derive(Clone)] struct S; "#, - |map| assert_eq!(map.modules[DefMap::ROOT].scope.impls().len(), 1), + |map| assert_eq!(map.modules[map.root].scope.impls().len(), 1), ); } |