Skip to content

Commit 0911436

Browse files
committed
Merge pull request 1339 from dtolnay/viscrate
2 parents 8903d4d + a70085f commit 0911436

File tree

14 files changed

+4
-178
lines changed

14 files changed

+4
-178
lines changed

src/data.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ ast_enum_of_structs! {
169169
/// A public visibility level: `pub`.
170170
Public(VisPublic),
171171

172-
/// A crate-level visibility: `crate`.
173-
Crate(VisCrate),
174-
175172
/// A visibility level restricted to some path: `pub(self)` or
176173
/// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
177174
Restricted(VisRestricted),
@@ -189,14 +186,6 @@ ast_struct! {
189186
}
190187
}
191188

192-
ast_struct! {
193-
/// A crate-level visibility: `crate`.
194-
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
195-
pub struct VisCrate {
196-
pub crate_token: Token![crate],
197-
}
198-
}
199-
200189
ast_struct! {
201190
/// A visibility level restricted to some path: `pub(self)` or
202191
/// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
@@ -313,8 +302,6 @@ pub mod parsing {
313302

314303
if input.peek(Token![pub]) {
315304
Self::parse_pub(input)
316-
} else if input.peek(Token![crate]) {
317-
Self::parse_crate(input)
318305
} else {
319306
Ok(Visibility::Inherited)
320307
}
@@ -366,16 +353,6 @@ pub mod parsing {
366353
Ok(Visibility::Public(VisPublic { pub_token }))
367354
}
368355

369-
fn parse_crate(input: ParseStream) -> Result<Self> {
370-
if input.peek2(Token![::]) {
371-
Ok(Visibility::Inherited)
372-
} else {
373-
Ok(Visibility::Crate(VisCrate {
374-
crate_token: input.parse()?,
375-
}))
376-
}
377-
}
378-
379356
#[cfg(feature = "full")]
380357
pub(crate) fn is_some(&self) -> bool {
381358
match self {
@@ -444,13 +421,6 @@ mod printing {
444421
}
445422
}
446423

447-
#[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
448-
impl ToTokens for VisCrate {
449-
fn to_tokens(&self, tokens: &mut TokenStream) {
450-
self.crate_token.to_tokens(tokens);
451-
}
452-
}
453-
454424
#[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
455425
impl ToTokens for VisRestricted {
456426
fn to_tokens(&self, tokens: &mut TokenStream) {

src/gen/clone.rs

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen/debug.rs

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen/eq.rs

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen/fold.rs

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen/hash.rs

Lines changed: 2 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen/visit.rs

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen/visit_mut.rs

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ mod custom_punctuation;
328328
mod data;
329329
#[cfg(any(feature = "full", feature = "derive"))]
330330
pub use crate::data::{
331-
Field, Fields, FieldsNamed, FieldsUnnamed, Variant, VisCrate, VisPublic, VisRestricted,
332-
Visibility,
331+
Field, Fields, FieldsNamed, FieldsUnnamed, Variant, VisPublic, VisRestricted, Visibility,
333332
};
334333

335334
#[cfg(any(feature = "full", feature = "derive"))]

src/pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ mod printing {
731731
use crate::attr::FilterAttrs;
732732
use proc_macro2::TokenStream;
733733
use quote::{ToTokens, TokenStreamExt};
734-
734+
735735
#[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
736736
impl ToTokens for PatIdent {
737737
fn to_tokens(&self, tokens: &mut TokenStream) {

0 commit comments

Comments
 (0)