mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
Improve parsing error for static and const
Example --- ```rust static C<i32>: u32 = 0; ``` -> ```diff -error 8: missing type for `const` or `static` +error 8: `static` may not have generic parameters ``` --- ```rust const C = 0; ``` -> ```diff -error 7: missing type for `const` or `static` +error 7: missing type for `const` ``` --- ```rust static C = 0; ``` -> ```diff -error 8: missing type for `const` or `static` +error 8: missing type for `static` ```
This commit is contained in:
parent
a2e6043bfa
commit
216db6d5b4
8 changed files with 50 additions and 4 deletions
|
|
@ -824,10 +824,18 @@ mod err {
|
|||
run_and_expect_errors("test_data/parser/inline/err/misplaced_label_err.rs");
|
||||
}
|
||||
#[test]
|
||||
fn missing_const_type() {
|
||||
run_and_expect_errors("test_data/parser/inline/err/missing_const_type.rs");
|
||||
}
|
||||
#[test]
|
||||
fn missing_fn_param_type() {
|
||||
run_and_expect_errors("test_data/parser/inline/err/missing_fn_param_type.rs");
|
||||
}
|
||||
#[test]
|
||||
fn missing_static_type() {
|
||||
run_and_expect_errors("test_data/parser/inline/err/missing_static_type.rs");
|
||||
}
|
||||
#[test]
|
||||
fn path_item_without_excl() {
|
||||
run_and_expect_errors("test_data/parser/inline/err/path_item_without_excl.rs");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue