Skip to content

"this struct takes 1 lifetime argument 0 lifetime arguments were supplied" with tracing macros #19668

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
svix-jplatte opened this issue Apr 23, 2025 · 1 comment · Fixed by #19672
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug

Comments

@svix-jplatte
Copy link

svix-jplatte commented Apr 23, 2025

As of the latest nightly, the following:

fn main() {
    tracing::info!("Hello, world!");
}

emits an error:

this struct takes 1 lifetime argument but 0 lifetime arguments were supplied   rust-analyzer(E0107)

rust-analyzer version: 0.4.2435-standalone
rustc version: 1.88.0-nightly (d5b4c2e4f 2025-04-02)
editor or extension: VSCode, extension version 0.4.2435 (pre-release, from Open VSX)

@svix-jplatte svix-jplatte added the C-bug Category: bug label Apr 23, 2025
@Veykril
Copy link
Member

Veykril commented Apr 23, 2025

minimized

        struct S<'a>(&'a ());
        |_: S| {};

in a similar vein

        struct S<'a>(&'a ());
        let _: S;

should also not emit an error

@Veykril Veykril added A-diagnostics diagnostics / error reporting Broken Window Bugs / technical debt to be addressed immediately and removed Broken Window Bugs / technical debt to be addressed immediately labels Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants