Skip to content

Allow LintPasses to run after trans #17642

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
kmcallister opened this issue Sep 30, 2014 · 7 comments
Closed

Allow LintPasses to run after trans #17642

kmcallister opened this issue Sep 30, 2014 · 7 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@kmcallister
Copy link
Contributor

We currently have one lint VARIANT_SIZE_DIFFERENCE that's hard-wired into trans. We should generalize this and make it available to lint plugins.

@kmcallister kmcallister added C-cleanup Category: PRs that clean code up or issues documenting cleanup. A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. labels Sep 30, 2014
@sfackler
Copy link
Member

cc #14406

@steveklabnik
Copy link
Member

Triage: looks like no change.

@steveklabnik
Copy link
Member

Triage: still no change

@hanna-kruppe
Copy link
Contributor

Some relevant changes since the OP:

  • VARIANT_SIZE_DIFFERENCES isn't hardwired into trans any more as of Move variant_size_differences out of trans #34755
  • lint plugins are on the way out, the Right Way is a custom driver now
  • we don't even keep HIR around at codegen time any more, let alone walk it

There might still be use cases for emitting lint warnings from monomorphized MIR (if we can find a way to accurately preserve the allow(..), deny(..), etc. annotations in metadata) but AFAIK that's hypothetical and I believe custom drivers can already achieve it by hooking into the relevant queries.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 30, 2018

monomorphized MIR

That's not a thing. We don't monomorphize MIR

I think we should just close this issue. It's very problematic to only report lints in case the trans backend decides on doing something, especially once we get to MIR-only rlibs

@hanna-kruppe
Copy link
Contributor

That's not a thing. We don't monomorphize MIR

Sorry, I should have been more clear, I meant the (generic MIR, substs) pair that codegen item collection produces.

I think we should just close this issue. It's very problematic to only report lints in case the trans backend decides on doing something, especially once we get to MIR-only rlibs

That's always been the case, but yeah it's very sensitive to improvements to the collector or even MIR optimizations. I think it might be OK for some desirable warnings that are impossible to emit pre-monomorphization but YMMV and certainly requires more motivation than is given here.

@hanna-kruppe
Copy link
Contributor

To be clear, I agree that we should close. Although I think the idea of lints emitted from codegen might have some merit,

  1. having one in-tree would be quite controversial and thus should go through the RFC process
  2. writing one out of tree is already possible w/ custom drivers
  3. such lints are entirely hypothetical at this point

So let's close this.

@oli-obk oli-obk closed this as completed Jul 2, 2018
lnicola pushed a commit to lnicola/rust that referenced this issue Jul 28, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

5 participants