Update test suite to nightly-2022-05-20

error[E0277]: the trait bound `&rustc_ast::tokenstream::TokenTree: SpanlessEq` is not satisfied
       --> tests/common/eq.rs:510:16
        |
    510 |             if SpanlessEq::eq(&this, &other) {
        |                ^^^^^^^^^^^^^^ the trait `SpanlessEq` is not implemented for `&rustc_ast::tokenstream::TokenTree`
        |
        = help: the trait `SpanlessEq` is implemented for `rustc_ast::tokenstream::TokenTree`

    error[E0271]: type mismatch resolving `<CursorRef<'_> as Iterator>::Item == rustc_ast::tokenstream::TokenTree`
       --> tests/common/eq.rs:519:25
        |
    519 |                         doc_comment(*style, *symbol, &mut other_trees)
        |                         ^^^^^^^^^^^ expected enum `rustc_ast::tokenstream::TokenTree`, found `&rustc_ast::tokenstream::TokenTree`
        |
    note: required by a bound in `doc_comment`
       --> tests/common/eq.rs:537:31
        |
    534 | fn doc_comment(
        |    ----------- required by a bound in this
    ...
    537 |     trees: &mut impl Iterator<Item = TokenTree>,
        |                               ^^^^^^^^^^^^^^^^ required by this bound in `doc_comment`

    error[E0271]: type mismatch resolving `<CursorRef<'_> as Iterator>::Item == rustc_ast::tokenstream::TokenTree`
       --> tests/common/eq.rs:522:25
        |
    522 |                         doc_comment(*style, *symbol, &mut this_trees)
        |                         ^^^^^^^^^^^ expected enum `rustc_ast::tokenstream::TokenTree`, found `&rustc_ast::tokenstream::TokenTree`
        |
    note: required by a bound in `doc_comment`
       --> tests/common/eq.rs:537:31
        |
    534 | fn doc_comment(
        |    ----------- required by a bound in this
    ...
    537 |     trees: &mut impl Iterator<Item = TokenTree>,
        |                               ^^^^^^^^^^^^^^^^ required by this bound in `doc_comment`

    error[E0277]: can't compare `&Symbol` with `Symbol`
       --> tests/common/eq.rs:560:23
        |
    560 |         })) if symbol == sym::doc => {}
        |                       ^^ no implementation for `&Symbol == Symbol`
        |
        = help: the trait `PartialEq<Symbol>` is not implemented for `&Symbol`
        = help: the trait `PartialEq` is implemented for `Symbol`
This commit is contained in:
David Tolnay 2022-05-19 20:59:48 -07:00
parent 50805a96c5
commit e077055f48
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -507,7 +507,7 @@ impl SpanlessEq for TokenStream {
None => return false,
Some(tree) => tree,
};
if SpanlessEq::eq(&this, &other) {
if SpanlessEq::eq(this, other) {
continue;
}
if let (TokenTree::Token(this), TokenTree::Token(other)) = (this, other) {
@ -531,10 +531,10 @@ impl SpanlessEq for TokenStream {
}
}
fn doc_comment(
fn doc_comment<'a>(
style: AttrStyle,
unescaped: Symbol,
trees: &mut impl Iterator<Item = TokenTree>,
trees: &mut impl Iterator<Item = &'a TokenTree>,
) -> bool {
if match style {
AttrStyle::Outer => false,
@ -557,7 +557,7 @@ fn doc_comment(
Some(TokenTree::Token(Token {
kind: TokenKind::Ident(symbol, false),
span: _,
})) if symbol == sym::doc => {}
})) if *symbol == sym::doc => {}
_ => return false,
}
match trees.next() {