File tree Expand file tree Collapse file tree 4 files changed +49
-5
lines changed Expand file tree Collapse file tree 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> {
16161616 fn next ( & mut self ) -> Option < & ' a str > { self . inner . next ( ) }
16171617 #[ inline]
16181618 fn size_hint ( & self ) -> ( uint , Option < uint > ) { self . inner . size_hint ( ) }
1619+ }
16191620
1620- #[ stable] }
1621+ #[ stable]
16211622impl < ' a > DoubleEndedIterator for Lines < ' a > {
16221623 #[ inline]
16231624 fn next_back ( & mut self ) -> Option < & ' a str > { self . inner . next_back ( ) }
1625+ }
16241626
1625- #[ stable] }
1627+ #[ stable]
16261628impl < ' a > Iterator for LinesAny < ' a > {
16271629 type Item = & ' a str ;
16281630
16291631 #[ inline]
16301632 fn next ( & mut self ) -> Option < & ' a str > { self . inner . next ( ) }
16311633 #[ inline]
16321634 fn size_hint ( & self ) -> ( uint , Option < uint > ) { self . inner . size_hint ( ) }
1635+ }
16331636
1634- #[ stable] }
1637+ #[ stable]
16351638impl < ' a > DoubleEndedIterator for LinesAny < ' a > {
16361639 #[ inline]
16371640 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> {
47694769 self . expect ( & token:: OpenDelim ( token:: Brace ) ) ;
47704770 let ( inner_attrs, mut method_attrs) =
47714771 self . parse_inner_attrs_and_next ( ) ;
4772- while ! self . eat ( & token :: CloseDelim ( token :: Brace ) ) {
4772+ loop {
47734773 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+
47744778 let vis = self . parse_visibility ( ) ;
47754779 if self . eat_keyword ( keywords:: Type ) {
47764780 impl_items. push ( TypeImplItem ( P ( self . parse_typedef (
@@ -4781,7 +4785,7 @@ impl<'a> Parser<'a> {
47814785 method_attrs,
47824786 vis) ) ) ;
47834787 }
4784- method_attrs = self . parse_outer_attributes ( ) ;
4788+ method_attrs = vec ! [ ] ;
47854789 }
47864790 ( impl_items, inner_attrs)
47874791 }
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