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

Formatting empty array leaks internal function name new_debug #107745

Closed
Kyuuhachi opened this issue Feb 7, 2023 · 1 comment · Fixed by #107789
Closed

Formatting empty array leaks internal function name new_debug #107745

Kyuuhachi opened this issue Feb 7, 2023 · 1 comment · Fixed by #107789
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

@Kyuuhachi
Copy link
Contributor

Kyuuhachi commented Feb 7, 2023

Code

fn main() {
    println!("{:?}", []);
}

Current output

error[E0282]: type annotations needed
 --> src/main.rs:2:22
  |
2 |     println!("{:?}", []);
  |                      ^^ cannot infer type of the type parameter `T` declared on the associated function `new_debug`

Desired output

Not sure about the exact details, but with other generics the error looks like:

error[E0282]: type annotations needed
 --> src/main.rs:3:22
  |
3 |     println!("{:?}", PhantomData);
  |                      ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `PhantomData`
  |

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

@Kyuuhachi Kyuuhachi 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 7, 2023
@jieyouxu
Copy link
Member

jieyouxu commented Feb 7, 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
2 participants