diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-29 12:57:24 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-29 12:57:24 +0000 |
commit | dc48f89581843248660ceb755bb20469ab6ac0c9 (patch) | |
tree | 05a7e47d1c68c250025be1ce6492f56c15353749 /editors/code/src/test/fixtures/rust-diagnostics | |
parent | cdcb3d3833d3d5b37b2cd4dac91a6e9366f20aea (diff) | |
parent | 899dbebd02b41b12d89c9f485e85208b39b81932 (diff) |
Merge #2668
2668: In-server cargo check watching r=matklad a=kiljacken
Opening a draft now so people can follow the progress, and comment if they spot something stupid.
Things that need doing:
- [x] Running cargo check on save
- [x] Pipe through configuration options from client
- [x] Tests for parsing behavior
- [x] Remove existing cargo watch support from VSCode extension
- [x] Progress notification in VSCode extension using LSP 3.15 `$/progress` notification
- [ ] ~~Rework ra-ide diagnostics to support secondary messages~~
- [ ] ~~Make cargo-check watcher use ra-ide diagnostics~~
~~I'd love some input on whether to try to keep the status bar progress thingy for VSCode? It will require some plumbing, and maintaining yet another rust-analyzer specific LSP notification, which I'm not sure we want to.~~
Fixes #1894
Co-authored-by: Emil Lauridsen <[email protected]>
Diffstat (limited to 'editors/code/src/test/fixtures/rust-diagnostics')
6 files changed, 0 insertions, 632 deletions
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/clippy/trivially_copy_pass_by_ref.json b/editors/code/src/test/fixtures/rust-diagnostics/clippy/trivially_copy_pass_by_ref.json deleted file mode 100644 index d874e99bc..000000000 --- a/editors/code/src/test/fixtures/rust-diagnostics/clippy/trivially_copy_pass_by_ref.json +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | { | ||
2 | "message": "this argument is passed by reference, but would be more efficient if passed by value", | ||
3 | "code": { | ||
4 | "code": "clippy::trivially_copy_pass_by_ref", | ||
5 | "explanation": null | ||
6 | }, | ||
7 | "level": "warning", | ||
8 | "spans": [ | ||
9 | { | ||
10 | "file_name": "compiler/mir/tagset.rs", | ||
11 | "byte_start": 941, | ||
12 | "byte_end": 946, | ||
13 | "line_start": 42, | ||
14 | "line_end": 42, | ||
15 | "column_start": 24, | ||
16 | "column_end": 29, | ||
17 | "is_primary": true, | ||
18 | "text": [ | ||
19 | { | ||
20 | "text": " pub fn is_disjoint(&self, other: Self) -> bool {", | ||
21 | "highlight_start": 24, | ||
22 | "highlight_end": 29 | ||
23 | } | ||
24 | ], | ||
25 | "label": null, | ||
26 | "suggested_replacement": null, | ||
27 | "suggestion_applicability": null, | ||
28 | "expansion": null | ||
29 | } | ||
30 | ], | ||
31 | "children": [ | ||
32 | { | ||
33 | "message": "lint level defined here", | ||
34 | "code": null, | ||
35 | "level": "note", | ||
36 | "spans": [ | ||
37 | { | ||
38 | "file_name": "compiler/lib.rs", | ||
39 | "byte_start": 8, | ||
40 | "byte_end": 19, | ||
41 | "line_start": 1, | ||
42 | "line_end": 1, | ||
43 | "column_start": 9, | ||
44 | "column_end": 20, | ||
45 | "is_primary": true, | ||
46 | "text": [ | ||
47 | { | ||
48 | "text": "#![warn(clippy::all)]", | ||
49 | "highlight_start": 9, | ||
50 | "highlight_end": 20 | ||
51 | } | ||
52 | ], | ||
53 | "label": null, | ||
54 | "suggested_replacement": null, | ||
55 | "suggestion_applicability": null, | ||
56 | "expansion": null | ||
57 | } | ||
58 | ], | ||
59 | "children": [], | ||
60 | "rendered": null | ||
61 | }, | ||
62 | { | ||
63 | "message": "#[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]", | ||
64 | "code": null, | ||
65 | "level": "note", | ||
66 | "spans": [], | ||
67 | "children": [], | ||
68 | "rendered": null | ||
69 | }, | ||
70 | { | ||
71 | "message": "for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref", | ||
72 | "code": null, | ||
73 | "level": "help", | ||
74 | "spans": [], | ||
75 | "children": [], | ||
76 | "rendered": null | ||
77 | }, | ||
78 | { | ||
79 | "message": "consider passing by value instead", | ||
80 | "code": null, | ||
81 | "level": "help", | ||
82 | "spans": [ | ||
83 | { | ||
84 | "file_name": "compiler/mir/tagset.rs", | ||
85 | "byte_start": 941, | ||
86 | "byte_end": 946, | ||
87 | "line_start": 42, | ||
88 | "line_end": 42, | ||
89 | "column_start": 24, | ||
90 | "column_end": 29, | ||
91 | "is_primary": true, | ||
92 | "text": [ | ||
93 | { | ||
94 | "text": " pub fn is_disjoint(&self, other: Self) -> bool {", | ||
95 | "highlight_start": 24, | ||
96 | "highlight_end": 29 | ||
97 | } | ||
98 | ], | ||
99 | "label": null, | ||
100 | "suggested_replacement": "self", | ||
101 | "suggestion_applicability": "Unspecified", | ||
102 | "expansion": null | ||
103 | } | ||
104 | ], | ||
105 | "children": [], | ||
106 | "rendered": null | ||
107 | } | ||
108 | ], | ||
109 | "rendered": "warning: this argument is passed by reference, but would be more efficient if passed by value\n --> compiler/mir/tagset.rs:42:24\n |\n42 | pub fn is_disjoint(&self, other: Self) -> bool {\n | ^^^^^ help: consider passing by value instead: `self`\n |\nnote: lint level defined here\n --> compiler/lib.rs:1:9\n |\n1 | #![warn(clippy::all)]\n | ^^^^^^^^^^^\n = note: #[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]\n = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref\n\n" | ||
110 | } | ||
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/error/E0053.json b/editors/code/src/test/fixtures/rust-diagnostics/error/E0053.json deleted file mode 100644 index ea5c976d1..000000000 --- a/editors/code/src/test/fixtures/rust-diagnostics/error/E0053.json +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | { | ||
2 | "message": "method `next` has an incompatible type for trait", | ||
3 | "code": { | ||
4 | "code": "E0053", | ||
5 | "explanation": "\nThe parameters of any trait method must match between a trait implementation\nand the trait definition.\n\nHere are a couple examples of this error:\n\n```compile_fail,E0053\ntrait Foo {\n fn foo(x: u16);\n fn bar(&self);\n}\n\nstruct Bar;\n\nimpl Foo for Bar {\n // error, expected u16, found i16\n fn foo(x: i16) { }\n\n // error, types differ in mutability\n fn bar(&mut self) { }\n}\n```\n" | ||
6 | }, | ||
7 | "level": "error", | ||
8 | "spans": [ | ||
9 | { | ||
10 | "file_name": "compiler/ty/list_iter.rs", | ||
11 | "byte_start": 1307, | ||
12 | "byte_end": 1350, | ||
13 | "line_start": 52, | ||
14 | "line_end": 52, | ||
15 | "column_start": 5, | ||
16 | "column_end": 48, | ||
17 | "is_primary": true, | ||
18 | "text": [ | ||
19 | { | ||
20 | "text": " fn next(&self) -> Option<&'list ty::Ref<M>> {", | ||
21 | "highlight_start": 5, | ||
22 | "highlight_end": 48 | ||
23 | } | ||
24 | ], | ||
25 | "label": "types differ in mutability", | ||
26 | "suggested_replacement": null, | ||
27 | "suggestion_applicability": null, | ||
28 | "expansion": null | ||
29 | } | ||
30 | ], | ||
31 | "children": [ | ||
32 | { | ||
33 | "message": "expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>`\n found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>`", | ||
34 | "code": null, | ||
35 | "level": "note", | ||
36 | "spans": [], | ||
37 | "children": [], | ||
38 | "rendered": null | ||
39 | } | ||
40 | ], | ||
41 | "rendered": "error[E0053]: method `next` has an incompatible type for trait\n --> compiler/ty/list_iter.rs:52:5\n |\n52 | fn next(&self) -> Option<&'list ty::Ref<M>> {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability\n |\n = note: expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>`\n found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>`\n\n" | ||
42 | } | ||
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/error/E0061.json b/editors/code/src/test/fixtures/rust-diagnostics/error/E0061.json deleted file mode 100644 index 3154d1098..000000000 --- a/editors/code/src/test/fixtures/rust-diagnostics/error/E0061.json +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | { | ||
2 | "message": "this function takes 2 parameters but 3 parameters were supplied", | ||
3 | "code": { | ||
4 | "code": "E0061", | ||
5 | "explanation": "\nThe number of arguments passed to a function must match the number of arguments\nspecified in the function signature.\n\nFor example, a function like:\n\n```\nfn f(a: u16, b: &str) {}\n```\n\nMust always be called with exactly two arguments, e.g., `f(2, \"test\")`.\n\nNote that Rust does not have a notion of optional function arguments or\nvariadic functions (except for its C-FFI).\n" | ||
6 | }, | ||
7 | "level": "error", | ||
8 | "spans": [ | ||
9 | { | ||
10 | "file_name": "compiler/ty/select.rs", | ||
11 | "byte_start": 8787, | ||
12 | "byte_end": 9241, | ||
13 | "line_start": 219, | ||
14 | "line_end": 231, | ||
15 | "column_start": 5, | ||
16 | "column_end": 6, | ||
17 | "is_primary": false, | ||
18 | "text": [ | ||
19 | { | ||
20 | "text": " pub fn add_evidence(", | ||
21 | "highlight_start": 5, | ||
22 | "highlight_end": 25 | ||
23 | }, | ||
24 | { | ||
25 | "text": " &mut self,", | ||
26 | "highlight_start": 1, | ||
27 | "highlight_end": 19 | ||
28 | }, | ||
29 | { | ||
30 | "text": " target_poly: &ty::Ref<ty::Poly>,", | ||
31 | "highlight_start": 1, | ||
32 | "highlight_end": 41 | ||
33 | }, | ||
34 | { | ||
35 | "text": " evidence_poly: &ty::Ref<ty::Poly>,", | ||
36 | "highlight_start": 1, | ||
37 | "highlight_end": 43 | ||
38 | }, | ||
39 | { | ||
40 | "text": " ) {", | ||
41 | "highlight_start": 1, | ||
42 | "highlight_end": 8 | ||
43 | }, | ||
44 | { | ||
45 | "text": " match target_poly {", | ||
46 | "highlight_start": 1, | ||
47 | "highlight_end": 28 | ||
48 | }, | ||
49 | { | ||
50 | "text": " ty::Ref::Var(tvar, _) => self.add_var_evidence(tvar, evidence_poly),", | ||
51 | "highlight_start": 1, | ||
52 | "highlight_end": 81 | ||
53 | }, | ||
54 | { | ||
55 | "text": " ty::Ref::Fixed(target_ty) => {", | ||
56 | "highlight_start": 1, | ||
57 | "highlight_end": 43 | ||
58 | }, | ||
59 | { | ||
60 | "text": " let evidence_ty = evidence_poly.resolve_to_ty();", | ||
61 | "highlight_start": 1, | ||
62 | "highlight_end": 65 | ||
63 | }, | ||
64 | { | ||
65 | "text": " self.add_evidence_ty(target_ty, evidence_poly, evidence_ty)", | ||
66 | "highlight_start": 1, | ||
67 | "highlight_end": 76 | ||
68 | }, | ||
69 | { | ||
70 | "text": " }", | ||
71 | "highlight_start": 1, | ||
72 | "highlight_end": 14 | ||
73 | }, | ||
74 | { | ||
75 | "text": " }", | ||
76 | "highlight_start": 1, | ||
77 | "highlight_end": 10 | ||
78 | }, | ||
79 | { | ||
80 | "text": " }", | ||
81 | "highlight_start": 1, | ||
82 | "highlight_end": 6 | ||
83 | } | ||
84 | ], | ||
85 | "label": "defined here", | ||
86 | "suggested_replacement": null, | ||
87 | "suggestion_applicability": null, | ||
88 | "expansion": null | ||
89 | }, | ||
90 | { | ||
91 | "file_name": "compiler/ty/select.rs", | ||
92 | "byte_start": 4045, | ||
93 | "byte_end": 4057, | ||
94 | "line_start": 104, | ||
95 | "line_end": 104, | ||
96 | "column_start": 18, | ||
97 | "column_end": 30, | ||
98 | "is_primary": true, | ||
99 | "text": [ | ||
100 | { | ||
101 | "text": " self.add_evidence(target_fixed, evidence_fixed, false);", | ||
102 | "highlight_start": 18, | ||
103 | "highlight_end": 30 | ||
104 | } | ||
105 | ], | ||
106 | "label": "expected 2 parameters", | ||
107 | "suggested_replacement": null, | ||
108 | "suggestion_applicability": null, | ||
109 | "expansion": null | ||
110 | } | ||
111 | ], | ||
112 | "children": [], | ||
113 | "rendered": "error[E0061]: this function takes 2 parameters but 3 parameters were supplied\n --> compiler/ty/select.rs:104:18\n |\n104 | self.add_evidence(target_fixed, evidence_fixed, false);\n | ^^^^^^^^^^^^ expected 2 parameters\n...\n219 | / pub fn add_evidence(\n220 | | &mut self,\n221 | | target_poly: &ty::Ref<ty::Poly>,\n222 | | evidence_poly: &ty::Ref<ty::Poly>,\n... |\n230 | | }\n231 | | }\n | |_____- defined here\n\n" | ||
114 | } | ||
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json b/editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json deleted file mode 100644 index bfef33c7d..000000000 --- a/editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json +++ /dev/null | |||
@@ -1,261 +0,0 @@ | |||
1 | { | ||
2 | "rendered": "error[E0277]: can't compare `{integer}` with `&str`\n --> src/main.rs:2:5\n |\n2 | assert_eq!(1, \"love\");\n | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `{integer} == &str`\n |\n = help: the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`\n = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n", | ||
3 | "children": [ | ||
4 | { | ||
5 | "children": [], | ||
6 | "code": null, | ||
7 | "level": "help", | ||
8 | "message": "the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`", | ||
9 | "rendered": null, | ||
10 | "spans": [] | ||
11 | } | ||
12 | ], | ||
13 | "code": { | ||
14 | "code": "E0277", | ||
15 | "explanation": "\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n foo.bar();\n}\n\nfn main() {\n // we now call the method with the i32 type, which doesn't implement\n // the Foo trait\n some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n foo.bar(); // we can now use this method since i32 implements the\n // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n fn bar(&self) {}\n}\n\nfn main() {\n some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n // implemented for the type `T`\n}\n\nfn main() {\n // We now call the method with the i32 type,\n // which *does* implement the Debug trait.\n some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n println!(\"{:?}\", foo);\n}\n\nfn main() {\n // Calling the method is still fine, as i32 implements Debug.\n some_func(5i32);\n\n // This would fail to compile now:\n // struct WithoutDebug;\n // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n" | ||
16 | }, | ||
17 | "level": "error", | ||
18 | "message": "can't compare `{integer}` with `&str`", | ||
19 | "spans": [ | ||
20 | { | ||
21 | "byte_end": 155, | ||
22 | "byte_start": 153, | ||
23 | "column_end": 33, | ||
24 | "column_start": 31, | ||
25 | "expansion": { | ||
26 | "def_site_span": { | ||
27 | "byte_end": 940, | ||
28 | "byte_start": 0, | ||
29 | "column_end": 6, | ||
30 | "column_start": 1, | ||
31 | "expansion": null, | ||
32 | "file_name": "<::core::macros::assert_eq macros>", | ||
33 | "is_primary": false, | ||
34 | "label": null, | ||
35 | "line_end": 36, | ||
36 | "line_start": 1, | ||
37 | "suggested_replacement": null, | ||
38 | "suggestion_applicability": null, | ||
39 | "text": [ | ||
40 | { | ||
41 | "highlight_end": 35, | ||
42 | "highlight_start": 1, | ||
43 | "text": "($ left : expr, $ right : expr) =>" | ||
44 | }, | ||
45 | { | ||
46 | "highlight_end": 3, | ||
47 | "highlight_start": 1, | ||
48 | "text": "({" | ||
49 | }, | ||
50 | { | ||
51 | "highlight_end": 33, | ||
52 | "highlight_start": 1, | ||
53 | "text": " match (& $ left, & $ right)" | ||
54 | }, | ||
55 | { | ||
56 | "highlight_end": 7, | ||
57 | "highlight_start": 1, | ||
58 | "text": " {" | ||
59 | }, | ||
60 | { | ||
61 | "highlight_end": 34, | ||
62 | "highlight_start": 1, | ||
63 | "text": " (left_val, right_val) =>" | ||
64 | }, | ||
65 | { | ||
66 | "highlight_end": 11, | ||
67 | "highlight_start": 1, | ||
68 | "text": " {" | ||
69 | }, | ||
70 | { | ||
71 | "highlight_end": 46, | ||
72 | "highlight_start": 1, | ||
73 | "text": " if ! (* left_val == * right_val)" | ||
74 | }, | ||
75 | { | ||
76 | "highlight_end": 15, | ||
77 | "highlight_start": 1, | ||
78 | "text": " {" | ||
79 | }, | ||
80 | { | ||
81 | "highlight_end": 25, | ||
82 | "highlight_start": 1, | ||
83 | "text": " panic !" | ||
84 | }, | ||
85 | { | ||
86 | "highlight_end": 57, | ||
87 | "highlight_start": 1, | ||
88 | "text": " (r#\"assertion failed: `(left == right)`" | ||
89 | }, | ||
90 | { | ||
91 | "highlight_end": 16, | ||
92 | "highlight_start": 1, | ||
93 | "text": " left: `{:?}`," | ||
94 | }, | ||
95 | { | ||
96 | "highlight_end": 18, | ||
97 | "highlight_start": 1, | ||
98 | "text": " right: `{:?}`\"#," | ||
99 | }, | ||
100 | { | ||
101 | "highlight_end": 47, | ||
102 | "highlight_start": 1, | ||
103 | "text": " & * left_val, & * right_val)" | ||
104 | }, | ||
105 | { | ||
106 | "highlight_end": 15, | ||
107 | "highlight_start": 1, | ||
108 | "text": " }" | ||
109 | }, | ||
110 | { | ||
111 | "highlight_end": 11, | ||
112 | "highlight_start": 1, | ||
113 | "text": " }" | ||
114 | }, | ||
115 | { | ||
116 | "highlight_end": 7, | ||
117 | "highlight_start": 1, | ||
118 | "text": " }" | ||
119 | }, | ||
120 | { | ||
121 | "highlight_end": 42, | ||
122 | "highlight_start": 1, | ||
123 | "text": " }) ; ($ left : expr, $ right : expr,) =>" | ||
124 | }, | ||
125 | { | ||
126 | "highlight_end": 49, | ||
127 | "highlight_start": 1, | ||
128 | "text": "({ $ crate :: assert_eq ! ($ left, $ right) }) ;" | ||
129 | }, | ||
130 | { | ||
131 | "highlight_end": 53, | ||
132 | "highlight_start": 1, | ||
133 | "text": "($ left : expr, $ right : expr, $ ($ arg : tt) +) =>" | ||
134 | }, | ||
135 | { | ||
136 | "highlight_end": 3, | ||
137 | "highlight_start": 1, | ||
138 | "text": "({" | ||
139 | }, | ||
140 | { | ||
141 | "highlight_end": 37, | ||
142 | "highlight_start": 1, | ||
143 | "text": " match (& ($ left), & ($ right))" | ||
144 | }, | ||
145 | { | ||
146 | "highlight_end": 7, | ||
147 | "highlight_start": 1, | ||
148 | "text": " {" | ||
149 | }, | ||
150 | { | ||
151 | "highlight_end": 34, | ||
152 | "highlight_start": 1, | ||
153 | "text": " (left_val, right_val) =>" | ||
154 | }, | ||
155 | { | ||
156 | "highlight_end": 11, | ||
157 | "highlight_start": 1, | ||
158 | "text": " {" | ||
159 | }, | ||
160 | { | ||
161 | "highlight_end": 46, | ||
162 | "highlight_start": 1, | ||
163 | "text": " if ! (* left_val == * right_val)" | ||
164 | }, | ||
165 | { | ||
166 | "highlight_end": 15, | ||
167 | "highlight_start": 1, | ||
168 | "text": " {" | ||
169 | }, | ||
170 | { | ||
171 | "highlight_end": 25, | ||
172 | "highlight_start": 1, | ||
173 | "text": " panic !" | ||
174 | }, | ||
175 | { | ||
176 | "highlight_end": 57, | ||
177 | "highlight_start": 1, | ||
178 | "text": " (r#\"assertion failed: `(left == right)`" | ||
179 | }, | ||
180 | { | ||
181 | "highlight_end": 16, | ||
182 | "highlight_start": 1, | ||
183 | "text": " left: `{:?}`," | ||
184 | }, | ||
185 | { | ||
186 | "highlight_end": 22, | ||
187 | "highlight_start": 1, | ||
188 | "text": " right: `{:?}`: {}\"#," | ||
189 | }, | ||
190 | { | ||
191 | "highlight_end": 72, | ||
192 | "highlight_start": 1, | ||
193 | "text": " & * left_val, & * right_val, $ crate :: format_args !" | ||
194 | }, | ||
195 | { | ||
196 | "highlight_end": 33, | ||
197 | "highlight_start": 1, | ||
198 | "text": " ($ ($ arg) +))" | ||
199 | }, | ||
200 | { | ||
201 | "highlight_end": 15, | ||
202 | "highlight_start": 1, | ||
203 | "text": " }" | ||
204 | }, | ||
205 | { | ||
206 | "highlight_end": 11, | ||
207 | "highlight_start": 1, | ||
208 | "text": " }" | ||
209 | }, | ||
210 | { | ||
211 | "highlight_end": 7, | ||
212 | "highlight_start": 1, | ||
213 | "text": " }" | ||
214 | }, | ||
215 | { | ||
216 | "highlight_end": 6, | ||
217 | "highlight_start": 1, | ||
218 | "text": " }) ;" | ||
219 | } | ||
220 | ] | ||
221 | }, | ||
222 | "macro_decl_name": "assert_eq!", | ||
223 | "span": { | ||
224 | "byte_end": 38, | ||
225 | "byte_start": 16, | ||
226 | "column_end": 27, | ||
227 | "column_start": 5, | ||
228 | "expansion": null, | ||
229 | "file_name": "src/main.rs", | ||
230 | "is_primary": false, | ||
231 | "label": null, | ||
232 | "line_end": 2, | ||
233 | "line_start": 2, | ||
234 | "suggested_replacement": null, | ||
235 | "suggestion_applicability": null, | ||
236 | "text": [ | ||
237 | { | ||
238 | "highlight_end": 27, | ||
239 | "highlight_start": 5, | ||
240 | "text": " assert_eq!(1, \"love\");" | ||
241 | } | ||
242 | ] | ||
243 | } | ||
244 | }, | ||
245 | "file_name": "<::core::macros::assert_eq macros>", | ||
246 | "is_primary": true, | ||
247 | "label": "no implementation for `{integer} == &str`", | ||
248 | "line_end": 7, | ||
249 | "line_start": 7, | ||
250 | "suggested_replacement": null, | ||
251 | "suggestion_applicability": null, | ||
252 | "text": [ | ||
253 | { | ||
254 | "highlight_end": 33, | ||
255 | "highlight_start": 31, | ||
256 | "text": " if ! (* left_val == * right_val)" | ||
257 | } | ||
258 | ] | ||
259 | } | ||
260 | ] | ||
261 | } | ||
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/error/E0308.json b/editors/code/src/test/fixtures/rust-diagnostics/error/E0308.json deleted file mode 100644 index fb23824a3..000000000 --- a/editors/code/src/test/fixtures/rust-diagnostics/error/E0308.json +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | { | ||
2 | "message": "mismatched types", | ||
3 | "code": { | ||
4 | "code": "E0308", | ||
5 | "explanation": "\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n// ~~~ ~~~~~~~~~~~~~~~~~~~~\n// | |\n// | initializing expression;\n// | compiler infers type `&str`\n// |\n// type `i32` assigned to variable `x`\n```\n" | ||
6 | }, | ||
7 | "level": "error", | ||
8 | "spans": [ | ||
9 | { | ||
10 | "file_name": "runtime/compiler_support.rs", | ||
11 | "byte_start": 1589, | ||
12 | "byte_end": 1594, | ||
13 | "line_start": 48, | ||
14 | "line_end": 48, | ||
15 | "column_start": 65, | ||
16 | "column_end": 70, | ||
17 | "is_primary": true, | ||
18 | "text": [ | ||
19 | { | ||
20 | "text": " let layout = alloc::Layout::from_size_align_unchecked(size, align);", | ||
21 | "highlight_start": 65, | ||
22 | "highlight_end": 70 | ||
23 | } | ||
24 | ], | ||
25 | "label": "expected usize, found u32", | ||
26 | "suggested_replacement": null, | ||
27 | "suggestion_applicability": null, | ||
28 | "expansion": null | ||
29 | } | ||
30 | ], | ||
31 | "children": [], | ||
32 | "rendered": "error[E0308]: mismatched types\n --> runtime/compiler_support.rs:48:65\n |\n48 | let layout = alloc::Layout::from_size_align_unchecked(size, align);\n | ^^^^^ expected usize, found u32\n\n" | ||
33 | } | ||
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/warning/unused_variables.json b/editors/code/src/test/fixtures/rust-diagnostics/warning/unused_variables.json deleted file mode 100644 index d1e2be722..000000000 --- a/editors/code/src/test/fixtures/rust-diagnostics/warning/unused_variables.json +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | { | ||
2 | "message": "unused variable: `foo`", | ||
3 | "code": { | ||
4 | "code": "unused_variables", | ||
5 | "explanation": null | ||
6 | }, | ||
7 | "level": "warning", | ||
8 | "spans": [ | ||
9 | { | ||
10 | "file_name": "driver/subcommand/repl.rs", | ||
11 | "byte_start": 9228, | ||
12 | "byte_end": 9231, | ||
13 | "line_start": 291, | ||
14 | "line_end": 291, | ||
15 | "column_start": 9, | ||
16 | "column_end": 12, | ||
17 | "is_primary": true, | ||
18 | "text": [ | ||
19 | { | ||
20 | "text": " let foo = 42;", | ||
21 | "highlight_start": 9, | ||
22 | "highlight_end": 12 | ||
23 | } | ||
24 | ], | ||
25 | "label": null, | ||
26 | "suggested_replacement": null, | ||
27 | "suggestion_applicability": null, | ||
28 | "expansion": null | ||
29 | } | ||
30 | ], | ||
31 | "children": [ | ||
32 | { | ||
33 | "message": "#[warn(unused_variables)] on by default", | ||
34 | "code": null, | ||
35 | "level": "note", | ||
36 | "spans": [], | ||
37 | "children": [], | ||
38 | "rendered": null | ||
39 | }, | ||
40 | { | ||
41 | "message": "consider prefixing with an underscore", | ||
42 | "code": null, | ||
43 | "level": "help", | ||
44 | "spans": [ | ||
45 | { | ||
46 | "file_name": "driver/subcommand/repl.rs", | ||
47 | "byte_start": 9228, | ||
48 | "byte_end": 9231, | ||
49 | "line_start": 291, | ||
50 | "line_end": 291, | ||
51 | "column_start": 9, | ||
52 | "column_end": 12, | ||
53 | "is_primary": true, | ||
54 | "text": [ | ||
55 | { | ||
56 | "text": " let foo = 42;", | ||
57 | "highlight_start": 9, | ||
58 | "highlight_end": 12 | ||
59 | } | ||
60 | ], | ||
61 | "label": null, | ||
62 | "suggested_replacement": "_foo", | ||
63 | "suggestion_applicability": "MachineApplicable", | ||
64 | "expansion": null | ||
65 | } | ||
66 | ], | ||
67 | "children": [], | ||
68 | "rendered": null | ||
69 | } | ||
70 | ], | ||
71 | "rendered": "warning: unused variable: `foo`\n --> driver/subcommand/repl.rs:291:9\n |\n291 | let foo = 42;\n | ^^^ help: consider prefixing with an underscore: `_foo`\n |\n = note: #[warn(unused_variables)] on by default\n\n" | ||
72 | } | ||