mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Wrap remaining self/super/crate in Name{Ref}
This commit is contained in:
parent
8a869e870a
commit
98718e0544
28 changed files with 237 additions and 169 deletions
|
@ -190,17 +190,25 @@ fn opt_visibility(p: &mut Parser) -> bool {
|
|||
// test crate_visibility
|
||||
// pub(crate) struct S;
|
||||
// pub(self) struct S;
|
||||
// pub(self) struct S;
|
||||
// pub(self) struct S;
|
||||
// pub(super) struct S;
|
||||
|
||||
// test pub_parens_typepath
|
||||
// struct B(pub (super::A));
|
||||
// struct B(pub (crate::A,));
|
||||
T![crate] | T![self] | T![super] if p.nth(2) != T![:] => {
|
||||
p.bump_any();
|
||||
let path_m = p.start();
|
||||
let path_segment_m = p.start();
|
||||
let name_ref_m = p.start();
|
||||
p.bump_any();
|
||||
name_ref_m.complete(p, NAME_REF);
|
||||
path_segment_m.complete(p, PATH_SEGMENT);
|
||||
path_m.complete(p, PATH);
|
||||
p.expect(T![')']);
|
||||
}
|
||||
// test crate_visibility_in
|
||||
// pub(in super::A) struct S;
|
||||
// pub(in crate) struct S;
|
||||
T![in] => {
|
||||
p.bump_any();
|
||||
p.bump_any();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue