close
The Wayback Machine - https://web.archive.org/web/20200824074429/https://github.com/dtolnay/proc-macro-workshop/pull/35
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

sorted: update 02-not-enum.stderr #35

Merged
merged 1 commit into from Aug 15, 2020
Merged

Conversation

@suyash
Copy link
Contributor

suyash commented Aug 15, 2020

On my machine I am seeing an additional message on trying to implement the second test for sorted.

My implementation

#[proc_macro_attribute]
pub fn sorted(args: TokenStream, input: TokenStream) -> TokenStream {
    let item = parse_macro_input!(input as Item);

    match item {
        Item::Enum(item) => {
            let stream = quote! { #item };
            stream.into()
        }
        _ => Error::new_spanned(
            TokenStream2::from(args),
            "expected enum or match expression",
        )
        .to_compile_error()
        .into(),
    }
}

I have tried other things also, still getting the additional line in the error for attribute macro.

rustc --version output:

rustc 1.45.2 (d3fb005a3 2020-07-31)

Not sure if I am doing something wrong. Also the additional line specifically mentions attribute macro, and so far I have only implemented the derive and functional macro exercises from before

Copy link
Owner

dtolnay left a comment

Thanks, looks like this got introduced by rustc 1.43.0.

@dtolnay dtolnay merged commit fc9704e into dtolnay:master Aug 15, 2020
3 checks passed
3 checks passed
Rust nightly
Details
Rust beta
Details
Rust stable
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.