Skip to content

regression: error[E0284]: type annotations needed; cannot infer type in trait declaration #140019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cuviper opened this issue Apr 18, 2025 · 2 comments
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@cuviper
Copy link
Member

cuviper commented Apr 18, 2025

[INFO] [stderr]    Compiling lang-def v0.1.0 (/opt/rustwide/workdir/lang-def)
[INFO] [stdout] error[E0284]: type annotations needed
[INFO] [stdout]    --> lang-def/src/parser.rs:293:5
[INFO] [stdout]     |
[INFO] [stdout] 293 |     fn span_str(&self, span: impl Spanned<Pos = Self::Pos>) -> Cow<'a, str>;
[INFO] [stdout]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
[INFO] [stdout]     |
[INFO] [stdout]     = note: cannot satisfy `<Self as Iterator>::Item == _`
[INFO] [stderr]    Compiling poisson v0.10.1 (/opt/rustwide/workdir)
[INFO] [stdout] error[E0284]: type annotations needed
[INFO] [stdout]   --> src/algorithm/mod.rs:35:5
[INFO] [stdout]    |
[INFO] [stdout] 35 | /     fn next<R>(&mut self, _: &mut Builder<F, V>, _: &mut R) -> Option<V>
[INFO] [stdout] 36 | |     where
[INFO] [stdout] 37 | |         R: Rng;
[INFO] [stdout]    | |_______________^ cannot infer type
[INFO] [stdout]    |
[INFO] [stdout]    = note: cannot satisfy `<V as Module>::Ring == _`
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0284]: type annotations needed
[INFO] [stdout]   --> src/algorithm/mod.rs:40:5
[INFO] [stdout]    |
[INFO] [stdout] 40 |     fn size_hint(&self, _: &Builder<F, V>) -> (usize, Option<usize>);
[INFO] [stdout]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
[INFO] [stdout]    |
[INFO] [stdout]    = note: cannot satisfy `<V as Module>::Ring == _`
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0284]: type annotations needed
[INFO] [stdout]   --> src/algorithm/mod.rs:43:5
[INFO] [stdout]    |
[INFO] [stdout] 43 |     fn restrict(&mut self, _: V);
[INFO] [stdout]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
[INFO] [stdout]    |
[INFO] [stdout]    = note: cannot satisfy `<V as Module>::Ring == _`
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0284]: type annotations needed
[INFO] [stdout]   --> src/algorithm/mod.rs:46:5
[INFO] [stdout]    |
[INFO] [stdout] 46 |     fn stays_legal(&self, _: &Builder<F, V>, _: V) -> bool;
[INFO] [stdout]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
[INFO] [stdout]    |
[INFO] [stdout]    = note: cannot satisfy `<V as Module>::Ring == _`

Version it worked on

It most recently worked on: Rust 1.86.0

Version with regression

Using 1.87.0-beta.4 in crater #139827.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

@cuviper cuviper added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 18, 2025
@cuviper cuviper added this to the 1.87.0 milestone Apr 18, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-untriaged Untriaged performance or correctness regression. labels Apr 18, 2025
@compiler-errors
Copy link
Member

This was fixed in #138941. I'll beta nominate it.

@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 19, 2025
@apiraino
Copy link
Contributor

apiraino commented Apr 19, 2025

Assigning priority (discussion on Zulip).

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants