File tree 1 file changed +10
-13
lines changed
1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -951,7 +951,7 @@ enum RibKind<'a> {
951
951
TraitOrImplItemRibKind ,
952
952
953
953
/// We passed through a function definition. Disallow upvars.
954
- /// Permit only those const parameters specified in the function's generics.
954
+ /// Permit only those const parameters that are specified in the function's generics.
955
955
FnItemRibKind ,
956
956
957
957
/// We passed through an item scope. Disallow upvars.
@@ -3924,19 +3924,16 @@ impl<'a> Resolver<'a> {
3924
3924
ribs. next ( ) ;
3925
3925
}
3926
3926
for rib in ribs {
3927
- match rib. kind {
3928
- ItemRibKind | FnItemRibKind => {
3929
- // This was an attempt to use a const parameter outside its scope.
3930
- if record_used {
3931
- resolve_error (
3932
- self ,
3933
- span,
3934
- ResolutionError :: GenericParamsFromOuterFunction ( def) ,
3935
- ) ;
3936
- }
3937
- return Def :: Err ;
3927
+ if let ItemRibKind | FnItemRibKind = rib. kind {
3928
+ // This was an attempt to use a const parameter outside its scope.
3929
+ if record_used {
3930
+ resolve_error (
3931
+ self ,
3932
+ span,
3933
+ ResolutionError :: GenericParamsFromOuterFunction ( def) ,
3934
+ ) ;
3938
3935
}
3939
- _ => { }
3936
+ return Def :: Err ;
3940
3937
}
3941
3938
}
3942
3939
}
You can’t perform that action at this time.
0 commit comments