rust-lang / rust-lang/rust

1.99 beta crater regression: "type annotations needed"

Open
#161,913 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-inference C-bug P-high regression-from-stable-to-beta S-has-bisection S-has-mcve T-types
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This regression was found by the 1.99 crater run.

[INFO] [stdout] error[E0282]: type annotations needed for `&_`
[INFO] [stdout]    --> src/sync/mcast.rs:172:65
[INFO] [stdout]     |
[INFO] [stdout] 172 |     let reader = MpMcastReader::new(DynRef::new(queue.clone(), |q| q.as_ref()));
[INFO] [stdout]     |                                                                 ^  - type must be known at this point
[INFO] [stdout]     |
[INFO] [stdout] help: consider giving this closure parameter an explicit type, where the type for type parameter `Q` is specified
[INFO] [stdout]     |
[INFO] [stdout] 172 |     let reader = MpMcastReader::new(DynRef::new(queue.clone(), |q: &Q| q.as_ref()));
[INFO] [stdout]     |                                                                  ++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] For more information about this error, try `rustc --explain E0282`.

Affects the Banyc/primitive crate, and its 7 dependents, all by the same author.

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

Start with the crater error at src/sync/mcast.rs:172 in the Banyc/primitive crate and compare the linked logs from its seven dependents. Reproduce the type-inference failure under Rust 1.99 beta, then trace why the DynRef::new closure no longer infers its parameter type. Done means Banyc/primitive and the listed dependents compile successfully 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
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.