1
Fork 0
rust/tests/ui/methods.stderr

344 lines
12 KiB
Text
Raw Normal View History

error: defining a method called `add` on this type; consider implementing the `std::ops::Add` trait or choosing a less ambiguous name
--> $DIR/methods.rs:43:5
|
2019-02-22 08:05:21 +02:00
LL | / pub fn add(self, other: T) -> T {
LL | | unimplemented!()
2019-02-22 08:05:21 +02:00
LL | | }
| |_____^
|
= note: `-D clippy::should-implement-trait` implied by `-D warnings`
error: defining a method called `as_mut` on this type; consider implementing the `std::convert::AsMut` trait or choosing a less ambiguous name
--> $DIR/methods.rs:47:5
|
LL | / pub fn as_mut(&mut self) -> &mut T {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `as_ref` on this type; consider implementing the `std::convert::AsRef` trait or choosing a less ambiguous name
--> $DIR/methods.rs:51:5
|
LL | / pub fn as_ref(&self) -> &T {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `bitand` on this type; consider implementing the `std::ops::BitAnd` trait or choosing a less ambiguous name
--> $DIR/methods.rs:55:5
|
LL | / pub fn bitand(self, rhs: T) -> T {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `bitor` on this type; consider implementing the `std::ops::BitOr` trait or choosing a less ambiguous name
--> $DIR/methods.rs:59:5
|
LL | / pub fn bitor(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `bitxor` on this type; consider implementing the `std::ops::BitXor` trait or choosing a less ambiguous name
--> $DIR/methods.rs:63:5
|
LL | / pub fn bitxor(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `borrow` on this type; consider implementing the `std::borrow::Borrow` trait or choosing a less ambiguous name
--> $DIR/methods.rs:67:5
|
LL | / pub fn borrow(&self) -> &str {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `borrow_mut` on this type; consider implementing the `std::borrow::BorrowMut` trait or choosing a less ambiguous name
--> $DIR/methods.rs:71:5
|
LL | / pub fn borrow_mut(&mut self) -> &mut str {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `clone` on this type; consider implementing the `std::clone::Clone` trait or choosing a less ambiguous name
--> $DIR/methods.rs:75:5
|
LL | / pub fn clone(&self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `cmp` on this type; consider implementing the `std::cmp::Ord` trait or choosing a less ambiguous name
--> $DIR/methods.rs:79:5
|
LL | / pub fn cmp(&self, other: &Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `deref` on this type; consider implementing the `std::ops::Deref` trait or choosing a less ambiguous name
--> $DIR/methods.rs:87:5
|
LL | / pub fn deref(&self) -> &Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `deref_mut` on this type; consider implementing the `std::ops::DerefMut` trait or choosing a less ambiguous name
--> $DIR/methods.rs:91:5
|
LL | / pub fn deref_mut(&mut self) -> &mut Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `div` on this type; consider implementing the `std::ops::Div` trait or choosing a less ambiguous name
--> $DIR/methods.rs:95:5
|
LL | / pub fn div(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `drop` on this type; consider implementing the `std::ops::Drop` trait or choosing a less ambiguous name
--> $DIR/methods.rs:99:5
|
LL | / pub fn drop(&mut self) {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `eq` on this type; consider implementing the `std::cmp::PartialEq` trait or choosing a less ambiguous name
--> $DIR/methods.rs:103:5
|
LL | / pub fn eq(&self, other: &Self) -> bool {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `from_iter` on this type; consider implementing the `std::iter::FromIterator` trait or choosing a less ambiguous name
--> $DIR/methods.rs:107:5
|
LL | / pub fn from_iter<T>(iter: T) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `from_str` on this type; consider implementing the `std::str::FromStr` trait or choosing a less ambiguous name
--> $DIR/methods.rs:111:5
|
LL | / pub fn from_str(s: &str) -> Result<Self, Self> {
LL | | unimplemented!()
LL | | }
| |_____^
error: docs for function returning `Result` missing `# Errors` section
--> $DIR/methods.rs:111:5
|
LL | / pub fn from_str(s: &str) -> Result<Self, Self> {
LL | | unimplemented!()
LL | | }
| |_____^
|
= note: `-D clippy::missing-errors-doc` implied by `-D warnings`
error: defining a method called `hash` on this type; consider implementing the `std::hash::Hash` trait or choosing a less ambiguous name
--> $DIR/methods.rs:115:5
|
LL | / pub fn hash(&self, state: &mut T) {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `index` on this type; consider implementing the `std::ops::Index` trait or choosing a less ambiguous name
--> $DIR/methods.rs:119:5
|
LL | / pub fn index(&self, index: usize) -> &Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `index_mut` on this type; consider implementing the `std::ops::IndexMut` trait or choosing a less ambiguous name
--> $DIR/methods.rs:123:5
|
LL | / pub fn index_mut(&mut self, index: usize) -> &mut Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `into_iter` on this type; consider implementing the `std::iter::IntoIterator` trait or choosing a less ambiguous name
--> $DIR/methods.rs:127:5
|
LL | / pub fn into_iter(self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `mul` on this type; consider implementing the `std::ops::Mul` trait or choosing a less ambiguous name
--> $DIR/methods.rs:131:5
|
LL | / pub fn mul(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `neg` on this type; consider implementing the `std::ops::Neg` trait or choosing a less ambiguous name
--> $DIR/methods.rs:135:5
|
LL | / pub fn neg(self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `next` on this type; consider implementing the `std::iter::Iterator` trait or choosing a less ambiguous name
--> $DIR/methods.rs:139:5
|
LL | / pub fn next(&mut self) -> Option<Self> {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `not` on this type; consider implementing the `std::ops::Not` trait or choosing a less ambiguous name
--> $DIR/methods.rs:143:5
|
LL | / pub fn not(self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `rem` on this type; consider implementing the `std::ops::Rem` trait or choosing a less ambiguous name
--> $DIR/methods.rs:147:5
|
LL | / pub fn rem(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `shl` on this type; consider implementing the `std::ops::Shl` trait or choosing a less ambiguous name
--> $DIR/methods.rs:151:5
|
LL | / pub fn shl(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `shr` on this type; consider implementing the `std::ops::Shr` trait or choosing a less ambiguous name
--> $DIR/methods.rs:155:5
|
LL | / pub fn shr(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: defining a method called `sub` on this type; consider implementing the `std::ops::Sub` trait or choosing a less ambiguous name
--> $DIR/methods.rs:159:5
|
LL | / pub fn sub(self, rhs: Self) -> Self {
LL | | unimplemented!()
LL | | }
| |_____^
error: methods called `new` usually return `Self`
--> $DIR/methods.rs:300:5
|
LL | / fn new() -> i32 {
LL | | 0
LL | | }
| |_____^
|
= note: `-D clippy::new-ret-no-self` implied by `-D warnings`
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
--> $DIR/methods.rs:319:13
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().filter(|&x| *x < 0).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::filter-next` implied by `-D warnings`
= note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
--> $DIR/methods.rs:322:13
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().filter(|&x| {
| _____________^
LL | | *x < 0
LL | | }
LL | | ).next();
| |___________________________^
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:339:22
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().find(|&x| *x < 0).is_some();
2019-08-29 10:06:56 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)`
2018-12-27 16:57:55 +01:00
|
= note: `-D clippy::search-is-some` implied by `-D warnings`
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:340:20
2018-12-27 16:57:55 +01:00
|
LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
2019-08-29 10:06:56 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)`
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:341:20
|
LL | let _ = (0..1).find(|x| *x == 0).is_some();
2019-08-29 10:06:56 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)`
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:342:22
2019-08-29 10:06:56 +02:00
|
LL | let _ = v.iter().find(|x| **x == 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)`
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:345:13
|
2018-12-27 16:57:55 +01:00
LL | let _ = v.iter().find(|&x| {
| _____________^
LL | | *x < 0
LL | | }
LL | | ).is_some();
| |______________________________^
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:351:22
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().position(|&x| x < 0).is_some();
2019-08-29 10:06:56 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:354:13
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().position(|&x| {
| _____________^
LL | | x < 0
LL | | }
LL | | ).is_some();
| |______________________________^
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:360:22
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
2019-08-29 10:06:56 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
--> $DIR/methods.rs:363:13
2018-12-27 16:57:55 +01:00
|
LL | let _ = v.iter().rposition(|&x| {
| _____________^
LL | | x < 0
LL | | }
LL | | ).is_some();
| |______________________________^
error: aborting due to 42 previous errors
2018-01-16 17:06:27 +01:00