Stream: t-compiler

Topic: x.py check fails incremental due to unused attr #58633


pnkfelix (Apr 06 2020 at 14:50, on Zulip):

okay yes it is

pnkfelix (Apr 06 2020 at 14:50, on Zulip):

(but its better after an alpha rename. :smiley: )

pnkfelix (Apr 06 2020 at 14:51, on Zulip):

I'm just revisiting #58633 after seeing @eddyb 's comment from last night:

Should we just demote unused_attributes to warn-only at stage0?

It's getting pretty boring to nuke stage0-std every time I rebase and something has changed in libstd (looks even more frequent nowadays), and I've heard people say they don't set incremental = true in cargo.toml because of these "unused attribute" errors, which is a shame.

pnkfelix (Apr 06 2020 at 14:53, on Zulip):

The only reason I can think of to not do what eddyb suggests (namely demoting unused_attributes to warn-only at stage0) is the question of whether we should be doing something more invasive to fix the problem. And the only reason to do something more invasive would be if we expect users outside of rustbuild to be running into this

pnkfelix (Apr 06 2020 at 14:54, on Zulip):

but even then, we can wait until someone actually complains

eddyb (Apr 06 2020 at 14:54, on Zulip):

we should do something more invasive but the UX is getting worse

eddyb (Apr 06 2020 at 14:54, on Zulip):

warn-only would be temporary (famous last words) until we know the problem is fixed

pnkfelix (Apr 06 2020 at 14:54, on Zulip):

that is, the only drawback to doing what eddyb suggests is that it would demotivate the more invasive fix, but the wins from doing what eddyb suggests are so significant

pnkfelix (Apr 06 2020 at 14:54, on Zulip):

that we would be foolish to not do it

eddyb (Apr 06 2020 at 14:55, on Zulip):

and it's also probably trivial, depending how lint overriding works it could be exactly one line in one crate

eddyb (Apr 06 2020 at 14:55, on Zulip):

or a few lines in src/bootstrap/bin/rustc.rs

eddyb (Apr 06 2020 at 14:56, on Zulip):

whereas fixing the incremental side of this... seems hard

eddyb (Apr 06 2020 at 14:56, on Zulip):

(and if we have to do it on a case-by-case basis, it has to be fixed in beta, because that's the only compiler used incrementally when building Rust)

pnkfelix (Apr 06 2020 at 15:00, on Zulip):

what do you mean by "case by case" basis?

eddyb (Apr 06 2020 at 15:02, on Zulip):

some of the comments on the issue looked like they were talking about changing the definition of the attribute to Whitelisted or something like that

pnkfelix (Apr 06 2020 at 15:17, on Zulip):

ah okay

eddyb (Apr 07 2020 at 11:14, on Zulip):

ugh I can't change libstd at all without hitting this

eddyb (Apr 07 2020 at 11:14, on Zulip):

/me is playing with moving str into the library

eddyb (Apr 07 2020 at 11:43, on Zulip):

= note: -D unused-attributes implied by -D warnings

eddyb (Apr 07 2020 at 11:44, on Zulip):

@pnkfelix @simulacrum #![cfg_attr(bootstrap, warn(unused_attributes))] still causes warnings to turn into errors :(

eddyb (Apr 07 2020 at 11:44, on Zulip):

because of what "warn" means there

eddyb (Apr 07 2020 at 11:44, on Zulip):

it's "error" with "deny warnings"

eddyb (Apr 07 2020 at 11:44, on Zulip):

maybe I can do it through the CLI?

simulacrum (Apr 07 2020 at 11:45, on Zulip):

If anything I'd expect us to allow them

simulacrum (Apr 07 2020 at 11:46, on Zulip):

You can edit rustbuild to do so, look in fn cargo in builder.rs

eddyb (Apr 07 2020 at 11:46, on Zulip):

yeah testing that now

eddyb (Apr 07 2020 at 11:48, on Zulip):

-Wunused-attributes doesn't work either sigh

bjorn3 (Apr 07 2020 at 11:51, on Zulip):

All warnings are promoted to errors when -Dwarnings is used, even when you explicitly said -Wunused-attributes. Only -Aunused-attributes will work. -Dwarnings is enabled by default when deny-warnings is set to true in config.toml.

eddyb (Apr 07 2020 at 11:51, on Zulip):

yeaaaaaah

eddyb (Apr 07 2020 at 11:51, on Zulip):

found that out the "hard" way

bjorn3 (Apr 07 2020 at 11:52, on Zulip):

Maybe add a --cap-lint=unused-attributes=warn to rustc to cap only specific lints?

eddyb (Apr 07 2020 at 11:52, on Zulip):

OH OH

eddyb (Apr 07 2020 at 11:52, on Zulip):

I forgot about cap-lint

bjorn3 (Apr 07 2020 at 11:53, on Zulip):

Rustc only has --cap-lints to cap all lints. I was proposing to add a --cap-lint to only cap a single lint.

eddyb (Apr 07 2020 at 11:55, on Zulip):

oh...

eddyb (Apr 07 2020 at 12:01, on Zulip):

opened #70881 FWIW

Last update: Jun 04 2020 at 17:55UTC