mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
Merge pull request #1301 from devonhollowood/wrong-self-convention-fix
Fix false positive for `wrong_self_convention`
This commit is contained in:
commit
502416fa78
@ -1256,7 +1256,7 @@ impl Convention {
|
||||
fn check(&self, other: &str) -> bool {
|
||||
match *self {
|
||||
Convention::Eq(this) => this == other,
|
||||
Convention::StartsWith(this) => other.starts_with(this),
|
||||
Convention::StartsWith(this) => other.starts_with(this) && this != other,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,10 @@ impl Bar {
|
||||
pub fn to_i64(self) {} //~ERROR: methods called `to_*` usually take self by reference
|
||||
pub fn from_i64(self) {} //~ERROR: methods called `from_*` usually take no self
|
||||
|
||||
// test for false positives
|
||||
fn as_(self) {}
|
||||
fn into_(&self) {}
|
||||
fn is_(self) {}
|
||||
fn to_(self) {}
|
||||
fn from_(self) {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user