You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As seen in this image, the inline error message is very unclear: which type do I use, vs which type I should be using instead. It simply lists two types and their source files. It requires full dialog to be open to understand which is which.
error[E0308]: mismatched types
--> clippy_lints/src/functions/ref_option.rs:18:40
|
18 | ifis_type_diagnostic_item(cx,*ty, sym::Option)
| ----------------------- ^^^ expected `rustc_middle::ty::Ty<'_>`, found `rustc_hir::Ty<'_>`
| |
| arguments to this function are incorrect
|
= note: `rustc_hir::Ty<'_>` and `rustc_middle::ty::Ty<'_>` have similar names, but are actually distinct types
note: `rustc_hir::Ty<'_>` is defined in crate `rustc_hir`
--> /home/nyurik/.rustup/toolchains/nightly-2024-09-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_hir/src/hir.rs:2539:1
note: `rustc_middle::ty::Ty<'_>` is defined in crate `rustc_middle`
--> /home/nyurik/.rustup/toolchains/nightly-2024-09-05-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_middle/src/ty/mod.rs:440:1
note: function defined here
--> /home/nyurik/dev/rust/rust-clippy/clippy_utils/src/ty.rs:445:8
|
445 | pub fn is_type_diagnostic_item(cx:&LateContext<'_>, ty:Ty<'_>, diag_item:Symbol) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^
Makes sense, and rustc does make it clear because it uses comments on the code span itself - making it non-ambiguous. Does it make sense to show span info somewhere too in that error expansion? Or would it require rustc's message to be altered to make it clearer which type is which? Seems bad to loose span messages in r-a though...
As seen in this image, the inline error message is very unclear: which type do I use, vs which type I should be using instead. It simply lists two types and their source files. It requires full dialog to be open to understand which is which.
rust-analyzer version:
rust-analyzer version: 0.3.2112-standalone
rustc version:
rustc 1.81.0 (eeb90cda1 2024-09-04)
editor or extension: vscode, ext 0.3.2112
relevant settings: defaults
repository link (if public, optional): (eg. rust-analyzer)
The text was updated successfully, but these errors were encountered: