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(
51
51
name : Symbol ,
52
52
default : Limit ,
53
53
) -> 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 > {
65
54
for attr in krate_attrs {
66
55
if !attr. has_name ( name) {
67
56
continue ;
68
57
}
69
58
70
59
if let Some ( sym) = attr. value_str ( ) {
71
60
match sym. as_str ( ) . parse ( ) {
72
- Ok ( n) => return Some ( n) ,
61
+ Ok ( n) => return Limit :: new ( n) ,
73
62
Err ( e) => {
74
63
let error_str = match e. kind ( ) {
75
64
IntErrorKind :: PosOverflow => "`limit` is too large" ,
@@ -90,5 +79,5 @@ pub fn get_limit_size(
90
79
}
91
80
}
92
81
}
93
- None
82
+ default
94
83
}
You can’t perform that action at this time.
0 commit comments