Skip to content

Commit fe3f76c

Browse files
committed
Fixing suggestions
1 parent 8fbd19d commit fe3f76c

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

compiler/rustc_expand/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ pub fn expr_to_spanned_string<'a>(
12291229
ast::LitKind::ByteStr(_) => {
12301230
let mut err = cx.struct_span_err(l.span, err_msg);
12311231
err.span_suggestion(
1232-
expr.span.shrink_to_lo(),
1232+
expr.span,
12331233
"consider removing the leading `b`",
12341234
"",
12351235
Applicability::MaybeIncorrect,

src/test/ui/macros/issue-86865.stderr

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ error: format argument must be a string literal
22
--> $DIR/issue-86865.rs:4:14
33
|
44
LL | println!(b"foo");
5-
| -^^^^^
6-
| |
7-
| help: consider removing the leading `b`
5+
| ^^^^^^ help: consider removing the leading `b`
86

97
error: format argument must be a string literal
108
--> $DIR/issue-86865.rs:8:15
119
|
1210
LL | write!(s, b"foo{}", "bar");
13-
| -^^^^^^^
14-
| |
15-
| help: consider removing the leading `b`
11+
| ^^^^^^^^ help: consider removing the leading `b`
1612

1713
error: aborting due to 2 previous errors
1814

src/test/ui/parser/increment-notfixed.stderr

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ help: use `+= 1` instead
88
|
99
LL | { let tmp = i; i += 1; tmp };
1010
| +++++++++++ ~~~~~~~~~~~~~~~
11-
LL | i += 1;
12-
| ~~~~
1311

1412
error: Rust has no postfix increment operator
1513
--> $DIR/increment-notfixed.rs:17:12
@@ -23,8 +21,6 @@ help: use `+= 1` instead
2321
|
2422
LL | while { let tmp = i; i += 1; tmp } < 5 {
2523
| +++++++++++ ~~~~~~~~~~~~~~~
26-
LL | while i += 1 < 5 {
27-
| ~~~~
2824

2925
error: Rust has no postfix increment operator
3026
--> $DIR/increment-notfixed.rs:25:8
@@ -36,8 +32,6 @@ help: use `+= 1` instead
3632
|
3733
LL | { let tmp_ = tmp; tmp += 1; tmp_ };
3834
| ++++++++++++ ~~~~~~~~~~~~~~~~~~
39-
LL | tmp += 1;
40-
| ~~~~
4135

4236
error: Rust has no postfix increment operator
4337
--> $DIR/increment-notfixed.rs:31:14
@@ -51,8 +45,6 @@ help: use `+= 1` instead
5145
|
5246
LL | while { let tmp_ = tmp; tmp += 1; tmp_ } < 5 {
5347
| ++++++++++++ ~~~~~~~~~~~~~~~~~~
54-
LL | while tmp += 1 < 5 {
55-
| ~~~~
5648

5749
error: Rust has no postfix increment operator
5850
--> $DIR/increment-notfixed.rs:39:16
@@ -64,8 +56,6 @@ help: use `+= 1` instead
6456
|
6557
LL | { let tmp = foo.bar.qux; foo.bar.qux += 1; tmp };
6658
| +++++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~
67-
LL | foo.bar.qux += 1;
68-
| ~~~~
6959

7060
error: Rust has no postfix increment operator
7161
--> $DIR/increment-notfixed.rs:49:10
@@ -77,8 +67,6 @@ help: use `+= 1` instead
7767
|
7868
LL | { let tmp = s.tmp; s.tmp += 1; tmp };
7969
| +++++++++++ ~~~~~~~~~~~~~~~~~~~
80-
LL | s.tmp += 1;
81-
| ~~~~
8270

8371
error: Rust has no prefix increment operator
8472
--> $DIR/increment-notfixed.rs:56:5

0 commit comments

Comments
 (0)