Repository navigation
Diesel stops building with nightly-2025-12-10 #149845
Copy link
Copy link
Closed
diesel-rs/diesel
#4907Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.P-lang-drag-0Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Code
I tried this code:
git clone https://github.com/diesel-rs/diesel
cd diesel
cargo check -F postgres --all-targets -p diesel_testsI expected to see this happen: Code builds without errors
Instead, this happened: Compilation fails with errors
Version it worked on
It most recently worked on:
Version with regression
rustc --version --verbose:
rustc 1.94.0-nightly (c61a3a44d 2025-12-09)
binary: rustc
commit-hash: c61a3a44d1a5bee35914cada6c788a05e0808f5b
commit-date: 2025-12-09
host: x86_64-unknown-linux-gnu
release: 1.94.0-nightly
LLVM version: 21.1.5
bisec-rustc points to c61a3a4 (so #147984) for the commit/PR that introduced this regression.
The error message points to #114095
Unfortunately I see no meaningful way for diesel to address this without doing a significant breaking change. To address this without breaking change on our side it would be required to have tooling that lets us import only from a specific namespace (type, function, etc) if several items with the same name exists.
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.P-lang-drag-0Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Activity
bjorn3 commentedon Dec 10, 2025
The actual error message as taken from https://github.com/diesel-rs/diesel/actions/runs/20098057029/job/57661673455?pr=4900:
Details
lqd commentedon Dec 10, 2025
cc @petrochenkov on that bisection
petrochenkov commentedon Dec 10, 2025
From 74 regressions in #147984 (comment) (due to
ambiguous_glob_importsbeing deny-by-default) a significant part is indeed from depending on dieseldiesel::dsl::{max,sum,/*etc*/}.I wondered why this hazard in diesel wasn't detected before, and it turns out it was, but diesel does
#[allow(ambiguous_glob_reexports)]to ignore it.petrochenkov commentedon Dec 10, 2025
I'm trying to understand what's going on, but it's hard because diesel uses proc macros to generate code.
Why do both
crate::helper_types::*andcrate::expression::dsl::*containfn max, but different ones?The compiler doesn't know which one to choose ->
ambiguous_glob_importsis reported, this is a legitimate error.Which one is supposed to be chosen?
FWIW, the tooling exists, it's just not pretty.
I could make a fix if I understood what's going on there.
petrochenkov commentedon Dec 10, 2025
Upd: the correct fix is below - #149845 (comment).
Possible fix (at least the reproducer command line passes).
Single imports can be used to explicitly disambiguate the
crate::helper_types::*vscrate::expression::dsl::*situation.weiznich commentedon Dec 10, 2025
Thanks for pointing out how to fix it in diesel. I will try to verify this tomorrow.
Based on the diff I unfortunately guess that this might exactly be the thing I called breaking change above, as it requires also to change the calling side as demonstrated by the changes to diesel_tests.
As for the questions around what the code actually expands to: The diesel documentation shows expanded code for the relevant macro: https://docs.diesel.rs/main/diesel/expression/functions/attr.declare_sql_function.html#expanded-code-1
If that is not sufficient I can try to provide more details tomorrow, I'm currently occupied with other tasks.
35 remaining items
petrochenkov commentedon Jan 13, 2026
Implemented in #151074.
joshtriplett commentedon Jan 14, 2026
We talked about this in today's @rust-lang/lang meeting. For simplicity's sake, rather than splitting out the external vs intra-crate lint, we'd like to temporarily downgrade the existing lint (covering the use site) to warn-by-default, and wait one release before re-upgrading it, to give an extra six weeks for this to get fixed in the ecosystem.
(Also, if it's not yet warn-in-deps, please go ahead and make it warn-in-deps.)
petrochenkov commentedon Jan 14, 2026
Implemented in #151130.
Rollup merge of rust-lang#151130 - diesel2, r=lqd
Rollup merge of rust-lang#151130 - diesel2, r=lqd
Unrolled build for #151130
Add an additional help note to the ambiguity lint error
weiznich commentedon Jan 16, 2026
I would like to thank you all for giving me a bit more time. That's really appropriated. I opened #151198 to add an additional note to the error message to ask users to update their dependencies to resolve this particular issues. Hopefully that's helpful.
Add an additional help note to the ambiguity lint error
Add an additional help note to the ambiguity lint error
Rollup merge of rust-lang#151198 - ambiguity_fix_help, r=petrochenkov
Unrolled build for #151198
Add an additional help note to the ambiguity lint error