File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
compiler/rustc_parse/src/parser
tests/ui/ergonomic-clones/closure Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -813,9 +813,9 @@ impl<'a> Parser<'a> {
813
813
self . is_keyword_ahead ( 0 , & [ kw:: Const ] )
814
814
&& self . look_ahead ( 1 , |t| match & t. kind {
815
815
// async closures do not work with const closures, so we do not parse that here.
816
- token:: Ident ( kw:: Move | kw:: Static , IdentIsRaw :: No ) | token :: OrOr | token :: Or => {
817
- true
818
- }
816
+ token:: Ident ( kw:: Move | kw:: Use | kw :: Static , IdentIsRaw :: No )
817
+ | token :: OrOr
818
+ | token :: Or => true ,
819
819
_ => false ,
820
820
} )
821
821
}
Original file line number Diff line number Diff line change
1
+ //@ check-pass
2
+
3
+ #![ feature( const_closures) ]
4
+ #![ feature( ergonomic_clones) ]
5
+ #![ allow( incomplete_features) ]
6
+
7
+ const fn foo ( ) {
8
+ let cl = const use || { } ;
9
+ }
10
+
11
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments