File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
compiler/rustc_middle/src/middle Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11//! Registering limits:
2- //! * recursion_limit,
3- //! * move_size_limit, and
4- //! * type_length_limit
2+ //! - recursion_limit: there are various parts of the compiler that must impose arbitrary limits
3+ //! on how deeply they recurse to prevent stack overflow.
4+ //! - move_size_limit
5+ //! - type_length_limit
6+ //! - pattern_complexity_limit
57//!
6- //! There are various parts of the compiler that must impose arbitrary limits
7- //! on how deeply they recurse to prevent stack overflow. Users can override
8- //! this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
9- //! just peeks and looks for that attribute.
8+ //! Users can override these limits via an attribute on the crate like
9+ //! `#![recursion_limit="22"]`. This pass just looks for those attributes.
1010
1111use std:: num:: IntErrorKind ;
1212
@@ -41,6 +41,7 @@ pub fn provide(providers: &mut Providers) {
4141 }
4242}
4343
44+ // This one is separate because it must be read prior to macro expansion.
4445pub fn get_recursion_limit ( krate_attrs : & [ impl AttributeExt ] , sess : & Session ) -> Limit {
4546 get_limit ( krate_attrs, sess, sym:: recursion_limit, Limit :: new ( 128 ) )
4647}
You can’t perform that action at this time.
0 commit comments