You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build anything using a models.rs with #[derive(Queryable,Debug)].
Output
For table!
warning: cannot find type `table` in this scope
--> <table_body macros>:165:33
|
165 | derive ( Debug , Clone , Copy , QueryId ) ] /// The actual table struct
| ^^^^^^^ names from parent modules are not accessible without an explicit import
For the models
--> src/models.rs:14:10
|
14 | #[derive(Queryable,Debug)]
| ^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #50504 <https://github.com/rust-lang/rust/issues/50504>
Workaround
Invoke cargo or rustc with the RUSTFLAGS="-Aproc-macro-derive-resolution-fallback" environment variable.
For example, RUSTFLAGS="-Aproc-macro-derive-resolution-fallback" cargo check
You can also create a .cargo/config file at project level with the relevant flag:
This issue can be reproduced on Rust's stable channel. (Your issue will be
closed if this is not the case)
It can't, as it's an upcoming behavior, but perhaps it's pertinent to track it, as it's mature code ready to land to stable at 1.30 release date (currently Oct 25 2018), and to document a workaround.
If not, we can probably close it and reopen at 1.30 release.
The text was updated successfully, but these errors were encountered:
dereckson
changed the title
Resolution of macro derive behavior has been modified on nightly
Resolution of macro derive behavior has been modified on 1.30
Aug 28, 2018
Setup
Versions
Problem Description
In the past, the proc_macro! expansion could refer to items, without importing them explicitly again in the source file using this macro.
This behavior is being phasing out and triggers warnings at build time.
See rust-lang/rust#50504
And more explicitly rust-lang/rust#50504 (comment)
Steps to reproduce
diesel migration run
#[derive(Queryable,Debug)]
.Output
For table!
For the models
Workaround
Invoke cargo or rustc with the
RUSTFLAGS="-Aproc-macro-derive-resolution-fallback"
environment variable.For example,
RUSTFLAGS="-Aproc-macro-derive-resolution-fallback" cargo check
You can also create a
.cargo/config
file at project level with the relevant flag:Checklist
closed if this is not the case)
It can't, as it's an upcoming behavior, but perhaps it's pertinent to track it, as it's mature code ready to land to stable at 1.30 release date (currently Oct 25 2018), and to document a workaround.
If not, we can probably close it and reopen at 1.30 release.
The text was updated successfully, but these errors were encountered: