File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -951,7 +951,7 @@ enum RibKind<'a> {
951951 TraitOrImplItemRibKind ,
952952
953953 /// 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.
955955 FnItemRibKind ,
956956
957957 /// We passed through an item scope. Disallow upvars.
@@ -3924,19 +3924,16 @@ impl<'a> Resolver<'a> {
39243924 ribs. next ( ) ;
39253925 }
39263926 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+ ) ;
39383935 }
3939- _ => { }
3936+ return Def :: Err ;
39403937 }
39413938 }
39423939 }
You can’t perform that action at this time.
0 commit comments