mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2025-02-17 05:57:30 +00:00
Normalize doc attributes in generated code
This commit is contained in:
parent
f8e08958c3
commit
531603545f
@ -996,6 +996,7 @@ fn write_file(path: &str, content: TokenStream) {
|
||||
config.set().emit_mode(rustfmt::EmitMode::Stdout);
|
||||
config.set().verbose(rustfmt::Verbosity::Quiet);
|
||||
config.set().format_macro_matchers(true);
|
||||
config.set().normalize_doc_attributes(true);
|
||||
let mut session = rustfmt::Session::new(config, Some(&mut file));
|
||||
session
|
||||
.format(rustfmt::Input::Text(content.to_string()))
|
||||
|
@ -19,13 +19,13 @@ macro_rules! full {
|
||||
unreachable!()
|
||||
};
|
||||
}
|
||||
#[doc = r" Syntax tree traversal to transform the nodes of an owned syntax tree."]
|
||||
#[doc = r""]
|
||||
#[doc = r" See the [module documentation] for details."]
|
||||
#[doc = r""]
|
||||
#[doc = r" [module documentation]: index.html"]
|
||||
#[doc = r""]
|
||||
#[doc = r#" *This trait is available if Syn is built with the `"fold"` feature.*"#]
|
||||
/// Syntax tree traversal to transform the nodes of an owned syntax tree.
|
||||
///
|
||||
/// See the [module documentation] for details.
|
||||
///
|
||||
/// [module documentation]: index.html
|
||||
///
|
||||
/// *This trait is available if Syn is built with the `"fold"` feature.*
|
||||
pub trait Fold {
|
||||
#[cfg(any(feature = "full", feature = "derive"))]
|
||||
fn fold_abi(&mut self, i: Abi) -> Abi {
|
||||
|
@ -23,13 +23,13 @@ macro_rules! full {
|
||||
macro_rules! skip {
|
||||
($($tt:tt)*) => {};
|
||||
}
|
||||
#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
|
||||
#[doc = r""]
|
||||
#[doc = r" See the [module documentation] for details."]
|
||||
#[doc = r""]
|
||||
#[doc = r" [module documentation]: index.html"]
|
||||
#[doc = r""]
|
||||
#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
|
||||
/// Syntax tree traversal to walk a shared borrow of a syntax tree.
|
||||
///
|
||||
/// See the [module documentation] for details.
|
||||
///
|
||||
/// [module documentation]: index.html
|
||||
///
|
||||
/// *This trait is available if Syn is built with the `"visit"` feature.*
|
||||
pub trait Visit<'ast> {
|
||||
#[cfg(any(feature = "full", feature = "derive"))]
|
||||
fn visit_abi(&mut self, i: &'ast Abi) {
|
||||
|
@ -22,14 +22,14 @@ macro_rules! full {
|
||||
macro_rules! skip {
|
||||
($($tt:tt)*) => {};
|
||||
}
|
||||
#[doc = r" Syntax tree traversal to mutate an exclusive borrow of a syntax tree in"]
|
||||
#[doc = r" place."]
|
||||
#[doc = r""]
|
||||
#[doc = r" See the [module documentation] for details."]
|
||||
#[doc = r""]
|
||||
#[doc = r" [module documentation]: index.html"]
|
||||
#[doc = r""]
|
||||
#[doc = r#" *This trait is available if Syn is built with the `"visit-mut"` feature.*"#]
|
||||
/// Syntax tree traversal to mutate an exclusive borrow of a syntax tree in
|
||||
/// place.
|
||||
///
|
||||
/// See the [module documentation] for details.
|
||||
///
|
||||
/// [module documentation]: index.html
|
||||
///
|
||||
/// *This trait is available if Syn is built with the `"visit-mut"` feature.*
|
||||
pub trait VisitMut {
|
||||
#[cfg(any(feature = "full", feature = "derive"))]
|
||||
fn visit_abi_mut(&mut self, i: &mut Abi) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user