diesel: names from parent modules are not accessible without an explicit import
Setup
Versions
- Rust:1.29.0-nightly (254f8796b 2018-07-13)
- Diesel:1.3.2
- Database:sqlite
- Operating System:win10
Feature Flags
- diesel:
Problem Description
I got a lot of warns after rustup and cargo update, like follow:
warning: cannot find type `ThingDefine` in this scope
--> src\data\thing\mod.rs:71:41
|
71 | #[derive(Serialize, Deserialize, Debug, Queryable, Clone, PartialOrd, PartialEq)]
| ^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
= note: #[warn(proc_macro_derive_resolution_fallback)] on by default
= 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>
warning: cannot find type `NaiveDateTime` in this scope
--> src\data\thing\mod.rs:71:41
|
71 | #[derive(Serialize, Deserialize, Debug, Queryable, Clone, PartialOrd, PartialEq)]
| ^^^^^^^^^ 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>
What are you trying to accomplish?
I try to add #[allow(proc_macro_derive_resolution_fallback)] on the structure used for query to disable the errors, but the warning exists yet.
What is the expected output?
I want to remove these warnings
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 13
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Future proof us against upcoming changes to derives Macro hygiene used to ignore module scope, which meant that we could reference a type from outside our wrapper module even if we didn't import it. ... — committed to diesel-rs/diesel by sgrif 6 years ago
- rust version: update to nightly-2018-07-18 note that the database crate produces a large number of warnings. this is due to https://github.com/diesel-rs/diesel/issues/1785, which has been fixed; thos... — committed to rustodon/rustodon by barzamin 6 years ago
- chore: quiet diesel warnings under rust 1.29 temporary until (likely) diesel 1.4: https://github.com/diesel-rs/diesel/issues/1785 — committed to mozilla-services/syncstorage-rs by pjenvey 6 years ago
- Fix rustc warnings New warnings were introduced with rustc 1.29.0 podcasts-data/src/lib.rs: this one can be removed once diesel is upgraded. https://github.com/diesel-rs/diesel/issues/1785#issuecomm... — committed to alatiera/gnome-podcasts by alatiera 6 years ago
- Silence spurious derived-macro warnings See https://github.com/diesel-rs/diesel/issues/1785 — committed to rychipman/snake by rychipman 6 years ago
- db: silence warnings due to diesel-rs/diesel#1785 — committed to rustodon/rustodon by barzamin 6 years ago
- Silence diesel warnings which would be fixed in diesel-1.4 This is temporary workaround. See <https://github.com/diesel-rs/diesel/issues/1785#issuecomment-422579609>. — committed to pbl-2018-hillclimb/burning-pro-server by lo48576 6 years ago
- Silence diesel warnings which would be fixed in diesel-1.4 This is temporary workaround. See <https://github.com/diesel-rs/diesel/issues/1785#issuecomment-422579609>. — committed to pbl-2018-hillclimb/burning-pro-server by lo48576 6 years ago
- src/main.rs: silence annoying Diesel warnings See https://github.com/diesel-rs/diesel/issues/1785 . — committed to pkgw/drorg by pkgw 6 years ago
- Diesel fix https://github.com/diesel-rs/diesel/issues/1785 — committed to jslupicki/solteq-demo-app by jslupicki 5 years ago
- Diesel fix https://github.com/diesel-rs/diesel/issues/1785 — committed to jslupicki/rust-backend by jslupicki 5 years ago
rust is so unstable. I must consider not to move my tech stack to it and I should postpone for at least a year or so…
Here is a good way to mute the warning on a per-file basis:
Following the tutorial here I keep getting
names from parent modules are not accessible without an explicit importforQueryableandInsertabletoo, but#[macro_use] extern crate diesel;is present inmain.rs? Am I missing something? Did read the merge report and tried changing toextern crate diesel;but unsure if this is correct as I got a bunch of other errors?Thanks, but we don’t accept errors that are specific to nightly versions of Rust. There’s an ongoing discussion about this and it’s not clear what the final direction will be, Diesel will not be acting on it until it’s clear what we actually will need to do for stable.
You can silence specifically this error with
#![allow(proc_macro_derive_resolution_fallback)]. Unless you’re writing a ton of custom derives, it’s unlikely you’ll be getting new instances of this warning.I’m also wondering when this is going to get released. Hit it just now as well.