Skip to content

Rustfmt fails with 'line exceeded max length' on use of thread_local! #611

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
Marwes opened this issue Nov 15, 2015 · 4 comments
Closed

Comments

@Marwes
Copy link
Contributor

Marwes commented Nov 15, 2015

Rustfmt fails with Rustfmt failed at ./base/src\interner.rs:163: line exceeded maximum length (sorry) when I run it against the crate base of embed_lang.

diff

I would guess that this is because formatting macros are tricky or even impossible in some cases. Might need a better error message if it is not deemed possible however.

@nrc
Copy link
Member

nrc commented Nov 15, 2015

Yeah, likely to be because it's a macro use. We ought to be able to fix this eventually, but it is a little more challenging than other stuff. In the mean time, if you manually fix it up (to fit within the line limit), Rustfmt shouldn't break your formatting.

@radix
Copy link
Contributor

radix commented Aug 9, 2017

perhaps certain common macros that are built-in to rust should be whitelisted as being equivalent to function calls? I ran into this with assert_eq! too

@nrc
Copy link
Member

nrc commented Aug 9, 2017

We actually try to format all macro calls as if they were functions, but sometimes that doesn't work and then we pretty much give up. I would have thought assert_eq would get reformatted properly though.

@radix
Copy link
Contributor

radix commented Aug 10, 2017

hm. well, I reported (and then closed) a case of assert_eq! not being formatted properly in #1868, maybe that's worth double-checking...

@nrc nrc closed this as completed Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants