@@ -1835,29 +1835,31 @@ fn decode_item_ast(par_doc: rbml::Doc) -> ast::Item {
1835
1835
}
1836
1836
1837
1837
#[ cfg( test) ]
1838
- trait fake_ext_ctxt {
1838
+ trait FakeExtCtxt {
1839
+ fn call_site ( & self ) -> codemap:: Span ;
1839
1840
fn cfg ( & self ) -> ast:: CrateConfig ;
1840
- fn parse_sess < ' a > ( & ' a self ) -> & ' a parse:: ParseSess ;
1841
- fn call_site ( & self ) -> Span ;
1842
1841
fn ident_of ( & self , st : & str ) -> ast:: Ident ;
1842
+ fn name_of ( & self , st : & str ) -> ast:: Name ;
1843
+ fn parse_sess ( & self ) -> & parse:: ParseSess ;
1843
1844
}
1844
1845
1845
1846
#[ cfg( test) ]
1846
- impl fake_ext_ctxt for parse:: ParseSess {
1847
- fn cfg ( & self ) -> ast:: CrateConfig {
1848
- Vec :: new ( )
1849
- }
1850
- fn parse_sess < ' a > ( & ' a self ) -> & ' a parse:: ParseSess { self }
1851
- fn call_site ( & self ) -> Span {
1847
+ impl FakeExtCtxt for parse:: ParseSess {
1848
+ fn call_site ( & self ) -> codemap:: Span {
1852
1849
codemap:: Span {
1853
1850
lo : codemap:: BytePos ( 0 ) ,
1854
1851
hi : codemap:: BytePos ( 0 ) ,
1855
- expn_id : codemap:: NO_EXPANSION
1852
+ expn_id : codemap:: NO_EXPANSION ,
1856
1853
}
1857
1854
}
1855
+ fn cfg ( & self ) -> ast:: CrateConfig { Vec :: new ( ) }
1858
1856
fn ident_of ( & self , st : & str ) -> ast:: Ident {
1859
- token:: str_to_ident ( st)
1857
+ parse:: token:: str_to_ident ( st)
1858
+ }
1859
+ fn name_of ( & self , st : & str ) -> ast:: Name {
1860
+ parse:: token:: intern ( st)
1860
1861
}
1862
+ fn parse_sess ( & self ) -> & parse:: ParseSess { self }
1861
1863
}
1862
1864
1863
1865
#[ cfg( test) ]
@@ -1883,15 +1885,14 @@ fn test_basic() {
1883
1885
fn foo( ) { }
1884
1886
) ) ;
1885
1887
}
1886
- /* NOTE: When there's a snapshot, update this (yay quasiquoter!)
1888
+
1887
1889
#[ test]
1888
1890
fn test_smalltalk ( ) {
1889
1891
let cx = mk_ctxt ( ) ;
1890
1892
roundtrip ( quote_item ! ( & cx,
1891
1893
fn foo( ) -> isize { 3 + 4 } // first smalltalk program ever executed.
1892
1894
) ) ;
1893
1895
}
1894
- */
1895
1896
1896
1897
#[ test]
1897
1898
fn test_more ( ) {
0 commit comments