Add tests for pub_restricted

This commit is contained in:
cgm616 2017-10-28 13:24:39 -05:00
parent 85683bf07c
commit fed5a89076
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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