Skip to content

Some errors only show up with cargo build not cargo check #70923

Closed
@oli-obk

Description

@oli-obk

This is partially due to the fact that our analysis query

fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
does not invoke the optimized_mir query on all items in the current crate, and also because we don't run monomorphization when building bin crates.

  • run optimized_mir query in analysis
    • this may cause slowdowns for cargo check because we'd be doing optimizations now
    • All const propagation lints are emitted in optimized_mir, but we may add more in the future.
  • run monomorphization where possible.
    • Not sure how useful this is, it will only give us additional lints in very specific situations. (e.g. when we subtract something form an associated constant, we may get an overflow error depending on the value of the constant).
    • This will also be significantly more expensive than just running optimized_mir

cc @Centril

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions