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

Expected fn not fn blah #10

Closed
glmdgrielson opened this issue Apr 12, 2018 · 2 comments
Closed

Expected fn not fn blah #10

glmdgrielson opened this issue Apr 12, 2018 · 2 comments

Comments

@glmdgrielson
Copy link

glmdgrielson commented Apr 12, 2018

impl Trait for Struct {
	cfg_if! {
		if #[cfg(feature = "blah")] {
			fn blah(&self) {
				unimplemented!();
			}
		} else {
			fn blah(&self) {
				unimplemented!();
			}
		}
	}
}

This generates the error:

expected one of `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `fn blah(?) { unimplemented!(); }`

expected one of 8 possible tokens here

What gives? Putting the attribute myself works but the macro has a weird failure.

@alexcrichton
Copy link
Member

Thanks for the report! Currently though this crate only works with "item" AST nodes rather than "impl items" lie functions in an impl

@alexcrichton
Copy link
Member

As of #28 this is now supported

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 a pull request may close this issue.

2 participants