Address PR comments
This commit is contained in:
parent
ca701d7aeb
commit
3a5567bad4
6 changed files with 26 additions and 16 deletions
|
|
@ -2,7 +2,7 @@ error: incorrect visibility restriction
|
|||
--> $DIR/pub-restricted.rs:15:6
|
||||
|
|
||||
15 | pub (a) fn afn() {}
|
||||
| ^ to make this visible only to module `a`, add `in` before the path: `in a`
|
||||
| ^ make this visible only to module `a` with `in`: `in a`
|
||||
|
|
||||
= help: some possible visibility restrictions are:
|
||||
`pub(crate)`: visible only on the current crate
|
||||
|
|
@ -13,7 +13,7 @@ error: incorrect visibility restriction
|
|||
--> $DIR/pub-restricted.rs:16:6
|
||||
|
|
||||
16 | pub (b) fn bfn() {}
|
||||
| ^ to make this visible only to module `b`, add `in` before the path: `in b`
|
||||
| ^ make this visible only to module `b` with `in`: `in b`
|
||||
|
|
||||
= help: some possible visibility restrictions are:
|
||||
`pub(crate)`: visible only on the current crate
|
||||
|
|
@ -24,7 +24,7 @@ error: incorrect visibility restriction
|
|||
--> $DIR/pub-restricted.rs:32:14
|
||||
|
|
||||
32 | pub (a) invalid: usize,
|
||||
| ^ to make this visible only to module `a`, add `in` before the path: `in a`
|
||||
| ^ make this visible only to module `a` with `in`: `in a`
|
||||
|
|
||||
= help: some possible visibility restrictions are:
|
||||
`pub(crate)`: visible only on the current crate
|
||||
|
|
@ -35,7 +35,7 @@ error: incorrect visibility restriction
|
|||
--> $DIR/pub-restricted.rs:41:6
|
||||
|
|
||||
41 | pub (xyz) fn xyz() {}
|
||||
| ^^^ to make this visible only to module `xyz`, add `in` before the path: `in xyz`
|
||||
| ^^^ make this visible only to module `xyz` with `in`: `in xyz`
|
||||
|
|
||||
= help: some possible visibility restrictions are:
|
||||
`pub(crate)`: visible only on the current crate
|
||||
|
|
|
|||
|
|
@ -2,15 +2,16 @@ error[E0369]: binary operation `+` cannot be applied to type `&'static str`
|
|||
--> $DIR/issue-39018.rs:12:13
|
||||
|
|
||||
12 | let x = "Hello " + "World!";
|
||||
| ^^^^^^^^ `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left: `"Hello ".to_owned()`
|
||||
| ^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
|
||||
|
|
||||
= note: `+` can't be used to concatenate two `&str` strings
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
|
||||
| let x = "Hello ".to_owned() + "World!";
|
||||
|
||||
error[E0369]: binary operation `+` cannot be applied to type `World`
|
||||
--> $DIR/issue-39018.rs:17:13
|
||||
|
|
||||
17 | let y = World::Hello + World::Goodbye;
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: an implementation of `std::ops::Add` might be missing for `World`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue