File tree 4 files changed +49
-5
lines changed
4 files changed +49
-5
lines changed Original file line number Diff line number Diff line change @@ -1616,22 +1616,25 @@ impl<'a> Iterator for Lines<'a> {
1616
1616
fn next ( & mut self ) -> Option < & ' a str > { self . inner . next ( ) }
1617
1617
#[ inline]
1618
1618
fn size_hint ( & self ) -> ( uint , Option < uint > ) { self . inner . size_hint ( ) }
1619
+ }
1619
1620
1620
- #[ stable] }
1621
+ #[ stable]
1621
1622
impl < ' a > DoubleEndedIterator for Lines < ' a > {
1622
1623
#[ inline]
1623
1624
fn next_back ( & mut self ) -> Option < & ' a str > { self . inner . next_back ( ) }
1625
+ }
1624
1626
1625
- #[ stable] }
1627
+ #[ stable]
1626
1628
impl < ' a > Iterator for LinesAny < ' a > {
1627
1629
type Item = & ' a str ;
1628
1630
1629
1631
#[ inline]
1630
1632
fn next ( & mut self ) -> Option < & ' a str > { self . inner . next ( ) }
1631
1633
#[ inline]
1632
1634
fn size_hint ( & self ) -> ( uint , Option < uint > ) { self . inner . size_hint ( ) }
1635
+ }
1633
1636
1634
- #[ stable] }
1637
+ #[ stable]
1635
1638
impl < ' a > DoubleEndedIterator for LinesAny < ' a > {
1636
1639
#[ inline]
1637
1640
fn next_back ( & mut self ) -> Option < & ' a str > { self . inner . next_back ( ) }
Original file line number Diff line number Diff line change @@ -4769,8 +4769,12 @@ impl<'a> Parser<'a> {
4769
4769
self . expect ( & token:: OpenDelim ( token:: Brace ) ) ;
4770
4770
let ( inner_attrs, mut method_attrs) =
4771
4771
self . parse_inner_attrs_and_next ( ) ;
4772
- while ! self . eat ( & token :: CloseDelim ( token :: Brace ) ) {
4772
+ loop {
4773
4773
method_attrs. extend ( self . parse_outer_attributes ( ) . into_iter ( ) ) ;
4774
+ if method_attrs. is_empty ( ) && self . eat ( & token:: CloseDelim ( token:: Brace ) ) {
4775
+ break ;
4776
+ }
4777
+
4774
4778
let vis = self . parse_visibility ( ) ;
4775
4779
if self . eat_keyword ( keywords:: Type ) {
4776
4780
impl_items. push ( TypeImplItem ( P ( self . parse_typedef (
@@ -4781,7 +4785,7 @@ impl<'a> Parser<'a> {
4781
4785
method_attrs,
4782
4786
vis) ) ) ;
4783
4787
}
4784
- method_attrs = self . parse_outer_attributes ( ) ;
4788
+ method_attrs = vec ! [ ] ;
4785
4789
}
4786
4790
( impl_items, inner_attrs)
4787
4791
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ struct Foo ;
12
+
13
+ impl Foo {
14
+ fn foo ( ) { }
15
+
16
+ #[ stable]
17
+ } //~ ERROR expected `fn`, found `}`
18
+
19
+ fn main ( ) { }
20
+
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ struct Foo ;
12
+
13
+ impl Foo {
14
+ #[ stable]
15
+ } //~ ERROR expected `fn`, found `}`
16
+
17
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments