Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/syntax/src/validation.rs | 39 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rast (renamed from crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rs (renamed from crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast | 75 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rs | 4 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0042_weird_blocks.rast (renamed from crates/syntax/test_data/parser/err/0043_weird_blocks.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0042_weird_blocks.rs (renamed from crates/syntax/test_data/parser/err/0043_weird_blocks.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0043_unexpected_for_type.rast (renamed from crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0043_unexpected_for_type.rs (renamed from crates/syntax/test_data/parser/err/0044_unexpected_for_type.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0044_item_modifiers.rast (renamed from crates/syntax/test_data/parser/err/0045_item_modifiers.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0044_item_modifiers.rs (renamed from crates/syntax/test_data/parser/err/0045_item_modifiers.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rast (renamed from crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rs (renamed from crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0046_mutable_const_item.rast (renamed from crates/syntax/test_data/parser/err/0047_mutable_const_item.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0046_mutable_const_item.rs (renamed from crates/syntax/test_data/parser/err/0047_mutable_const_item.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rast (renamed from crates/syntax/test_data/parser/err/0048_repated_extern_modifier.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rs (renamed from crates/syntax/test_data/parser/err/0048_repated_extern_modifier.rs) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0048_double_fish.rast (renamed from crates/syntax/test_data/parser/err/0049_double_fish.rast) | 0 | ||||
| -rw-r--r-- | crates/syntax/test_data/parser/err/0048_double_fish.rs (renamed from crates/syntax/test_data/parser/err/0049_double_fish.rs) | 0 |
19 files changed, 0 insertions, 118 deletions
diff --git a/crates/syntax/src/validation.rs b/crates/syntax/src/validation.rs index af5e173900..a0a0bab5b3 100644 --- a/crates/syntax/src/validation.rs +++ b/crates/syntax/src/validation.rs @@ -245,8 +245,6 @@ fn validate_range_expr(expr: ast::RangeExpr, errors: &mut Vec<SyntaxError>) { } fn validate_path_keywords(segment: ast::PathSegment, errors: &mut Vec<SyntaxError>) { - use ast::PathSegmentKind; - let path = segment.parent_path(); let is_path_start = segment.coloncolon_token().is_none() && path.qualifier().is_none(); @@ -264,26 +262,6 @@ fn validate_path_keywords(segment: ast::PathSegment, errors: &mut Vec<SyntaxErro token.text_range(), )); } - } else if let Some(token) = segment.super_token() { - if segment.coloncolon_token().is_some() || !all_supers(&path) { - errors.push(SyntaxError::new( - "The `super` keyword may only be preceded by other `super`s", - token.text_range(), - )); - return; - } - - let mut curr_path = path; - while let Some(prefix) = use_prefix(curr_path) { - if !all_supers(&prefix) { - errors.push(SyntaxError::new( - "The `super` keyword may only be preceded by other `super`s", - token.text_range(), - )); - return; - } - curr_path = prefix; - } } fn use_prefix(mut path: ast::Path) -> Option<ast::Path> { @@ -305,23 +283,6 @@ fn validate_path_keywords(segment: ast::PathSegment, errors: &mut Vec<SyntaxErro } None } - - fn all_supers(path: &ast::Path) -> bool { - let segment = match path.segment() { - Some(it) => it, - None => return false, - }; - - if segment.kind() != Some(PathSegmentKind::SuperKw) { - return false; - } - - if let Some(ref subpath) = path.qualifier() { - return all_supers(subpath); - } - - true - } } fn validate_trait_object_ref_ty(ty: ast::RefType, errors: &mut Vec<SyntaxError>) { diff --git a/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast b/crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rast index 01f6010914..01f6010914 100644 --- a/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast +++ b/crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rast diff --git a/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rs b/crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rs index b9e1d7d8be..b9e1d7d8be 100644 --- a/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rs +++ b/crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rs diff --git a/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast b/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast deleted file mode 100644 index 271f8d7803..0000000000 --- a/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast +++ /dev/null @@ -1,75 +0,0 @@ - [email protected] "use" - [email protected] " " - [email protected] "::" - [email protected] "super" - [email protected] ";" - [email protected] "\n" - [email protected] "use" - [email protected] " " - [email protected] "a" - [email protected] "::" - [email protected] "super" - [email protected] ";" - [email protected] "\n" - [email protected] "use" - [email protected] " " - [email protected] "super" - [email protected] "::" - [email protected] "a" - [email protected] "::" - [email protected] "super" - [email protected] ";" - [email protected] "\n" - [email protected] "use" - [email protected] " " - [email protected] "a" - [email protected] "::" - [email protected] "{" - [email protected] "super" - [email protected] "::" - [email protected] "b" - [email protected] "}" - [email protected] ";" - [email protected] "\n" -error 6..11: The `super` keyword may only be preceded by other `super`s -error 20..25: The `super` keyword may only be preceded by other `super`s -error 41..46: The `super` keyword may only be preceded by other `super`s -error 56..61: The `super` keyword may only be preceded by other `super`s diff --git a/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rs b/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rs deleted file mode 100644 index bd4d580426..0000000000 --- a/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rs +++ /dev/null @@ -1,4 +0,0 @@ -use ::super; -use a::super; -use super::a::super; -use a::{super::b}; diff --git a/crates/syntax/test_data/parser/err/0043_weird_blocks.rast b/crates/syntax/test_data/parser/err/0042_weird_blocks.rast index 25910cb405..25910cb405 100644 --- a/crates/syntax/test_data/parser/err/0043_weird_blocks.rast +++ b/crates/syntax/test_data/parser/err/0042_weird_blocks.rast diff --git a/crates/syntax/test_data/parser/err/0043_weird_blocks.rs b/crates/syntax/test_data/parser/err/0042_weird_blocks.rs index 8fa324c1a1..8fa324c1a1 100644 --- a/crates/syntax/test_data/parser/err/0043_weird_blocks.rs +++ b/crates/syntax/test_data/parser/err/0042_weird_blocks.rs diff --git a/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast b/crates/syntax/test_data/parser/err/0043_unexpected_for_type.rast index d4e4bf102e..d4e4bf102e 100644 --- a/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast +++ b/crates/syntax/test_data/parser/err/0043_unexpected_for_type.rast diff --git a/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rs b/crates/syntax/test_data/parser/err/0043_unexpected_for_type.rs index 0e9f8ccb4f..0e9f8ccb4f 100644 --- a/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rs +++ b/crates/syntax/test_data/parser/err/0043_unexpected_for_type.rs diff --git a/crates/syntax/test_data/parser/err/0045_item_modifiers.rast b/crates/syntax/test_data/parser/err/0044_item_modifiers.rast index b4ff1a14a7..b4ff1a14a7 100644 --- a/crates/syntax/test_data/parser/err/0045_item_modifiers.rast +++ b/crates/syntax/test_data/parser/err/0044_item_modifiers.rast diff --git a/crates/syntax/test_data/parser/err/0045_item_modifiers.rs b/crates/syntax/test_data/parser/err/0044_item_modifiers.rs index 731e58013b..731e58013b 100644 --- a/crates/syntax/test_data/parser/err/0045_item_modifiers.rs +++ b/crates/syntax/test_data/parser/err/0044_item_modifiers.rs diff --git a/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast b/crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rast index d94daacdc1..d94daacdc1 100644 --- a/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast +++ b/crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rast diff --git a/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rs b/crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rs index 3a73d81bb5..3a73d81bb5 100644 --- a/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rs +++ b/crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rs diff --git a/crates/syntax/test_data/parser/err/0047_mutable_const_item.rast b/crates/syntax/test_data/parser/err/0046_mutable_const_item.rast index c7eb312c92..c7eb312c92 100644 --- a/crates/syntax/test_data/parser/err/0047_mutable_const_item.rast +++ b/crates/syntax/test_data/parser/err/0046_mutable_const_item.rast diff --git a/crates/syntax/test_data/parser/err/0047_mutable_const_item.rs b/crates/syntax/test_data/parser/err/0046_mutable_const_item.rs index b34336f3f1..b34336f3f1 100644 --- a/crates/syntax/test_data/parser/err/0047_mutable_const_item.rs +++ b/crates/syntax/test_data/parser/err/0046_mutable_const_item.rs diff --git a/crates/syntax/test_data/parser/err/0048_repated_extern_modifier.rast b/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rast index 85e10ca36d..85e10ca36d 100644 --- a/crates/syntax/test_data/parser/err/0048_repated_extern_modifier.rast +++ b/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rast diff --git a/crates/syntax/test_data/parser/err/0048_repated_extern_modifier.rs b/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rs index 1fb18eaf1b..1fb18eaf1b 100644 --- a/crates/syntax/test_data/parser/err/0048_repated_extern_modifier.rs +++ b/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rs diff --git a/crates/syntax/test_data/parser/err/0049_double_fish.rast b/crates/syntax/test_data/parser/err/0048_double_fish.rast index ca52166fbc..ca52166fbc 100644 --- a/crates/syntax/test_data/parser/err/0049_double_fish.rast +++ b/crates/syntax/test_data/parser/err/0048_double_fish.rast diff --git a/crates/syntax/test_data/parser/err/0049_double_fish.rs b/crates/syntax/test_data/parser/err/0048_double_fish.rs index 31c12bfff9..31c12bfff9 100644 --- a/crates/syntax/test_data/parser/err/0049_double_fish.rs +++ b/crates/syntax/test_data/parser/err/0048_double_fish.rs |