Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce clone of input tokenstream if contains no paste #86

Merged
merged 3 commits into from Aug 31, 2022
Merged

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Aug 31, 2022

This is a partial mitigation for #85. It only helps if the entire macro input contains no pastes [<>], such as in the minimal repro in that issue. Every other case involving Delimiter::None still remains broken due to rust-lang/rust#67062.

    error[E0507]: cannot move out of a shared reference
       --> tests/test_expr.rs:269:5
        |
    269 |     clone!(&A).consume_self();
        |     ^^^^^^^^^^^--------------
        |     |          |
        |     |          value moved due to this method call
        |     move occurs because value has type `A`, which does not implement the `Copy` trait
        |
    note: this function takes ownership of the receiver `self`, which moves value
       --> tests/test_expr.rs:266:25
        |
    266 |         fn consume_self(self) {}
        |                         ^^^^
    error: unused `self` argument
       --> tests/test_expr.rs:266:25
        |
    266 |         fn consume_self(self) {}
        |                         ^^^^
        |
        = note: `-D clippy::unused-self` implied by `-D clippy::pedantic`
        = help: consider refactoring to a associated function
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
@dtolnay dtolnay merged commit 671460b into master Aug 31, 2022
@dtolnay dtolnay deleted the clone branch August 31, 2022 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant