Rust-GCC / Rust-GCC/gccrs

Add --cap-lints option

Open
#575 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
19h 55m
Merged PRs (30d)
67

Description

> rustc --help
...
        --cap-lints LEVEL
                        Set the most restrictive lint level. More restrictive
                        lints are capped at this level
...

I believe that this option allows the compilation of crates while ignoring some errors, for backward compatibility. More information about the option can be found in the RFC introducing it.

I think the paragraph that resumes the behavior of the option the best is the following:

For example when --cap-lints allow is passed, all instances of #[warn], #[deny], and #[forbid] are ignored. If, however --cap-lints warn is passed only deny and forbid directives are ignored.
The acceptable values for LEVEL will be allow, warn, deny, or forbid.

Using something like -frust-cap-lints=LEVEL would also probably make sense and be easy to use. I think this also relies a bit on macros being implemented in order to handle different level of lints directly in the source using the aforementioned directives

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RFC introducing cap-lints, linked in the issue, and compare its semantics with the reported rustc --help text. Trace how gccrs handles compiler options and lint levels; the work is done when allow, warn, deny, and forbid are accepted and the documented capping behavior is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.