Refactor allow to expect (#41586)

Replace `allow` with `expect` lints for `unused`, `unsafe_code`,
`dead_code`, and `non_upper_case_globals`.

Testing: So far just check it compiled on `x86_64-linux` on NixOS. Need
to use the module `system.fontconfig.enable = true;` I think in my NixOS
config.
Part of: #40383 

Searching `allow\(.*\)` for `.rs` files shows the following. for
(total_results:total_files) went from `707:386` to `675:368`, a
reduction of `32:18`.

How many files is too many files per PR? I feel like the 20-30 I have is
too big.

---------

Signed-off-by: Wayne Van Son <waynevanson@gmail.com>
This commit is contained in:
Wayne Van Son
2026-01-02 00:40:20 +11:00
committed by GitHub
parent 96ddb0bbf0
commit 5b9263690d
26 changed files with 41 additions and 51 deletions

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
use std::rc::Rc;

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
#[crown::unrooted_must_root_lint::must_root]
struct MustBeRooted;

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
trait TypeHolderTrait {
#[crown::unrooted_must_root_lint::must_root]

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
fn main() {}

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
trait TypeHolderTrait {
#[crown::unrooted_must_root_lint::must_root]

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
use std::rc::Rc;

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
#[crown::unrooted_must_root_lint::must_root]
struct MustBeRooted;

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//@rustc-env:RUSTC_BOOTSTRAP=1
#![allow(dead_code)]
#![expect(dead_code)]
const _: () = assert!(cfg!(crown), "cfg(crown) not set!");