Skip to content

Commit 7e53e46

Browse files
committed
Move rustc_middle::middle::limits to rustc_crate.
1 parent 73b0059 commit 7e53e46

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

compiler/rustc_crate/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use rustc_span::symbol::Symbol;
1313
pub mod codegen_fn_attrs;
1414
pub mod cstore;
1515
pub mod dependency_format;
16+
pub mod limits;
1617

1718
#[derive(HashStable_Generic)]
1819
pub struct LibFeatures {

compiler/rustc_middle/src/middle/limits.rs renamed to compiler/rustc_crate/src/limits.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
66
//! just peeks and looks for that attribute.
77
8-
use crate::bug;
98
use rustc_ast as ast;
109
use rustc_data_structures::sync::OnceCell;
1110
use rustc_session::{Limit, Session};
@@ -52,10 +51,10 @@ fn update_limit(
5251
IntErrorKind::Empty => "`limit` must be a non-negative integer",
5352
IntErrorKind::InvalidDigit => "not a valid integer",
5453
IntErrorKind::NegOverflow => {
55-
bug!("`limit` should never negatively overflow")
54+
panic!("`limit` should never negatively overflow")
5655
}
57-
IntErrorKind::Zero => bug!("zero is a valid `limit`"),
58-
kind => bug!("unimplemented IntErrorKind variant: {:?}", kind),
56+
IntErrorKind::Zero => panic!("zero is a valid `limit`"),
57+
kind => panic!("unimplemented IntErrorKind variant: {:?}", kind),
5958
};
6059

6160
err.span_label(value_span, error_str);

compiler/rustc_interface/src/passes.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use rustc_hir::Crate;
1919
use rustc_lint::LintStore;
2020
use rustc_middle::arena::Arena;
2121
use rustc_middle::dep_graph::DepGraph;
22-
use rustc_middle::middle;
2322
use rustc_middle::ty::query::Providers;
2423
use rustc_middle::ty::{self, GlobalCtxt, ResolverOutputs, TyCtxt};
2524
use rustc_mir as mir;
@@ -186,7 +185,7 @@ pub fn register_plugins<'a>(
186185
}
187186

188187
sess.time("recursion_limit", || {
189-
middle::limits::update_limits(sess, &krate);
188+
rustc_crate::limits::update_limits(sess, &krate);
190189
});
191190

192191
let mut lint_store = rustc_lint::new_lint_store(

compiler/rustc_middle/src/middle/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use rustc_span::def_id::{CrateNum, LOCAL_CRATE};
44

55
pub mod exported_symbols;
66
pub mod lang_items;
7-
pub mod limits;
87
pub mod privacy;
98
pub mod region;
109
pub mod resolve_lifetime;

0 commit comments

Comments
 (0)