File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
compiler/rustc_middle/src/middle Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -51,25 +51,14 @@ fn get_limit(
5151 name : Symbol ,
5252 default : Limit ,
5353) -> Limit {
54- match get_limit_size ( krate_attrs, sess, name) {
55- Some ( size) => Limit :: new ( size) ,
56- None => default,
57- }
58- }
59-
60- pub fn get_limit_size (
61- krate_attrs : & [ impl AttributeExt ] ,
62- sess : & Session ,
63- name : Symbol ,
64- ) -> Option < usize > {
6554 for attr in krate_attrs {
6655 if !attr. has_name ( name) {
6756 continue ;
6857 }
6958
7059 if let Some ( sym) = attr. value_str ( ) {
7160 match sym. as_str ( ) . parse ( ) {
72- Ok ( n) => return Some ( n) ,
61+ Ok ( n) => return Limit :: new ( n) ,
7362 Err ( e) => {
7463 let error_str = match e. kind ( ) {
7564 IntErrorKind :: PosOverflow => "`limit` is too large" ,
@@ -90,5 +79,5 @@ pub fn get_limit_size(
9079 }
9180 }
9281 }
93- None
82+ default
9483}
You can’t perform that action at this time.
0 commit comments