mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-24 06:24:35 +00:00
Fix errors from #22592
This commit is contained in:
parent
d316a34ec2
commit
47e749e5be
@ -1980,7 +1980,7 @@ foo_module!();
|
||||
// the xx binding should bind all of the xx varrefs:
|
||||
for (idx,v) in varrefs.iter().filter(|p| {
|
||||
p.segments.len() == 1
|
||||
&& "xx" == &token::get_ident(p.segments[0].identifier)
|
||||
&& "xx" == &*token::get_ident(p.segments[0].identifier)
|
||||
}).enumerate() {
|
||||
if mtwt::resolve(v.segments[0].identifier) != resolved_binding {
|
||||
println!("uh oh, xx binding didn't match xx varref:");
|
||||
|
@ -827,19 +827,19 @@ mod test {
|
||||
ast::TtDelimited(_, ref macro_delimed)]
|
||||
if name_macro_rules.as_str() == "macro_rules"
|
||||
&& name_zip.as_str() == "zip" => {
|
||||
match ¯o_delimed.tts {
|
||||
match ¯o_delimed.tts[..] {
|
||||
[ast::TtDelimited(_, ref first_delimed),
|
||||
ast::TtToken(_, token::FatArrow),
|
||||
ast::TtDelimited(_, ref second_delimed)]
|
||||
if macro_delimed.delim == token::Paren => {
|
||||
match &first_delimed.tts {
|
||||
match &first_delimed.tts[..] {
|
||||
[ast::TtToken(_, token::Dollar),
|
||||
ast::TtToken(_, token::Ident(name, token::Plain))]
|
||||
if first_delimed.delim == token::Paren
|
||||
&& name.as_str() == "a" => {},
|
||||
_ => panic!("value 3: {:?}", **first_delimed),
|
||||
}
|
||||
match &second_delimed.tts {
|
||||
match &second_delimed.tts[..] {
|
||||
[ast::TtToken(_, token::Dollar),
|
||||
ast::TtToken(_, token::Ident(name, token::Plain))]
|
||||
if second_delimed.delim == token::Paren
|
||||
@ -1207,7 +1207,7 @@ mod test {
|
||||
|
||||
let source = "/// doc comment\r\n/// line 2\r\nfn foo() {}".to_string();
|
||||
let item = parse_item_from_source_str(name.clone(), source, Vec::new(), &sess).unwrap();
|
||||
let docs = item.attrs.iter().filter(|a| &a.name() == "doc")
|
||||
let docs = item.attrs.iter().filter(|a| &*a.name() == "doc")
|
||||
.map(|a| a.value_str().unwrap().to_string()).collect::<Vec<_>>();
|
||||
let b: &[_] = &["/// doc comment".to_string(), "/// line 2".to_string()];
|
||||
assert_eq!(&docs[..], b);
|
||||
|
Loading…
Reference in New Issue
Block a user