Skip to content

Commit fa133d0

Browse files
committed
Auto merge of rust-lang#12190 - harpsword:fix_diagostics_map_incorrectly, r=harpsword
fix cargo check diagnostics are mapped incorrectly with non-BMP codepoints fix rust-lang#11945
2 parents 1ff5b2c + 7bd4c11 commit fa133d0

File tree

3 files changed

+339
-26
lines changed

3 files changed

+339
-26
lines changed
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
[
2+
MappedRustDiagnostic {
3+
url: Url {
4+
scheme: "file",
5+
cannot_be_a_base: false,
6+
username: "",
7+
password: None,
8+
host: None,
9+
port: None,
10+
path: "/test/crates/test_diagnostics/src/main.rs",
11+
query: None,
12+
fragment: None,
13+
},
14+
diagnostic: Diagnostic {
15+
range: Range {
16+
start: Position {
17+
line: 3,
18+
character: 17,
19+
},
20+
end: Position {
21+
line: 3,
22+
character: 27,
23+
},
24+
},
25+
severity: Some(
26+
Error,
27+
),
28+
code: Some(
29+
String(
30+
"E0308",
31+
),
32+
),
33+
code_description: Some(
34+
CodeDescription {
35+
href: Url {
36+
scheme: "https",
37+
cannot_be_a_base: false,
38+
username: "",
39+
password: None,
40+
host: Some(
41+
Domain(
42+
"doc.rust-lang.org",
43+
),
44+
),
45+
port: None,
46+
path: "/error-index.html",
47+
query: None,
48+
fragment: Some(
49+
"E0308",
50+
),
51+
},
52+
},
53+
),
54+
source: Some(
55+
"rustc",
56+
),
57+
message: "mismatched types\nexpected `u32`, found `&str`",
58+
related_information: Some(
59+
[
60+
DiagnosticRelatedInformation {
61+
location: Location {
62+
uri: Url {
63+
scheme: "file",
64+
cannot_be_a_base: false,
65+
username: "",
66+
password: None,
67+
host: None,
68+
port: None,
69+
path: "/test/crates/test_diagnostics/src/main.rs",
70+
query: None,
71+
fragment: None,
72+
},
73+
range: Range {
74+
start: Position {
75+
line: 3,
76+
character: 11,
77+
},
78+
end: Position {
79+
line: 3,
80+
character: 14,
81+
},
82+
},
83+
},
84+
message: "expected due to this",
85+
},
86+
],
87+
),
88+
tags: None,
89+
data: None,
90+
},
91+
fix: None,
92+
},
93+
MappedRustDiagnostic {
94+
url: Url {
95+
scheme: "file",
96+
cannot_be_a_base: false,
97+
username: "",
98+
password: None,
99+
host: None,
100+
port: None,
101+
path: "/test/crates/test_diagnostics/src/main.rs",
102+
query: None,
103+
fragment: None,
104+
},
105+
diagnostic: Diagnostic {
106+
range: Range {
107+
start: Position {
108+
line: 3,
109+
character: 11,
110+
},
111+
end: Position {
112+
line: 3,
113+
character: 14,
114+
},
115+
},
116+
severity: Some(
117+
Hint,
118+
),
119+
code: Some(
120+
String(
121+
"E0308",
122+
),
123+
),
124+
code_description: Some(
125+
CodeDescription {
126+
href: Url {
127+
scheme: "https",
128+
cannot_be_a_base: false,
129+
username: "",
130+
password: None,
131+
host: Some(
132+
Domain(
133+
"doc.rust-lang.org",
134+
),
135+
),
136+
port: None,
137+
path: "/error-index.html",
138+
query: None,
139+
fragment: Some(
140+
"E0308",
141+
),
142+
},
143+
},
144+
),
145+
source: Some(
146+
"rustc",
147+
),
148+
message: "expected due to this",
149+
related_information: Some(
150+
[
151+
DiagnosticRelatedInformation {
152+
location: Location {
153+
uri: Url {
154+
scheme: "file",
155+
cannot_be_a_base: false,
156+
username: "",
157+
password: None,
158+
host: None,
159+
port: None,
160+
path: "/test/crates/test_diagnostics/src/main.rs",
161+
query: None,
162+
fragment: None,
163+
},
164+
range: Range {
165+
start: Position {
166+
line: 3,
167+
character: 17,
168+
},
169+
end: Position {
170+
line: 3,
171+
character: 27,
172+
},
173+
},
174+
},
175+
message: "original diagnostic",
176+
},
177+
],
178+
),
179+
tags: None,
180+
data: None,
181+
},
182+
fix: None,
183+
},
184+
]

0 commit comments

Comments
 (0)