Skip to content

Commit 2fc02a9

Browse files
committed
---
yaml --- r: 216243 b: refs/heads/stable c: 24ef905 h: refs/heads/master i: 216241: 8f18c3c 216239: 437e181 v: v3
1 parent d94ba08 commit 2fc02a9

File tree

3 files changed

+31
-57
lines changed

3 files changed

+31
-57
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: ea892dc70b1a773b85410716b5822cc814542ecc
32+
refs/heads/stable: 24ef90527351bb1a52c8b54e948cdbba8db3eef6
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/src/test/compile-fail-fulldeps/qquote.rs

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,25 @@
1515
extern crate syntax;
1616

1717
use syntax::ast;
18-
use syntax::codemap;
18+
use syntax::codemap::{self, DUMMY_SP};
1919
use syntax::parse;
2020
use syntax::print::pprust;
2121

22-
trait FakeExtCtxt {
23-
fn call_site(&self) -> codemap::Span;
24-
fn cfg(&self) -> ast::CrateConfig;
25-
fn ident_of(&self, st: &str) -> ast::Ident;
26-
fn name_of(&self, st: &str) -> ast::Name;
27-
fn parse_sess(&self) -> &parse::ParseSess;
28-
}
29-
30-
impl FakeExtCtxt for parse::ParseSess {
31-
fn call_site(&self) -> codemap::Span {
32-
codemap::Span {
33-
lo: codemap::BytePos(0),
34-
hi: codemap::BytePos(0),
35-
expn_id: codemap::NO_EXPANSION,
36-
}
37-
}
38-
fn cfg(&self) -> ast::CrateConfig { Vec::new() }
39-
fn ident_of(&self, st: &str) -> ast::Ident {
40-
parse::token::str_to_ident(st)
41-
}
42-
fn name_of(&self, st: &str) -> ast::Name {
43-
parse::token::intern(st)
44-
}
45-
fn parse_sess(&self) -> &parse::ParseSess { self }
46-
}
47-
4822
fn main() {
49-
let cx = parse::new_parse_sess();
23+
let ps = syntax::parse::new_parse_sess();
24+
let mut cx = syntax::ext::base::ExtCtxt::new(
25+
&ps, vec![],
26+
syntax::ext::expand::ExpansionConfig::default("qquote".to_string()));
27+
cx.bt_push(syntax::codemap::ExpnInfo {
28+
call_site: DUMMY_SP,
29+
callee: syntax::codemap::NameAndSpan {
30+
name: "".to_string(),
31+
format: syntax::codemap::MacroBang,
32+
allow_internal_unstable: false,
33+
span: None,
34+
}
35+
});
36+
let cx = &mut cx;
5037

5138
assert_eq!(pprust::expr_to_string(&*quote_expr!(&cx, 23)), "23");
5239

branches/stable/src/test/run-fail/qquote.rs

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,25 @@
1717
extern crate syntax;
1818

1919
use syntax::ast;
20-
use syntax::codemap;
20+
use syntax::codemap::{self, DUMMY_SP};
2121
use syntax::parse;
2222
use syntax::print::pprust;
2323

24-
trait FakeExtCtxt {
25-
fn call_site(&self) -> codemap::Span;
26-
fn cfg(&self) -> ast::CrateConfig;
27-
fn ident_of(&self, st: &str) -> ast::Ident;
28-
fn name_of(&self, st: &str) -> ast::Name;
29-
fn parse_sess(&self) -> &parse::ParseSess;
30-
}
31-
32-
impl FakeExtCtxt for parse::ParseSess {
33-
fn call_site(&self) -> codemap::Span {
34-
codemap::Span {
35-
lo: codemap::BytePos(0),
36-
hi: codemap::BytePos(0),
37-
expn_id: codemap::NO_EXPANSION,
38-
}
39-
}
40-
fn cfg(&self) -> ast::CrateConfig { Vec::new() }
41-
fn ident_of(&self, st: &str) -> ast::Ident {
42-
parse::token::str_to_ident(st)
43-
}
44-
fn name_of(&self, st: &str) -> ast::Name {
45-
parse::token::intern(st)
46-
}
47-
fn parse_sess(&self) -> &parse::ParseSess { self }
48-
}
49-
5024
fn main() {
51-
let cx = parse::new_parse_sess();
25+
let ps = syntax::parse::new_parse_sess();
26+
let mut cx = syntax::ext::base::ExtCtxt::new(
27+
&ps, vec![],
28+
syntax::ext::expand::ExpansionConfig::default("qquote".to_string()));
29+
cx.bt_push(syntax::codemap::ExpnInfo {
30+
call_site: DUMMY_SP,
31+
callee: syntax::codemap::NameAndSpan {
32+
name: "".to_string(),
33+
format: syntax::codemap::MacroBang,
34+
allow_internal_unstable: false,
35+
span: None,
36+
}
37+
});
38+
let cx = &mut cx;
5239

5340
assert_eq!(pprust::expr_to_string(&*quote_expr!(&cx, 23)), "23");
5441

0 commit comments

Comments
 (0)