Skip to content

Commit 97b5caa

Browse files
committed
Auto merge of #139845 - Zalathar:rollup-u5u5y1v, r=Zalathar
Rollup of 17 pull requests Successful merges: - #138374 (Enable contracts for const functions) - #138380 (ci: add runners for vanilla LLVM 20) - #138393 (Allow const patterns of matches to contain pattern types) - #139517 (std: sys: process: uefi: Use NULL stdin by default) - #139554 (std: add Output::exit_ok) - #139660 (compiletest: Add an experimental new executor to replace libtest) - #139669 (Overhaul `AssocItem`) - #139671 (Proc macro span API redesign: Replace proc_macro::SourceFile by Span::{file, local_file}) - #139750 (std/thread: Use default stack size from menuconfig for NuttX) - #139772 (Remove `hir::Map`) - #139785 (Let CStrings be either 1 or 2 byte aligned.) - #139789 (do not unnecessarily leak auto traits in item bounds) - #139791 (drop global where-bounds before merging candidates) - #139798 (normalize: prefer `ParamEnv` over `AliasBound` candidates) - #139822 (Fix: Map EOPNOTSUPP to ErrorKind::Unsupported on Unix) - #139833 (Fix some HIR pretty-printing problems) - #139836 (Basic tests of MPMC receiver cloning) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3872119 + 2305789 commit 97b5caa

File tree

3 files changed

+15
-38
lines changed

3 files changed

+15
-38
lines changed

crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::{
1111

1212
use intern::Symbol;
1313
use proc_macro::bridge::{self, server};
14-
use span::{FileId, Span, FIXUP_ERASED_FILE_AST_ID_MARKER};
14+
use span::{Span, FIXUP_ERASED_FILE_AST_ID_MARKER};
1515
use tt::{TextRange, TextSize};
1616

1717
use crate::server_impl::{literal_kind_to_internal, token_stream::TokenStreamBuilder, TopSubtree};
@@ -27,10 +27,6 @@ mod tt {
2727

2828
type TokenStream = crate::server_impl::TokenStream<Span>;
2929

30-
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
31-
pub struct SourceFile {
32-
file_id: FileId,
33-
}
3430
pub struct FreeFunctions;
3531

3632
pub struct RaSpanServer {
@@ -46,7 +42,6 @@ pub struct RaSpanServer {
4642
impl server::Types for RaSpanServer {
4743
type FreeFunctions = FreeFunctions;
4844
type TokenStream = TokenStream;
49-
type SourceFile = SourceFile;
5045
type Span = Span;
5146
type Symbol = Symbol;
5247
}
@@ -245,25 +240,17 @@ impl server::TokenStream for RaSpanServer {
245240
}
246241
}
247242

248-
impl server::SourceFile for RaSpanServer {
249-
fn eq(&mut self, file1: &Self::SourceFile, file2: &Self::SourceFile) -> bool {
250-
file1 == file2
251-
}
252-
fn path(&mut self, _file: &Self::SourceFile) -> String {
253-
// FIXME
254-
String::new()
255-
}
256-
fn is_real(&mut self, _file: &Self::SourceFile) -> bool {
257-
true
258-
}
259-
}
260-
261243
impl server::Span for RaSpanServer {
262244
fn debug(&mut self, span: Self::Span) -> String {
263245
format!("{:?}", span)
264246
}
265-
fn source_file(&mut self, span: Self::Span) -> Self::SourceFile {
266-
SourceFile { file_id: span.anchor.file_id.file_id() }
247+
fn file(&mut self, _: Self::Span) -> String {
248+
// FIXME
249+
String::new()
250+
}
251+
fn local_file(&mut self, _: Self::Span) -> Option<String> {
252+
// FIXME
253+
None
267254
}
268255
fn save_span(&mut self, _span: Self::Span) -> usize {
269256
// FIXME, quote is incompatible with third-party tools

crates/proc-macro-srv/src/server_impl/token_id.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ type Literal = tt::Literal;
2424
type Span = tt::TokenId;
2525
type TokenStream = crate::server_impl::TokenStream<Span>;
2626

27-
#[derive(Clone)]
28-
pub struct SourceFile;
2927
pub struct FreeFunctions;
3028

3129
pub struct TokenIdServer {
@@ -37,7 +35,6 @@ pub struct TokenIdServer {
3735
impl server::Types for TokenIdServer {
3836
type FreeFunctions = FreeFunctions;
3937
type TokenStream = TokenStream;
40-
type SourceFile = SourceFile;
4138
type Span = Span;
4239
type Symbol = Symbol;
4340
}
@@ -223,24 +220,15 @@ impl server::TokenStream for TokenIdServer {
223220
}
224221
}
225222

226-
impl server::SourceFile for TokenIdServer {
227-
fn eq(&mut self, _file1: &Self::SourceFile, _file2: &Self::SourceFile) -> bool {
228-
true
229-
}
230-
fn path(&mut self, _file: &Self::SourceFile) -> String {
231-
String::new()
232-
}
233-
fn is_real(&mut self, _file: &Self::SourceFile) -> bool {
234-
true
235-
}
236-
}
237-
238223
impl server::Span for TokenIdServer {
239224
fn debug(&mut self, span: Self::Span) -> String {
240225
format!("{:?}", span.0)
241226
}
242-
fn source_file(&mut self, _span: Self::Span) -> Self::SourceFile {
243-
SourceFile {}
227+
fn file(&mut self, _span: Self::Span) -> String {
228+
String::new()
229+
}
230+
fn local_file(&mut self, _span: Self::Span) -> Option<String> {
231+
None
244232
}
245233
fn save_span(&mut self, _span: Self::Span) -> usize {
246234
0

crates/proc-macro-srv/src/tests/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ fn test_fn_like_macro_clone_raw_ident() {
9797
}
9898

9999
#[test]
100+
#[cfg(not(bootstrap))]
100101
fn test_fn_like_fn_like_span_join() {
101102
assert_expand(
102103
"fn_like_span_join",
@@ -111,6 +112,7 @@ fn test_fn_like_fn_like_span_join() {
111112
}
112113

113114
#[test]
115+
#[cfg(not(bootstrap))]
114116
fn test_fn_like_fn_like_span_ops() {
115117
assert_expand(
116118
"fn_like_span_ops",

0 commit comments

Comments
 (0)