-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Diagnostic suggests adding type [type error]
#79040
Comments
Fix instructions:
|
Hi i am interesting in tackling this issue! This would be my first time contributing. |
Cool! You can mark yourself as workin on this issue by writing |
@rustbot claim |
The error is emitted here:
within fn infer_placeholder_type, but I am confused by what is happening when
|
I've managed to block the second error:
I used err.delay_as_bug() because I was getting an internal compiler error for an unused error. I saw Using emit_unless(bool):
|
I like the Though I think we should add an |
Shouldn't it also be |
@rustbot claim |
The order is indeed odd, but at least grammatically correct. If you have |
I'm concerned about the possibility of there being a case where Some(mut err) => {
err.suggestions.clear();
err.span_suggestion(
span,
"provide a type for the item",
format!("{}: {}", item_ident, ty),
Applicability::MachineApplicable,
)
.emit_unless(matches!(ty.kind(), ty::Error(_)));
} |
I don't know enough about the language design space to be opening up meaningful issues. I was just making a comment. I don't know whether it's an issue or not and I certainly don't want to create issues that will be closed immediately. |
@petar-dambovaliev That shouldn't stop you. Some times there are things that the team hasn't yet noticed and it is a good idea to rise the point. Other times tickets are duplicated but that is also a useful signal that can be a proxy for urgency.
We treat these kind of issues seriously. We rarely immediately close tickets around here unless they are a duplicate (where we close with a link) or completely off-topic (where we point of more reasonable venues). If you still feel this comment isn't worth a new ticket but still want to have a conversation around it, feel free to visit https://internals.rust-lang.org/ and start a new thread. IIRC, I am the one that wrote that message and I went back and forth between a sentence that made grammatical sense and one that looked like the provided code, and landed in the current message and a main label in the order of the code. Since the output has changed slightly and the later has been "lost". As the "culprit" of the current state, I welcome any conversation around this. That's how we improve :) |
Fix diagnostic suggests adding type `[type error]` Fixes rust-lang#79040 ### Unresolved questions: <del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks `@oli-obk`
Fix diagnostic suggests adding type `[type error]` Fixes rust-lang#79040 ### Unresolved questions: <del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks ``@oli-obk``
Fix diagnostic suggests adding type `[type error]` Fixes rust-lang#79040 ### Unresolved questions: <del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks ```@oli-obk```
Fix diagnostic suggests adding type `[type error]` Fixes rust-lang#79040 ### Unresolved questions: <del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks ````@oli-obk````
Fix diagnostic suggests adding type `[type error]` Fixes rust-lang#79040 ### Unresolved questions: <del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks `````@oli-obk`````
I think the suggestion is trying to suggest a type, but gets a
TyKind::Error
due to the type error in the body of theconst
. Ideally we would just not suggest a type, but there are probably a lot of other places that this issue occurs.(Playground)
Errors:
The text was updated successfully, but these errors were encountered: