rust-lang / rust-lang/rust

(E0283) Type-inference regression in nightly

Open
#161,695 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-inference C-bug I-prioritize needs-triage regression-from-stable-to-nightly T-compiler WG-trait-system-refactor
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I'm so sorry, I can't isolate minimal reproducible example now. But there is original issue: sparsey #24. There is a little bit complex type-trait-system.

I'm sure that sparsey v0.13.3 was normally compiled with previous nightly, but not with actual 1.100.0.

Well, steps to reproduce:

  1. cargo init —bin && cargo add sparsey --no-default-features
  2. add some crate usage such as create world:
pub fn main() {
	struct A;
	struct B;

	let mut world = sparsey::World::builder().add_group::<(A, B)>().build();
	world.create((A, B));
}
  1. cargo build / cargo run
Version with regression

rustc -Vv:

rustc 1.100.0-nightly (c54751567 2026-08-22)
binary: rustc
commit-hash: c54751567b19c4ceb08b0412d83529c2568cba8b
commit-date: 2026-08-22
host: aarch64-apple-darwin
release: 1.100.0-nightly
LLVM version: 23.1.0
Backtrace

There is no backtrace, only normal compilation error.

Compilation error


   Compiling sparsey v0.13.3
error[E0283]: type annotations needed
   --> /Users/__/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/sparsey-0.13.3/src/world/mod.rs:213:14
    |
213 |         self.query_all().for_each(f);
    |              ^^^^^^^^^ cannot infer type of the type parameter `G` declared on the method `query_all`
    |
    = note: the type must implement `query::Query`
    = help: the following types implement trait `query::Query`:
              (T₁, T₂, …, Tₙ) up to tuples of arity 16
            and 9 others
note: required by a bound in `world::World::query_all`
   --> /Users/__/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/sparsey-0.13.3/src/world/mod.rs:194:12
    |
192 |     pub fn query_all<G>(&self) -> QueryAll<G, (), ()>
    |            --------- required by a bound in this associated function
193 |     where
194 |         G: Query,
    |            ^^^^^ required by this bound in `World::query_all`
help: consider specifying a concrete type for the type parameter `G`
    |
213 |         self.query_all::</* Type */>().for_each(f);
    |                       ++++++++++++++

For more information about this error, try `rustc --explain E0283`.
error: could not compile `sparsey` (lib) due to 1 previous error

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the listed cargo commands and nightly rustc 1.100.0, using sparsey v0.13.3. Start at sparsey/src/world/mod.rs around lines 192-213 and compare behavior with the previous nightly or the original sparsey #24 report. Done means the regression is isolated to a compiler change or the supplied example compiles again.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.