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

Poor diagnostics for scoped_thread_local! macro #24145

Closed
rprichard opened this issue Apr 7, 2015 · 3 comments
Closed

Poor diagnostics for scoped_thread_local! macro #24145

rprichard opened this issue Apr 7, 2015 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@rprichard
Copy link
Contributor

scoped-thread-local-test.rs:

macro_rules! define_tls {
    () => {{ scoped_thread_local!(static MY_VAR: u32) }}
}

fn main() {
    define_tls!();
}
rprichard@ryan:~/mess$ rustc scoped-thread-local-test.rs
<std macros>:2:1: 2:2 error: unexpected token: `#`
<std macros>:2 # [
               ^

This diagnostic is not very helpful. It should output source locations.

I found it while testing the macro diagnostics.

Rust version:

rustc 1.0.0-nightly (d17d6e7f1 2015-04-02) (built 2015-04-03)
binary: rustc
commit-hash: d17d6e7f1f05fbdd4d9d246400ffebf768878c7a
commit-date: 2015-04-02
build-date: 2015-04-03
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Apr 7, 2015
@rprichard
Copy link
Contributor Author

I think this issue is just a variant of #23243.

@goffrie
Copy link
Contributor

goffrie commented Nov 17, 2016

This can probably be closed, especially considering that scoped_thread_local is gone :p

@alexcrichton
Copy link
Member

Indeed!

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
Projects
None yet
Development

No branches or pull requests

4 participants