diff options
| author | bors <bors@rust-lang.org> | 2025-05-07 06:18:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-07 06:18:39 +0000 |
| commit | f76c7367c6363d33ddb5a93b5de0d158b2d827f6 (patch) | |
| tree | be89d3541e7d64171fd43ca44e19f4f062e22647 /src | |
| parent | 891b8525477f5c41a9e56d7b70d64b41e7c344e3 (diff) | |
| parent | 3d4737fb5e999ef66e57753e432f7f8076bc5192 (diff) | |
| download | rust-f76c7367c6363d33ddb5a93b5de0d158b2d827f6.tar.gz rust-f76c7367c6363d33ddb5a93b5de0d158b2d827f6.zip | |
Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercote
Remove duplicate impl of string unescape from parse_format r? `@nnethercote`
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/asm.rs | 2 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-def/src/hir/format_args.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/asm.rs b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/asm.rs index 9ef03065651..d36e5205c73 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/asm.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower/asm.rs @@ -224,7 +224,7 @@ impl ExprCollector<'_> { curarg = parser.curarg; - let to_span = |inner_span: rustc_parse_format::InnerSpan| { + let to_span = |inner_span: std::ops::Range<usize>| { is_direct_literal.then(|| { TextRange::new( inner_span.start.try_into().unwrap(), diff --git a/src/tools/rust-analyzer/crates/hir-def/src/hir/format_args.rs b/src/tools/rust-analyzer/crates/hir-def/src/hir/format_args.rs index 2fd21bb0ed3..f27a4062a63 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/hir/format_args.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/hir/format_args.rs @@ -214,7 +214,7 @@ pub(crate) fn parse( }; } - let to_span = |inner_span: parse::InnerSpan| { + let to_span = |inner_span: std::ops::Range<usize>| { is_source_literal.then(|| { TextRange::new(inner_span.start.try_into().unwrap(), inner_span.end.try_into().unwrap()) }) @@ -297,7 +297,7 @@ pub(crate) fn parse( unfinished_literal.clear(); } - let span = parser.arg_places.get(placeholder_index).and_then(|&s| to_span(s)); + let span = parser.arg_places.get(placeholder_index).and_then(|s| to_span(s.clone())); placeholder_index += 1; let position_span = to_span(position_span); |
