diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-04-03 17:49:59 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-04-03 19:06:22 +0300 |
| commit | b40ea03f8a9a94c294679b9f261b86ded120454f (patch) | |
| tree | 18e32ab93e0d4506cc8c973e3be253ebe079c03f /compiler/rustc_resolve/src | |
| parent | ceab6128fa48a616bfd3e3adf4bc80133b8ee223 (diff) | |
| download | rust-b40ea03f8a9a94c294679b9f261b86ded120454f.tar.gz rust-b40ea03f8a9a94c294679b9f261b86ded120454f.zip | |
rustc_index: Add a `ZERO` constant to index types
It is commonly used.
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/imports.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 48711f43518..76fe36a77cb 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -532,7 +532,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { let mut seen_spans = FxHashSet::default(); let mut errors = vec![]; - let mut prev_root_id: NodeId = NodeId::from_u32(0); + let mut prev_root_id: NodeId = NodeId::ZERO; let determined_imports = mem::take(&mut self.determined_imports); let indeterminate_imports = mem::take(&mut self.indeterminate_imports); @@ -556,8 +556,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { } } - if prev_root_id.as_u32() != 0 - && prev_root_id.as_u32() != import.root_id.as_u32() + if prev_root_id != NodeId::ZERO + && prev_root_id != import.root_id && !errors.is_empty() { // In the case of a new import line, throw a diagnostic message |
