Add tests for pub_restricted
This commit is contained in:
parent
85683bf07c
commit
fed5a89076
@ -18,7 +18,7 @@ struct T;
|
||||
|
||||
impl T {
|
||||
pub fn add(self, other: T) -> T { self }
|
||||
pub fn drop(&mut self) { }
|
||||
pub(crate) fn drop(&mut self) { }
|
||||
|
||||
fn neg(self) -> Self { self } // no error, private function
|
||||
fn eq(&self, other: T) -> bool { true } // no error, private function
|
||||
|
@ -53,8 +53,8 @@ error: defining a method called `add` on this type; consider implementing the `s
|
||||
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:21:5
|
||||
|
|
||||
21 | pub fn drop(&mut self) { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
21 | pub(crate) fn drop(&mut self) { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
|
||||
--> $DIR/methods.rs:31:17
|
||||
|
Loading…
Reference in New Issue
Block a user