mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
address review feedback
This commit is contained in:
parent
4529f1be81
commit
26d2653dd6
1 changed files with 36 additions and 22 deletions
|
@ -926,11 +926,6 @@ fn main() {
|
||||||
fn CheckItWorksWithModAttr(BAD_NAME_HI: u8) {}
|
fn CheckItWorksWithModAttr(BAD_NAME_HI: u8) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait BAD_TRAIT {
|
|
||||||
fn BAD_FUNCTION();
|
|
||||||
fn BadFunction();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(non_snake_case, non_camel_case_types)]
|
#[allow(non_snake_case, non_camel_case_types)]
|
||||||
pub struct some_type {
|
pub struct some_type {
|
||||||
SOME_FIELD: u8,
|
SOME_FIELD: u8,
|
||||||
|
@ -981,9 +976,9 @@ fn main() {
|
||||||
|
|
||||||
check_diagnostics(
|
check_diagnostics(
|
||||||
r#"
|
r#"
|
||||||
trait T { fn a(); }
|
trait T { fn a(); }
|
||||||
struct U {}
|
struct U {}
|
||||||
impl T for U {
|
impl T for U {
|
||||||
fn a() {
|
fn a() {
|
||||||
// this comes out of bitflags, mostly
|
// this comes out of bitflags, mostly
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
@ -996,7 +991,26 @@ impl T for U {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}"#,
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[ignore]
|
||||||
|
fn bug_traits_arent_checked() {
|
||||||
|
// FIXME: Traits and functions in traits aren't currently checked by
|
||||||
|
// r-a, even though rustc will complain about them.
|
||||||
|
check_diagnostics(
|
||||||
|
r#"
|
||||||
|
trait BAD_TRAIT {
|
||||||
|
// ^^^^^^^^^ Trait `BAD_TRAIT` should have CamelCase name, e.g. `BadTrait`
|
||||||
|
fn BAD_FUNCTION();
|
||||||
|
// ^^^^^^^^^^^^ Function `BAD_FUNCTION` should have snake_case name, e.g. `bad_function`
|
||||||
|
fn BadFunction();
|
||||||
|
// ^^^^^^^^^^^^ Function `BadFunction` should have snake_case name, e.g. `bad_function`
|
||||||
|
}
|
||||||
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1006,10 +1020,10 @@ impl T for U {
|
||||||
cov_mark::check!(extern_static_incorrect_case_ignored);
|
cov_mark::check!(extern_static_incorrect_case_ignored);
|
||||||
check_diagnostics(
|
check_diagnostics(
|
||||||
r#"
|
r#"
|
||||||
extern {
|
extern {
|
||||||
fn NonSnakeCaseName(SOME_VAR: u8) -> u8;
|
fn NonSnakeCaseName(SOME_VAR: u8) -> u8;
|
||||||
pub static SomeStatic: u8 = 10;
|
pub static SomeStatic: u8 = 10;
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue