Skip to content

RA reports "expected &dyn Debug, found &i32", rustc is fine with it #17997

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

Closed
djc opened this issue Aug 29, 2024 · 1 comment
Closed

RA reports "expected &dyn Debug, found &i32", rustc is fine with it #17997

djc opened this issue Aug 29, 2024 · 1 comment
Labels
C-bug Category: bug

Comments

@djc
Copy link

djc commented Aug 29, 2024

rust-analyzer version: rust-analyzer version: 0.3.2089-standalone (0f7f68d 2024-08-27)

rustc version: rustc 1.80.0 (051478957 2024-07-21)

editor or extension: VS Code

relevant settings: N/A

repository link (if public, optional): https://github.com/tokio-rs/tracing

code snippet to reproduce:

struct FmtBitset(u64);

impl fmt::Debug for FmtBitset {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let mut set = f.debug_set();
        for bit in 0..64 {
            // if the `bit`-th bit is set, add it to the debug set
            if self.0 & (1 << bit) != 0 {
                set.entry(&bit);
            }

        }
        set.finish()
    }
}
Screenshot 2024-08-29 at 12 20 01
@djc djc added the C-bug Category: bug label Aug 29, 2024
@lnicola
Copy link
Member

lnicola commented Aug 29, 2024

Duplicate of #11847.

@lnicola lnicola closed this as completed Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants