Skip to content

Commit f111209

Browse files
committedOct 4, 2022
Auto merge of #102644 - matthiaskrgr:rollup-rg0sw41, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #102441 (Suggest unwrap_or_else when a closure is given) - #102547 (Migrate CSS theme for search results) - #102567 (Delay evaluating lint primary message until after it would be suppressed) - #102624 (rustdoc: remove font family CSS on `.rustdoc-toggle summary::before`) - #102628 (Change the parameter name of From::from to `value`) - #102637 (Ignore fuchsia on two compiler tests) - #102639 (Improve spans when splitting multi-char operator tokens for proc macros.) Failed merges: - #102496 (Suggest `.into()` when all other coercion suggestions fail) r? `@ghost` `@rustbot` modify labels: rollup
·
1.88.01.66.0
2 parents d9f8b4b + 185ca0f commit f111209

31 files changed

+893
-220
lines changed
 

‎compiler/rustc_expand/src/proc_macro_server.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,20 @@ impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStre
115115
// before that get `joint = true`.
116116
let mut op = |s: &str| {
117117
assert!(s.is_ascii());
118-
trees.extend(s.bytes().enumerate().map(|(idx, ch)| {
119-
let is_final = idx == s.len() - 1;
118+
trees.extend(s.bytes().enumerate().map(|(i, ch)| {
119+
let is_final = i == s.len() - 1;
120+
// Split the token span into single chars. Unless the span
121+
// is an unusual one, e.g. due to proc macro expansion. We
122+
// determine this by assuming any span with a length that
123+
// matches the operator length is a normal one, and any
124+
// span with a different length is an unusual one.
125+
let span = if (span.hi() - span.lo()).to_usize() == s.len() {
126+
let lo = span.lo() + BytePos::from_usize(i);
127+
let hi = lo + BytePos::from_usize(1);
128+
span.with_lo(lo).with_hi(hi)
129+
} else {
130+
span
131+
};
120132
TokenTree::Punct(Punct { ch, joint: if is_final { joint } else { true }, span })
121133
}));
122134
};

‎compiler/rustc_hir_analysis/src/check/fn_ctxt/suggestions.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
6565
}
6666

6767
/// When encountering an fn-like type, try accessing the output of the type
68-
/// // and suggesting calling it if it satisfies a predicate (i.e. if the
68+
/// and suggesting calling it if it satisfies a predicate (i.e. if the
6969
/// output has a method or a field):
7070
/// ```compile_fail,E0308
7171
/// fn foo(x: usize) -> usize { x }
@@ -139,7 +139,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
139139
sugg,
140140
applicability,
141141
);
142-
143142
return true;
144143
}
145144
false
@@ -338,6 +337,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
338337
} else {
339338
err.span_suggestion(sp, &msg, suggestion, applicability);
340339
}
340+
} else if self.suggest_else_fn_with_closure(err, expr, found, expected)
341+
{
341342
} else if self.suggest_fn_call(err, expr, found, |output| self.can_coerce(output, expected))
342343
&& let ty::FnDef(def_id, ..) = &found.kind()
343344
&& let Some(sp) = self.tcx.hir().span_if_local(*def_id)

‎compiler/rustc_hir_analysis/src/check/method/suggest.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,6 +2324,60 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23242324
}
23252325
}
23262326

2327+
/// issue #102320, for `unwrap_or` with closure as argument, suggest `unwrap_or_else`
2328+
/// FIXME: currently not working for suggesting `map_or_else`, see #102408
2329+
pub(crate) fn suggest_else_fn_with_closure(
2330+
&self,
2331+
err: &mut Diagnostic,
2332+
expr: &hir::Expr<'_>,
2333+
found: Ty<'tcx>,
2334+
expected: Ty<'tcx>,
2335+
) -> bool {
2336+
let Some((_def_id_or_name, output, _inputs)) = self.extract_callable_info(expr, found)
2337+
else { return false; };
2338+
2339+
if !self.can_coerce(output, expected) {
2340+
return false;
2341+
}
2342+
2343+
let parent = self.tcx.hir().get_parent_node(expr.hir_id);
2344+
if let Some(Node::Expr(call_expr)) = self.tcx.hir().find(parent) &&
2345+
let hir::ExprKind::MethodCall(
2346+
hir::PathSegment { ident: method_name, .. },
2347+
self_expr,
2348+
args,
2349+
..,
2350+
) = call_expr.kind &&
2351+
let Some(self_ty) = self.typeck_results.borrow().expr_ty_opt(self_expr) {
2352+
let new_name = Ident {
2353+
name: Symbol::intern(&format!("{}_else", method_name.as_str())),
2354+
span: method_name.span,
2355+
};
2356+
let probe = self.lookup_probe(
2357+
expr.span,
2358+
new_name,
2359+
self_ty,
2360+
self_expr,
2361+
ProbeScope::TraitsInScope,
2362+
);
2363+
2364+
// check the method arguments number
2365+
if let Ok(pick) = probe &&
2366+
let fn_sig = self.tcx.fn_sig(pick.item.def_id) &&
2367+
let fn_args = fn_sig.skip_binder().inputs() &&
2368+
fn_args.len() == args.len() + 1 {
2369+
err.span_suggestion_verbose(
2370+
method_name.span.shrink_to_hi(),
2371+
&format!("try calling `{}` instead", new_name.name.as_str()),
2372+
"_else",
2373+
Applicability::MaybeIncorrect,
2374+
);
2375+
return true;
2376+
}
2377+
}
2378+
false
2379+
}
2380+
23272381
/// Checks whether there is a local type somewhere in the chain of
23282382
/// autoderefs of `rcvr_ty`.
23292383
fn type_derefs_to_local(

‎compiler/rustc_middle/src/lint.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ pub fn struct_lint_level(
350350
(Level::Deny | Level::Forbid, None) => sess.diagnostic().struct_err_lint(""),
351351
};
352352

353-
err.set_primary_message(msg);
354353
err.set_is_lint();
355354

356355
// If this code originates in a foreign macro, aka something that this crate
@@ -375,6 +374,10 @@ pub fn struct_lint_level(
375374
}
376375
}
377376

377+
// Delay evaluating and setting the primary message until after we've
378+
// suppressed the lint due to macros.
379+
err.set_primary_message(msg);
380+
378381
// Lint diagnostics that are covered by the expect level will not be emitted outside
379382
// the compiler. It is therefore not necessary to add any information for the user.
380383
// This will therefore directly call the decorate function which will in turn emit

‎library/core/src/convert/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ pub trait From<T>: Sized {
545545
#[lang = "from"]
546546
#[must_use]
547547
#[stable(feature = "rust1", since = "1.0.0")]
548-
fn from(_: T) -> Self;
548+
fn from(value: T) -> Self;
549549
}
550550

551551
/// An attempted conversion that consumes `self`, which may or may not be

‎src/librustdoc/html/static/css/rustdoc.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,10 @@ h1, h2, h3, h4, h5, h6,
194194
.item-left > a,
195195
.out-of-band,
196196
span.since,
197-
details.rustdoc-toggle > summary::before,
198197
a.srclink,
199198
#help-button > button,
200199
details.rustdoc-toggle.top-doc > summary,
201-
details.rustdoc-toggle.top-doc > summary::before,
202200
details.rustdoc-toggle.non-exhaustive > summary,
203-
details.rustdoc-toggle.non-exhaustive > summary::before,
204201
.scraped-example-title,
205202
.more-examples-toggle summary, .more-examples-toggle .hide-more,
206203
.example-links a,
@@ -970,6 +967,11 @@ so that we can apply CSS-filters to change the arrow color in themes */
970967
padding-right: 1em;
971968
}
972969

970+
.search-results a:hover,
971+
.search-results a:focus {
972+
background-color: var(--search-result-link-focus-background-color);
973+
}
974+
973975
.popover {
974976
font-size: 1rem;
975977
position: absolute;
@@ -1567,7 +1569,6 @@ details.rustdoc-toggle > summary::before {
15671569
}
15681570

15691571
details.rustdoc-toggle > summary.hideme > span,
1570-
details.rustdoc-toggle > summary::before,
15711572
.more-examples-toggle summary, .more-examples-toggle .hide-more {
15721573
color: var(--toggles-color);
15731574
}

‎src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
3737
--link-color: #39afd7;
3838
--sidebar-link-color: #53b1db;
3939
--sidebar-current-link-background-color: transparent;
40+
--search-result-link-focus-background-color: #3c3c3c;
4041
--stab-background-color: #314559;
4142
--stab-code-color: #e6e1cf;
4243
}
@@ -250,30 +251,6 @@ pre.rust .kw {}
250251
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, pre.rust .attribute {}
251252
pre.rust .kw-2, pre.rust .prelude-ty {}
252253

253-
.search-results a:focus span {}
254-
a.result-trait:focus {}
255-
a.result-traitalias:focus {}
256-
a.result-mod:focus,
257-
a.result-externcrate:focus {}
258-
a.result-mod:focus {}
259-
a.result-externcrate:focus {}
260-
a.result-enum:focus {}
261-
a.result-struct:focus {}
262-
a.result-union:focus {}
263-
a.result-fn:focus,
264-
a.result-method:focus,
265-
a.result-tymethod:focus {}
266-
a.result-type:focus {}
267-
a.result-associatedtype:focus {}
268-
a.result-foreigntype:focus {}
269-
a.result-attr:focus,
270-
a.result-derive:focus,
271-
a.result-macro:focus {}
272-
a.result-constant:focus,
273-
a.result-static:focus {}
274-
a.result-primitive:focus {}
275-
a.result-keyword:focus {}
276-
277254
kbd {
278255
color: #c5c5c5;
279256
background-color: #314559;

‎src/librustdoc/html/static/css/themes/dark.css

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
--link-color: #d2991d;
3333
--sidebar-link-color: #fdbf35;
3434
--sidebar-current-link-background-color: #444;
35+
--search-result-link-focus-background-color: #616161;
3536
--stab-background-color: #314559;
3637
--stab-code-color: #e6e1cf;
3738
}
@@ -58,36 +59,6 @@ input:focus + .slider {
5859
background-color: #0a042f !important;
5960
}
6061

61-
.search-results a:hover {
62-
background-color: #777;
63-
}
64-
65-
.search-results a:focus {
66-
color: #eee !important;
67-
background-color: #616161;
68-
}
69-
.search-results a:focus span { color: #eee !important; }
70-
a.result-trait:focus { background-color: #013191; }
71-
a.result-traitalias:focus { background-color: #013191; }
72-
a.result-mod:focus,
73-
a.result-externcrate:focus { background-color: #884719; }
74-
a.result-enum:focus { background-color: #194e9f; }
75-
a.result-struct:focus { background-color: #194e9f; }
76-
a.result-union:focus { background-color: #194e9f; }
77-
a.result-fn:focus,
78-
a.result-method:focus,
79-
a.result-tymethod:focus { background-color: #4950ed; }
80-
a.result-type:focus { background-color: #194e9f; }
81-
a.result-associatedtype:focus { background-color: #884719; }
82-
a.result-foreigntype:focus { background-color: #194e9f; }
83-
a.result-attr:focus,
84-
a.result-derive:focus,
85-
a.result-macro:focus { background-color: #217d1c; }
86-
a.result-constant:focus,
87-
a.result-static:focus { background-color: #884719; }
88-
a.result-primitive:focus { background-color: #194e9f; }
89-
a.result-keyword:focus { background-color: #884719; }
90-
9162
.content .item-info::before { color: #ccc; }
9263

9364
pre.rust .comment { color: #8d8d8b; }

‎src/librustdoc/html/static/css/themes/light.css

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
--link-color: #3873ad;
3333
--sidebar-link-color: #356da4;
3434
--sidebar-current-link-background-color: #fff;
35+
--search-result-link-focus-background-color: #ccc;
3536
--stab-background-color: #fff5d6;
3637
--stab-code-color: #000;
3738
}
@@ -57,36 +58,6 @@ input:focus + .slider {
5758
background-color: #FDFFD3 !important;
5859
}
5960

60-
.search-results a:hover {
61-
background-color: #ddd;
62-
}
63-
64-
.search-results a:focus {
65-
color: #000 !important;
66-
background-color: #ccc;
67-
}
68-
.search-results a:focus span { color: #000 !important; }
69-
a.result-trait:focus { background-color: #c7b6ff; }
70-
a.result-traitalias:focus { background-color: #c7b6ff; }
71-
a.result-mod:focus,
72-
a.result-externcrate:focus { background-color: #afc6e4; }
73-
a.result-enum:focus { background-color: #e7b1a0; }
74-
a.result-struct:focus { background-color: #e7b1a0; }
75-
a.result-union:focus { background-color: #e7b1a0; }
76-
a.result-fn:focus,
77-
a.result-method:focus,
78-
a.result-tymethod:focus { background-color: #c6afb3; }
79-
a.result-type:focus { background-color: #e7b1a0; }
80-
a.result-associatedtype:focus { background-color: #afc6e4; }
81-
a.result-foreigntype:focus { background-color: #e7b1a0; }
82-
a.result-attr:focus,
83-
a.result-derive:focus,
84-
a.result-macro:focus { background-color: #8ce488; }
85-
a.result-constant:focus,
86-
a.result-static:focus { background-color: #afc6e4; }
87-
a.result-primitive:focus { background-color: #e7b1a0; }
88-
a.result-keyword:focus { background-color: #afc6e4; }
89-
9061
.content .item-info::before { color: #ccc; }
9162

9263
body.source .example-wrap pre.rust a {

‎src/test/rustdoc-gui/search-result-color.goml

Lines changed: 597 additions & 44 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#[macro_export]
2+
macro_rules! foo {
3+
() => {
4+
let x: &Option<i32> = &Some(1);
5+
let _y = x as *const Option<i32>;
6+
}
7+
}

‎src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..489) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(487..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..506) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(504..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }]
1+
TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..488) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(488..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..505) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(505..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }]
22
error: unnecessary trailing semicolon
33
--> $DIR/redundant-semi-proc-macro.rs:9:19
44
|

‎src/test/ui/lint/trivial-cast-ice.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// aux-build:trivial-cast-ice.rs
2+
// check-pass
3+
4+
// Demonstrates the ICE in #102561
5+
6+
#![deny(trivial_casts)]
7+
8+
extern crate trivial_cast_ice;
9+
10+
fn main() {
11+
trivial_cast_ice::foo!();
12+
}

‎src/test/ui/proc-macro/attr-complex-fn.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
5353
Punct {
5454
ch: '>',
5555
spacing: Joint,
56-
span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0),
56+
span: $DIR/attr-complex-fn.rs:19:36: 19:37 (#0),
5757
},
5858
Punct {
5959
ch: '>',
6060
spacing: Joint,
61-
span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0),
61+
span: $DIR/attr-complex-fn.rs:19:37: 19:38 (#0),
6262
},
6363
Punct {
6464
ch: '>',

‎src/test/ui/proc-macro/capture-macro-rules-invoke.stdout

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
177177
Punct {
178178
ch: ':',
179179
spacing: Joint,
180-
span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0),
180+
span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:17 (#0),
181181
},
182182
Punct {
183183
ch: ':',
184184
spacing: Alone,
185-
span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0),
185+
span: $DIR/capture-macro-rules-invoke.rs:45:17: 45:18 (#0),
186186
},
187187
Ident {
188188
ident: "option",
@@ -191,12 +191,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
191191
Punct {
192192
ch: ':',
193193
spacing: Joint,
194-
span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0),
194+
span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:25 (#0),
195195
},
196196
Punct {
197197
ch: ':',
198198
spacing: Alone,
199-
span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0),
199+
span: $DIR/capture-macro-rules-invoke.rs:45:25: 45:26 (#0),
200200
},
201201
Ident {
202202
ident: "Option",
@@ -231,12 +231,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
231231
Punct {
232232
ch: ':',
233233
spacing: Joint,
234-
span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0),
234+
span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:25 (#0),
235235
},
236236
Punct {
237237
ch: ':',
238238
spacing: Alone,
239-
span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0),
239+
span: $DIR/capture-macro-rules-invoke.rs:46:25: 46:26 (#0),
240240
},
241241
Ident {
242242
ident: "path",

‎src/test/ui/proc-macro/debug/dump-debug-span-debug.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
// aux-build:macro-dump-debug.rs
33
// compile-flags: -Z span-debug
44

5+
56
extern crate macro_dump_debug;
67
use macro_dump_debug::dump_debug;
78

89
dump_debug! {
910
ident // ident
1011
r#ident // raw ident
1112
, // alone punct
12-
==> // joint punct
13+
&& // joint punct, two-char op
14+
||> // joint punct, two-char op + one-char op
15+
||<< // joint punct, two-char op + two-char op
16+
..= // joint punct, three-char op
17+
<<=! // joint punct, three-char op + one-char-op
1318
() // empty group
1419
[_] // nonempty group
1520

Lines changed: 96 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,231 @@
1-
TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }]
1+
TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0) }, Punct { ch: '&', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0) }, Punct { ch: '&', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0) }, Punct { ch: '<', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0) }, Punct { ch: '=', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0) }, Punct { ch: '!', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0) }]
22
TokenStream [
33
Ident {
44
ident: "ident",
5-
span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0),
5+
span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0),
66
},
77
Ident {
88
ident: "r#ident",
9-
span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0),
9+
span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0),
1010
},
1111
Punct {
1212
ch: ',',
1313
spacing: Alone,
14-
span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0),
14+
span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0),
15+
},
16+
Punct {
17+
ch: '&',
18+
spacing: Joint,
19+
span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0),
20+
},
21+
Punct {
22+
ch: '&',
23+
spacing: Alone,
24+
span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0),
25+
},
26+
Punct {
27+
ch: '|',
28+
spacing: Joint,
29+
span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0),
30+
},
31+
Punct {
32+
ch: '|',
33+
spacing: Joint,
34+
span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0),
35+
},
36+
Punct {
37+
ch: '>',
38+
spacing: Alone,
39+
span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0),
40+
},
41+
Punct {
42+
ch: '|',
43+
spacing: Joint,
44+
span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0),
45+
},
46+
Punct {
47+
ch: '|',
48+
spacing: Joint,
49+
span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0),
50+
},
51+
Punct {
52+
ch: '<',
53+
spacing: Joint,
54+
span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0),
55+
},
56+
Punct {
57+
ch: '<',
58+
spacing: Alone,
59+
span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0),
60+
},
61+
Punct {
62+
ch: '.',
63+
spacing: Joint,
64+
span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0),
65+
},
66+
Punct {
67+
ch: '.',
68+
spacing: Joint,
69+
span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0),
1570
},
1671
Punct {
1772
ch: '=',
73+
spacing: Alone,
74+
span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0),
75+
},
76+
Punct {
77+
ch: '<',
1878
spacing: Joint,
19-
span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0),
79+
span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0),
80+
},
81+
Punct {
82+
ch: '<',
83+
spacing: Joint,
84+
span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0),
2085
},
2186
Punct {
2287
ch: '=',
2388
spacing: Joint,
24-
span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0),
89+
span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0),
2590
},
2691
Punct {
27-
ch: '>',
92+
ch: '!',
2893
spacing: Alone,
29-
span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0),
94+
span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0),
3095
},
3196
Group {
3297
delimiter: Parenthesis,
3398
stream: TokenStream [],
34-
span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0),
99+
span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0),
35100
},
36101
Group {
37102
delimiter: Bracket,
38103
stream: TokenStream [
39104
Ident {
40105
ident: "_",
41-
span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0),
106+
span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0),
42107
},
43108
],
44-
span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0),
109+
span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0),
45110
},
46111
Literal {
47112
kind: Integer,
48113
symbol: "0",
49114
suffix: None,
50-
span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0),
115+
span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0),
51116
},
52117
Literal {
53118
kind: Float,
54119
symbol: "1.0",
55120
suffix: None,
56-
span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0),
121+
span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0),
57122
},
58123
Literal {
59124
kind: Str,
60125
symbol: "S",
61126
suffix: None,
62-
span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0),
127+
span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0),
63128
},
64129
Literal {
65130
kind: ByteStr,
66131
symbol: "B",
67132
suffix: None,
68-
span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0),
133+
span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0),
69134
},
70135
Literal {
71136
kind: StrRaw(0),
72137
symbol: "R",
73138
suffix: None,
74-
span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0),
139+
span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0),
75140
},
76141
Literal {
77142
kind: StrRaw(2),
78143
symbol: "R",
79144
suffix: None,
80-
span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0),
145+
span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0),
81146
},
82147
Literal {
83148
kind: ByteStrRaw(0),
84149
symbol: "BR",
85150
suffix: None,
86-
span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0),
151+
span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0),
87152
},
88153
Literal {
89154
kind: ByteStrRaw(2),
90155
symbol: "BR",
91156
suffix: None,
92-
span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0),
157+
span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0),
93158
},
94159
Literal {
95160
kind: Char,
96161
symbol: "C",
97162
suffix: None,
98-
span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0),
163+
span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0),
99164
},
100165
Literal {
101166
kind: Byte,
102167
symbol: "B",
103168
suffix: None,
104-
span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0),
169+
span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0),
105170
},
106171
Literal {
107172
kind: Integer,
108173
symbol: "0",
109174
suffix: Some("q"),
110-
span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0),
175+
span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0),
111176
},
112177
Literal {
113178
kind: Float,
114179
symbol: "1.0",
115180
suffix: Some("q"),
116-
span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0),
181+
span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0),
117182
},
118183
Literal {
119184
kind: Str,
120185
symbol: "S",
121186
suffix: Some("q"),
122-
span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0),
187+
span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0),
123188
},
124189
Literal {
125190
kind: ByteStr,
126191
symbol: "B",
127192
suffix: Some("q"),
128-
span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0),
193+
span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0),
129194
},
130195
Literal {
131196
kind: StrRaw(0),
132197
symbol: "R",
133198
suffix: Some("q"),
134-
span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0),
199+
span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0),
135200
},
136201
Literal {
137202
kind: StrRaw(2),
138203
symbol: "R",
139204
suffix: Some("q"),
140-
span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0),
205+
span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0),
141206
},
142207
Literal {
143208
kind: ByteStrRaw(0),
144209
symbol: "BR",
145210
suffix: Some("q"),
146-
span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0),
211+
span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0),
147212
},
148213
Literal {
149214
kind: ByteStrRaw(2),
150215
symbol: "BR",
151216
suffix: Some("q"),
152-
span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0),
217+
span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0),
153218
},
154219
Literal {
155220
kind: Char,
156221
symbol: "C",
157222
suffix: Some("q"),
158-
span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0),
223+
span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0),
159224
},
160225
Literal {
161226
kind: Byte,
162227
symbol: "B",
163228
suffix: Some("q"),
164-
span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0),
229+
span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0),
165230
},
166231
]

‎src/test/ui/proc-macro/debug/dump-debug.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }]
1+
TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..204) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(204..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }]
22
TokenStream [
33
Ident {
44
ident: "ident",
@@ -16,12 +16,12 @@ TokenStream [
1616
Punct {
1717
ch: '=',
1818
spacing: Joint,
19-
span: #0 bytes(203..205),
19+
span: #0 bytes(203..204),
2020
},
2121
Punct {
2222
ch: '=',
2323
spacing: Joint,
24-
span: #0 bytes(203..205),
24+
span: #0 bytes(204..205),
2525
},
2626
Punct {
2727
ch: '>',

‎src/test/ui/proc-macro/dollar-crate-issue-57089.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
1818
Punct {
1919
ch: ':',
2020
spacing: Joint,
21-
span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4),
21+
span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:29 (#4),
2222
},
2323
Punct {
2424
ch: ':',
2525
spacing: Alone,
26-
span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4),
26+
span: $DIR/dollar-crate-issue-57089.rs:17:29: 17:30 (#4),
2727
},
2828
Ident {
2929
ident: "S",
@@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
5858
Punct {
5959
ch: ':',
6060
spacing: Joint,
61-
span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4),
61+
span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:25 (#4),
6262
},
6363
Punct {
6464
ch: ':',
6565
spacing: Alone,
66-
span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4),
66+
span: $DIR/dollar-crate-issue-57089.rs:21:25: 21:26 (#4),
6767
},
6868
Ident {
6969
ident: "S",

‎src/test/ui/proc-macro/dollar-crate-issue-62325.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
3030
Punct {
3131
ch: ':',
3232
spacing: Joint,
33-
span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4),
33+
span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:31 (#4),
3434
},
3535
Punct {
3636
ch: ':',
3737
spacing: Alone,
38-
span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4),
38+
span: $DIR/dollar-crate-issue-62325.rs:19:31: 19:32 (#4),
3939
},
4040
Ident {
4141
ident: "S",
@@ -85,12 +85,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
8585
Punct {
8686
ch: ':',
8787
spacing: Joint,
88-
span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12),
88+
span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:31 (#12),
8989
},
9090
Punct {
9191
ch: ':',
9292
spacing: Alone,
93-
span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12),
93+
span: $DIR/auxiliary/dollar-crate-external.rs:21:31: 21:32 (#12),
9494
},
9595
Ident {
9696
ident: "S",

‎src/test/ui/proc-macro/dollar-crate.stdout

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
1818
Punct {
1919
ch: ':',
2020
spacing: Joint,
21-
span: $DIR/dollar-crate.rs:20:32: 20:34 (#4),
21+
span: $DIR/dollar-crate.rs:20:32: 20:33 (#4),
2222
},
2323
Punct {
2424
ch: ':',
2525
spacing: Alone,
26-
span: $DIR/dollar-crate.rs:20:32: 20:34 (#4),
26+
span: $DIR/dollar-crate.rs:20:33: 20:34 (#4),
2727
},
2828
Ident {
2929
ident: "S",
@@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
5858
Punct {
5959
ch: ':',
6060
spacing: Joint,
61-
span: $DIR/dollar-crate.rs:24:28: 24:30 (#4),
61+
span: $DIR/dollar-crate.rs:24:28: 24:29 (#4),
6262
},
6363
Punct {
6464
ch: ':',
6565
spacing: Alone,
66-
span: $DIR/dollar-crate.rs:24:28: 24:30 (#4),
66+
span: $DIR/dollar-crate.rs:24:29: 24:30 (#4),
6767
},
6868
Ident {
6969
ident: "S",
@@ -98,12 +98,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
9898
Punct {
9999
ch: ':',
100100
spacing: Joint,
101-
span: $DIR/dollar-crate.rs:27:28: 27:30 (#4),
101+
span: $DIR/dollar-crate.rs:27:28: 27:29 (#4),
102102
},
103103
Punct {
104104
ch: ':',
105105
spacing: Alone,
106-
span: $DIR/dollar-crate.rs:27:28: 27:30 (#4),
106+
span: $DIR/dollar-crate.rs:27:29: 27:30 (#4),
107107
},
108108
Ident {
109109
ident: "S",
@@ -138,12 +138,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
138138
Punct {
139139
ch: ':',
140140
spacing: Joint,
141-
span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15),
141+
span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:29 (#15),
142142
},
143143
Punct {
144144
ch: ':',
145145
spacing: Alone,
146-
span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15),
146+
span: $DIR/auxiliary/dollar-crate-external.rs:7:29: 7:30 (#15),
147147
},
148148
Ident {
149149
ident: "S",
@@ -178,12 +178,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
178178
Punct {
179179
ch: ':',
180180
spacing: Joint,
181-
span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15),
181+
span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:25 (#15),
182182
},
183183
Punct {
184184
ch: ':',
185185
spacing: Alone,
186-
span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15),
186+
span: $DIR/auxiliary/dollar-crate-external.rs:11:25: 11:26 (#15),
187187
},
188188
Ident {
189189
ident: "S",
@@ -218,12 +218,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
218218
Punct {
219219
ch: ':',
220220
spacing: Joint,
221-
span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15),
221+
span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:25 (#15),
222222
},
223223
Punct {
224224
ch: ':',
225225
spacing: Alone,
226-
span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15),
226+
span: $DIR/auxiliary/dollar-crate-external.rs:14:25: 14:26 (#15),
227227
},
228228
Ident {
229229
ident: "S",

‎src/test/ui/proc-macro/inner-attrs.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
627627
Punct {
628628
ch: '=',
629629
spacing: Joint,
630-
span: $DIR/inner-attrs.rs:39:15: 39:17 (#0),
630+
span: $DIR/inner-attrs.rs:39:15: 39:16 (#0),
631631
},
632632
Punct {
633633
ch: '>',
634634
spacing: Alone,
635-
span: $DIR/inner-attrs.rs:39:15: 39:17 (#0),
635+
span: $DIR/inner-attrs.rs:39:16: 39:17 (#0),
636636
},
637637
Group {
638638
delimiter: Brace,

‎src/test/ui/proc-macro/issue-75930-derive-cfg.stdout

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
489489
Punct {
490490
ch: '=',
491491
spacing: Joint,
492-
span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0),
492+
span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:33 (#0),
493493
},
494494
Punct {
495495
ch: '>',
496496
spacing: Alone,
497-
span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0),
497+
span: $DIR/issue-75930-derive-cfg.rs:33:33: 33:34 (#0),
498498
},
499499
Group {
500500
delimiter: Brace,
@@ -567,12 +567,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
567567
Punct {
568568
ch: '=',
569569
spacing: Joint,
570-
span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
570+
span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0),
571571
},
572572
Punct {
573573
ch: '>',
574574
spacing: Alone,
575-
span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
575+
span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0),
576576
},
577577
Group {
578578
delimiter: Brace,
@@ -591,12 +591,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
591591
Punct {
592592
ch: '=',
593593
spacing: Joint,
594-
span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
594+
span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0),
595595
},
596596
Punct {
597597
ch: '>',
598598
spacing: Alone,
599-
span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
599+
span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0),
600600
},
601601
Group {
602602
delimiter: Brace,
@@ -1519,12 +1519,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
15191519
Punct {
15201520
ch: '=',
15211521
spacing: Joint,
1522-
span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
1522+
span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0),
15231523
},
15241524
Punct {
15251525
ch: '>',
15261526
spacing: Alone,
1527-
span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
1527+
span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0),
15281528
},
15291529
Group {
15301530
delimiter: Brace,
@@ -1543,12 +1543,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
15431543
Punct {
15441544
ch: '=',
15451545
spacing: Joint,
1546-
span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
1546+
span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0),
15471547
},
15481548
Punct {
15491549
ch: '>',
15501550
spacing: Alone,
1551-
span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
1551+
span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0),
15521552
},
15531553
Group {
15541554
delimiter: Brace,

‎src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
4141
Punct {
4242
ch: '=',
4343
spacing: Joint,
44-
span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0),
44+
span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:22 (#0),
4545
},
4646
Punct {
4747
ch: '>',
4848
spacing: Alone,
49-
span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0),
49+
span: $DIR/issue-76182-leading-vert-pat.rs:15:22: 15:23 (#0),
5050
},
5151
Group {
5252
delimiter: Parenthesis,

‎src/test/ui/proc-macro/meta-macro-hygiene.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5)
2-
Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
2+
Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:44 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:44: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
33
Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }]
44
#![feature /* 0#0 */(prelude_import)]
55
// aux-build:make-macro.rs

‎src/test/ui/proc-macro/three-equals.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ LL | three_equals!(==);
88
= note: this error originates in the macro `three_equals` (in Nightly builds, run with -Z macro-backtrace for more info)
99

1010
error: expected EOF, found `=`.
11-
--> $DIR/three-equals.rs:15:21
11+
--> $DIR/three-equals.rs:15:22
1212
|
1313
LL | three_equals!(=====);
14-
| ^^
14+
| ^
1515
|
1616
note: last good input was here
1717
--> $DIR/three-equals.rs:15:21
1818
|
1919
LL | three_equals!(=====);
20-
| ^^
20+
| ^
2121
= help: input must be: `===`
2222

2323
error: expected `=`, found `abc`.

‎src/test/ui/process/process-panic-after-fork.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// ignore-emscripten no processes
77
// ignore-sgx no processes
88
// ignore-android: FIXME(#85261)
9+
// ignore-fuchsia no fork
910

1011
#![feature(rustc_private)]
1112
#![feature(never_type)]

‎src/test/ui/simd/target-feature-mixup.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
// ignore-emscripten
77
// ignore-sgx no processes
8+
// ignore-fuchsia must translate zircon signal to SIGILL, FIXME (#58590)
89

910
#![feature(repr_simd, target_feature, cfg_target_feature)]
1011
#![feature(avx512_target_feature)]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// run-rustfix
2+
3+
fn main() {
4+
let x = "com.example.app";
5+
let y: Option<&str> = None;
6+
let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
7+
//~^ ERROR: mismatched types [E0308]
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// run-rustfix
2+
3+
fn main() {
4+
let x = "com.example.app";
5+
let y: Option<&str> = None;
6+
let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
7+
//~^ ERROR: mismatched types [E0308]
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/sugg-else-for-closure.rs:6:26
3+
|
4+
LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
5+
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure
6+
| |
7+
| arguments to this function are incorrect
8+
|
9+
= note: expected reference `&str`
10+
found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]`
11+
note: associated function defined here
12+
--> $SRC_DIR/core/src/option.rs:LL:COL
13+
|
14+
LL | pub const fn unwrap_or(self, default: T) -> T
15+
| ^^^^^^^^^
16+
help: try calling `unwrap_or_else` instead
17+
|
18+
LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
19+
| +++++
20+
21+
error: aborting due to previous error
22+
23+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)
Please sign in to comment.