rust-clippy/tests/ui/strings.stderr

77 lines
2.3 KiB
Text
Raw Normal View History

error: manual implementation of an assign operation
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:20:9
|
2018-10-06 16:18:06 +00:00
20 | x = x + ".";
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: replace it with: `x += "."`
|
= note: `-D clippy::assign-op-pattern` implied by `-D warnings`
error: you added something to a string. Consider using `String::push_str()` instead
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:20:13
|
2018-10-06 16:18:06 +00:00
20 | x = x + ".";
| ^^^^^^^
|
= note: `-D clippy::string-add` implied by `-D warnings`
error: you added something to a string. Consider using `String::push_str()` instead
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:24:13
|
2018-10-06 16:18:06 +00:00
24 | let z = y + "...";
| ^^^^^^^^^
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:34:9
|
2018-10-06 16:18:06 +00:00
34 | x = x + ".";
| ^^^^^^^^^^^
|
= note: `-D clippy::string-add-assign` implied by `-D warnings`
error: manual implementation of an assign operation
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:34:9
|
2018-10-06 16:18:06 +00:00
34 | x = x + ".";
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: replace it with: `x += "."`
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:48:9
|
2018-10-06 16:18:06 +00:00
48 | x = x + ".";
| ^^^^^^^^^^^
error: manual implementation of an assign operation
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:48:9
|
2018-10-06 16:18:06 +00:00
48 | x = x + ".";
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: replace it with: `x += "."`
error: you added something to a string. Consider using `String::push_str()` instead
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:52:13
|
2018-10-06 16:18:06 +00:00
52 | let z = y + "...";
| ^^^^^^^^^
error: calling `as_bytes()` on a string literal
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:60:14
|
2018-10-06 16:18:06 +00:00
60 | let bs = "hello there".as_bytes();
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `b"hello there"`
|
= note: `-D clippy::string-lit-as-bytes` implied by `-D warnings`
2017-07-21 08:40:23 +00:00
error: calling `as_bytes()` on a string literal
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:65:18
2017-07-21 08:40:23 +00:00
|
2018-10-06 16:18:06 +00:00
65 | let strify = stringify!(foobar).as_bytes();
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `bstringify!(foobar)`
error: manual implementation of an assign operation
2018-10-06 16:18:06 +00:00
--> $DIR/strings.rs:75:7
|
2018-10-06 16:18:06 +00:00
75 | ; x = x + 1;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: replace it with: `x += 1`
2018-01-16 16:06:27 +00:00
error: aborting due to 11 previous errors