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

Most upvoted comments

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:

#![allow(proc_macro_derive_resolution_fallback)]

Following the tutorial here I keep getting names from parent modules are not accessible without an explicit import for Queryable and Insertable too, but #[macro_use] extern crate diesel; is present in main.rs? Am I missing something? Did read the merge report and tried changing to extern 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.