Diesel: Compile error when trying to use infer_schema!() against existing database

Created on 16 Nov 2016  路  18Comments  路  Source: diesel-rs/diesel

RUST_BACKTRACE=1 cargo build
   Compiling diesel_demo v0.1.0 (file:///mnt/storage/dev/postgres/diesel_demo)
error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error[E0428]: a type named `_Dummy` has already been defined in this module
 --> src/schema.rs:1:1
  |
1 | infer_schema!("dotenv:DATABASE_URL");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | |
  | previous definition of `_Dummy` here
  | already defined
  |
  = note: this error originates in a macro outside of the current crate

error: internal compiler error: ../src/librustc_metadata/decoder.rs:490: entry: id not found: DefIndex(1) in crate "diesel_codegen" with number 16

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:424
stack backtrace:
   1:     0x7f37fc2a405a - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x7f37fc2b2eff - std::panicking::default_hook::{{closure}}::h6875a2976258b020
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:247
   3:     0x7f37fc2b2a9d - std::panicking::default_hook::h88ffbc5922643264
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:257
   4:     0x7f37fc2b33a7 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:451
   5:     0x7f37f4dbb53a - std::panicking::begin_panic::h264cdc75d51b518b
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:413
   6:     0x7f37f4dcc0fd - rustc_errors::Handler::bug::h620f7270292f0095
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_errors/lib.rs:424
   7:     0x7f37f966ca11 - rustc::session::opt_span_bug_fmt::{{closure}}::h4a9b70c3df8b4b3a
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/session/mod.rs:771
   8:     0x7f37f966c82e - rustc::session::opt_span_bug_fmt::h7d83586c6e2c7ae6
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1048
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/session/mod.rs:767
   9:     0x7f37f966c492 - rustc::session::bug_fmt::he2d2f00a4afa9d1e
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/session/mod.rs:751
  10:     0x7f37f9fb2bb3 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry::h5e3d8114267e9116
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_metadata/decoder.rs:490
  11:     0x7f37f9fbb0cb - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visibility::h2949b511f18961ee
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_metadata/decoder.rs:654
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_metadata/cstore_impl.rs:58
  12:     0x7f37f9fc3510 - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::visible_parent_map::hab53861eb74bce8d
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_metadata/cstore_impl.rs:597
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_metadata/cstore_impl.rs:622
  13:     0x7f37f96b2124 - rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path::haa7f7a9afda5f72a
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/item_path.rs:115
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/item_path.rs:152
  14:     0x7f37f96f91d3 - rustc::util::ppaux::parameterized::h7bcfb1fd3d8a947a
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/item_path.rs:49
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:154
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1035
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1031
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:82
  15:     0x7f37fc305515 - core::fmt::write::h01739b8f12f355f9
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:829
  16:     0x7f37fc3063b5 - core::fmt::Formatter::write_fmt::h50f274f007b40806
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:1134
  17:     0x7f37f9701962 - rustc::util::ppaux::<impl core::fmt::Display for rustc::ty::TraitPredicate<'tcx>>::fmt::he0dbf908fd919098
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:1022
  18:     0x7f37fc305515 - core::fmt::write::h01739b8f12f355f9
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:829
  19:     0x7f37fc3063b5 - core::fmt::Formatter::write_fmt::h50f274f007b40806
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:1134
  20:     0x7f37f96fe611 - rustc::util::ppaux::<impl core::fmt::Display for rustc::ty::sty::Binder<rustc::ty::TraitPredicate<'tcx>>>::fmt::hb2f823bd10699038
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:298
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:764
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1035
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1031
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:764
  21:     0x7f37fc305515 - core::fmt::write::h01739b8f12f355f9
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:829
  22:     0x7f37fc3063b5 - core::fmt::Formatter::write_fmt::h50f274f007b40806
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:1134
  23:     0x7f37f9701c31 - rustc::util::ppaux::<impl core::fmt::Display for rustc::ty::Predicate<'tcx>>::fmt::hcaf28c3b7b8ea3ed
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/ppaux.rs:1063
  24:     0x7f37fc305515 - core::fmt::write::h01739b8f12f355f9
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:829
  25:     0x7f37fc2be60d - collections::fmt::format::h2e5dd97da45bd3ab
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/fmt/mod.rs:130
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcollections/fmt.rs:543
  26:     0x7f37f967422a - rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_selection_error::h962cd4a7e26d176d
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/traits/error_reporting.rs:491
  27:     0x7f37f966efb4 - rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_fulfillment_error::hb3520d160f1dddc3
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/traits/error_reporting.rs:80
  28:     0x7f37f966df01 - rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_fulfillment_errors::h9a88e2fc91b0b056
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/traits/error_reporting.rs:65
  29:     0x7f37fa76fa26 - rustc_typeck::check::FnCtxt::select_obligations_where_possible::hb71c39774d7865bc
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:2240
  30:     0x7f37fa76eed2 - rustc_typeck::check::FnCtxt::select_all_obligations_and_apply_defaults::he017bcec5f3ea226
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:1981
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:1975
  31:     0x7f37fa76f6f9 - rustc_typeck::check::FnCtxt::select_all_obligations_or_error::hec789b8269f0fa83
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:2221
  32:     0x7f37fa6a59c4 - <std::thread::local::LocalKey<T>>::with::h7d0b5ca65a1ab155
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/wfcheck.rs:59
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:471
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/infer/mod.rs:523
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1019
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
  33:     0x7f37fa730952 - rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor::check_item_well_formed::hbb7157febd75c937
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1016
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:853
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/infer/mod.rs:523
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:471
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/wfcheck.rs:53
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/wfcheck.rs:400
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/wfcheck.rs:115
  34:     0x7f37fa73bdfb - <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor<'ccx, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item::h25315dc7b01c34ff
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/wfcheck.rs:615
  35:     0x7f37fa752a5a - rustc_typeck::check::check_wf_new::h186f7cd379099246
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/dep_graph/visit.rs:46
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/hir/mod.rs:445
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/dep_graph/visit.rs:57
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/mod.rs:2703
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:537
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/session/mod.rs:222
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/check/mod.rs:535
  36:     0x7f37fa7bdefa - rustc_typeck::check_crate::h4045752b69a796e8
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/lib.rs:341
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/util/common.rs:38
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_typeck/lib.rs:341
  37:     0x7f37fc64da4e - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h97a3a12d948df547
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/driver.rs:891
  38:     0x7f37fc64aced - rustc_driver::driver::phase_3_run_analysis_passes::hb0ad9de18d423e67
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1019
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1016
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1003
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:1000
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc/ty/context.rs:789
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/driver.rs:869
  39:     0x7f37fc632474 - rustc_driver::driver::compile_input::h8e119234b60571d5
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/driver.rs:173
  40:     0x7f37fc677580 - rustc_driver::run_compiler::hbdfc4f84e2e0f4b9
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/lib.rs:222
  41:     0x7f37fc5936b8 - std::panicking::try::do_call::hf679f17bf3b43b0b
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/lib.rs:1141
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/lib.rs:138
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/librustc_driver/lib.rs:1075
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:295
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:356
  42:     0x7f37fc2bd8ea - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
  43:     0x7f37fc5b7248 - <F as alloc::boxed::FnBox<A>>::call_box::h506fb5d7b8891cd4
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:332
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:351
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/mod.rs:287
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:595
  44:     0x7f37fc2b1d74 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:605
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys_common/thread.rs:21
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/thread.rs:84
  45:     0x7f37f4565709 - start_thread
  46:     0x7f37fbf6c82c - clone
  47:                0x0 - <unknown>

error: Could not compile `diesel_demo`.

Most helpful comment

rustup toolchain install nightly-2016-11-06, thanks!

All 18 comments

Enabling the "large-tables" feature fixes the compiler panic, but still getting warnings about _Dummy being defined multiple times.

IIRC, #493 aims to fix the _Dummy error

Oh good, nightlies are building again. This is fixed by https://github.com/diesel-rs/diesel/pull/493. I'll try to release tonight.

As a workaround in the short term you can use an older nightly.

That's alright. I was just walking through the getting started guide when I hit this, so I'm going to take a look at rust-postgres and check back later. Thanks for your work on this, seems like it's going to be pretty awesome!

I just hit this too, couldn't finish step 1 in the getting_started guide. Ah, nightlies!

Looks like rustc needs a little more time in the oven... I'll try again in a few weeks.

All rust nightlies which have this issue are actually completely broken for procedural macros. It's all fixed on master, so we'll release tomorrow or the day after depending on when the nightly was rolled

Oh good. I'll try again in a few days.

How far back to I need to go if I want to keep going tonight? Maybe a month old nightly?

2016-11-06

rustup toolchain install nightly-2016-11-06, thanks!

Hm, late oct / early nov only appear to work on Linux. Getting consistent ICEs on Mac:

thread 'rustc' panicked at 'index out of bounds: the len is 363930 but the index is 363930', ../src/libserialize/leb128.rs:47
note: Run with `RUST_BACKTRACE=1` for a backtrace.

owell, I'll try again in a few days. sgrif, just curious: which platform to you use for Diesel dev?

Run cargo clean and recompile. Nightlies don't ship unless they work on all platforms. I use mac to develop primarily, and windows periodically.

Yep, that worked! Thanks for ignoring my attempts to give up.

Hi, I am getting the same error on rustc 1.14.0-nightly (cae6ab1c4 2016-11-05)

error: custom derive attribute panicked
--> src/schema.rs:1:1
|
1 | infer_schema!("dotenv:DATABASE_URL");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: called Result::unwrap() on an Err value: StringError("Failed to load environment variable DATABASE_URL: environment variable not found")
= note: this error originates in a macro outside of the current crate

error: Could not compile diesel_demo.

I am using code from the examples directory to test diesel.

@nkhinchi Do you have the .env file or the environmental variable set up? That looks more like it's missing.

Thanks, that did the trick. I was struggling with the original error before.

0.8.2 has been released with a fix

Right on, looks great. cargo update and everything works again.

Was this page helpful?
0 / 5 - 0 ratings