mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Attempt to implement typed accessors
This commit is contained in:
parent
a68aefdc46
commit
5645c153e0
4 changed files with 50 additions and 8 deletions
|
@ -230,14 +230,10 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec<SyntaxError>) {
|
|||
}
|
||||
|
||||
fn validate_range_expr(expr: ast::RangeExpr, errors: &mut Vec<SyntaxError>) {
|
||||
let last_child = match expr.syntax().last_child_or_token() {
|
||||
Some(it) => it,
|
||||
None => return,
|
||||
};
|
||||
if last_child.kind() == T![..=] {
|
||||
if expr.op_kind() == Some(ast::RangeOp::Inclusive) && expr.end().is_none() {
|
||||
errors.push(SyntaxError::new(
|
||||
SyntaxErrorKind::InclusiveRangeMissingEnd,
|
||||
last_child.text_range(),
|
||||
expr.syntax().text_range(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue