File: lint-non-snake-case-crate.rs

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (39 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Don't lint on binary crate with non-snake-case names.
//!
//! See <https://github.com/rust-lang/rust/issues/45127>.

//@ revisions: bin_ cdylib_ dylib_ lib_ proc_macro_ rlib_ staticlib_

// Should not fire on binary crates.
//@[bin_] compile-flags: --crate-type=bin
//@[bin_] check-pass

// But should fire on non-binary crates.

//@[cdylib_] compile-flags: --crate-type=cdylib
//@[cdylib_] needs-dynamic-linking
//@[cdylib_] needs-crate-type: cdylib

//@[dylib_] compile-flags: --crate-type=dylib
//@[dylib_] needs-dynamic-linking
//@[dylib_] needs-crate-type: dylib

//@[lib_] compile-flags: --crate-type=lib

//@[proc_macro_] force-host
//@[proc_macro_] no-prefer-dynamic
//@[proc_macro_] compile-flags: --crate-type=proc-macro
// The compiler may emit a warning that causes stderr output that contains a warning this test does
// not wish to check.
//@[proc_macro_] needs-unwind
//@[proc_macro_] needs-crate-type: proc-macro

//@[rlib_] compile-flags: --crate-type=rlib

//@[staticlib_] compile-flags: --crate-type=staticlib

#![crate_name = "NonSnakeCase"]
//[cdylib_,dylib_,lib_,proc_macro_,rlib_,staticlib_]~^ ERROR crate `NonSnakeCase` should have a snake case name
#![deny(non_snake_case)]

fn main() {}