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

Importing Diesel macros (Rust 2018) #1764

Closed
lnicola opened this Issue Jun 24, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@lnicola

lnicola commented Jun 24, 2018

In the 2018 edition, #[macro_use] is going away (kinda'), as use works with macros. Unfortunately, Diesel doesn't seem to play well with that, as a lot of macros are hard to find (e.g. no_arg_sql_function_body), or seem not to work even after being imported (although it's quite possible that I used a wrong path).

https://www.reddit.com/r/rust/comments/8tbah2/my_problems_with_understanding_rust_edition_2018/e166pdp/ suggests a simple work-around, but that might require a minimum compiler version bump.

#[macro_use] is probably still going to be supported, but it might be worth fixing this.

Related: rust-lang/rust#35896 (comment).

@sgrif

This comment has been minimized.

Member

sgrif commented Jun 25, 2018

I don't think there's anything actionable that we can do at this point in time. Even the comment you've linked to says "the lang team is looking into this but hasn't made a decision yet". As far as I can tell there's no compiler that demonstrates a concrete problem here, nor is there any change we can currently make that would address this potential problem today.

In a few months, if Diesel is unable to compile with stable Rust (which would be a pretty shocking step for Rust to take), please open a new issue.

@sgrif sgrif closed this Jun 25, 2018

@lnicola

This comment has been minimized.

lnicola commented Jun 25, 2018

As far as I can tell there's no compiler that demonstrates a concrete problem here

The issue can be observed on nightly, with the use_extern_macros feature enabled: https://play.rust-lang.org/?gist=51baef8107264c2aafaf140c4d045e86&version=nightly&mode=debug, and it affects Diesel in the same way.

I'll post here again if use_extern_macros gets stabilized and it's still hard to use it with Diesel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment