Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
eeefbb7617c85cb1b51a4758f3d4743f01966578
rust/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.rs

13 lines
216 B
Rust
Raw Normal View History

add disallowed_method lint
2020-09-24 15:32:03 -05:00
#![warn(clippy::disallowed_method)]
extern crate regex;
use regex::Regex;
fn main() {
let re = Regex::new(r"ab.*c").unwrap();
re.is_match("abc");
Support free functions in disallowed-methods lint In other words, support: `disallowed_methods = ["alloc::vec::Vec::new"]` (a free function) in addition to `disallowed_methods = ["alloc::vec::Vec::leak"]` (a method). Improve the documentation to clarify that users must specify the full qualified path for each disallowed function, which can be confusing for reexports. Include an example `clippy.toml`. Simplify the actual lint pass so we can reuse `utils::fn_def_id`.
2021-01-29 22:18:56 -08:00
let a = vec![1, 2, 3, 4];
add disallowed_method lint
2020-09-24 15:32:03 -05:00
a.iter().sum::<i32>();
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 134ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API