Improve comments about limits.
This commit is contained in:
parent
30b8c84de6
commit
13280eed6a
1 changed files with 8 additions and 7 deletions
|
@ -1,12 +1,12 @@
|
|||
//! Registering limits:
|
||||
//! * recursion_limit,
|
||||
//! * move_size_limit, and
|
||||
//! * type_length_limit
|
||||
//! - recursion_limit: there are various parts of the compiler that must impose arbitrary limits
|
||||
//! on how deeply they recurse to prevent stack overflow.
|
||||
//! - move_size_limit
|
||||
//! - type_length_limit
|
||||
//! - pattern_complexity_limit
|
||||
//!
|
||||
//! There are various parts of the compiler that must impose arbitrary limits
|
||||
//! on how deeply they recurse to prevent stack overflow. Users can override
|
||||
//! this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
|
||||
//! just peeks and looks for that attribute.
|
||||
//! Users can override these limits via an attribute on the crate like
|
||||
//! `#![recursion_limit="22"]`. This pass just looks for those attributes.
|
||||
|
||||
use std::num::IntErrorKind;
|
||||
|
||||
|
@ -41,6 +41,7 @@ pub fn provide(providers: &mut Providers) {
|
|||
}
|
||||
}
|
||||
|
||||
// This one is separate because it must be read prior to macro expansion.
|
||||
pub fn get_recursion_limit(krate_attrs: &[impl AttributeExt], sess: &Session) -> Limit {
|
||||
get_limit(krate_attrs, sess, sym::recursion_limit, Limit::new(128))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue