Skip to content
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

E0277 unfortunate spacing in source #107649

Closed
matthiaskrgr opened this issue Feb 3, 2023 · 2 comments · Fixed by #107659
Closed

E0277 unfortunate spacing in source #107649

matthiaskrgr opened this issue Feb 3, 2023 · 2 comments · Fixed by #107659
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 3, 2023

Code

rustc code I was messing around with

Current output

error[E0277]: `UnusedDelimSuggestion` doesn't implement `std::fmt::Debug`
   --> /home/matthias/vcs/github/rust/library/std/src/macros.rs:354:81
    |
204 |   macro_rules! eprintln {
    |   --------------------- in this expansion of `$crate::eprintln!` (#2)
...
209 |           $crate::io::_eprint($crate::format_args_nl!($($arg)*));
    |                               --------------------------------- in this macro invocation (#3)
...
340 |   macro_rules! dbg {
    |   ---------------- in this expansion of `dbg!` (#1)
...
353 | /                 $crate::eprintln!("[{}:{}] {} = {:#?}",
354 | |                     $crate::file!(), $crate::line!(), $crate::stringify!($val), &tmp);
    | |_________________________________________________________________________________^^^^- in this macro invocation (#2)
    |                                                                                   |
    |                                                                                   `UnusedDelimSuggestion` cannot be formatted using `{:?}`
    |
   ::: compiler/rustc_lint/src/unused.rs:695:9
    |
695 |           dbg!(suggestion);
    |           ---------------- in this macro invocation (#1)
    |
   ::: /home/matthias/vcs/github/rust/library/core/src/macros/mod.rs:906:5
    |
906 |       macro_rules! format_args_nl {
    |       --------------------------- in this expansion of `$crate::format_args_nl!` (#3)
    |
    = help: the trait `std::fmt::Debug` is not implemented for `UnusedDelimSuggestion`
    = note: add `#[derive(Debug)]` to `UnusedDelimSuggestion` or manually `impl std::fmt::Debug for UnusedDelimSuggestion`
    = help: the trait `std::fmt::Debug` is implemented for `Option<T>`
help: consider annotating `UnusedDelimSuggestion` with `#[derive(Debug)]`
   --> |compiler/rustc_lint/src/lints.rs:1465:1
    |
1465| #[derive(Debug)]
    |

Desired output

for the `help:` suggestion, 
`   --> |compiler/rustc_lint/src/lints.rs:1465:1` will include the leading pipe when clicking on it.
Should be
`   --> | compiler/rustc_lint/src/lints.rs:1465:1`

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

@matthiaskrgr matthiaskrgr added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 3, 2023
@estebank
Copy link
Contributor

estebank commented Feb 6, 2023

It should actually be

   --> compiler/rustc_lint/src/lints.rs:1465:1

without a leading pipe at all.

@bvanjoi
Copy link
Contributor

bvanjoi commented Feb 6, 2023

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants