about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille Gillot <gillot.camille@gmail.com>2021-09-13 20:43:43 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-09-30 17:40:17 +0200
commit77c300285c0528241b2b08823167598739fc0f82 (patch)
tree8892fec899c53ed83c83754078cb341618ae6e3d
parent659b0a2fd94440c9429fff6ec9967990b219caf0 (diff)
downloadrust-77c300285c0528241b2b08823167598739fc0f82.tar.gz
rust-77c300285c0528241b2b08823167598739fc0f82.zip
Apply suggestions from code review
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
-rw-r--r--compiler/rustc_hir/src/hir.rs2
-rw-r--r--compiler/rustc_middle/src/hir/map/mod.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 21089b0208d..4ef3a699d3d 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -671,7 +671,7 @@ pub struct Crate<'hir> {
     pub attrs: BTreeMap<HirId, &'hir [Attribute]>,
 }
 
-impl<'hir> Crate<'hir> {
+impl Crate<'hir> {
     pub fn module(&self) -> &'hir Mod<'hir> {
         if let Some(OwnerNode::Crate(m)) = self.owners[CRATE_DEF_ID] { m } else { panic!() }
     }
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs
index 3989a94a47c..e6f56b0be93 100644
--- a/compiler/rustc_middle/src/hir/map/mod.rs
+++ b/compiler/rustc_middle/src/hir/map/mod.rs
@@ -160,7 +160,7 @@ impl<'hir> Map<'hir> {
     pub fn root_module(&self) -> &'hir Mod<'hir> {
         match self.tcx.hir_owner(CRATE_DEF_ID).map(|o| o.node) {
             Some(OwnerNode::Crate(item)) => item,
-            _ => panic!(),
+            _ => bug!(),
         }
     }