Disable reorder_imports in code generator

This commit is contained in:
David Tolnay 2022-01-11 13:28:46 -08:00
parent efa6eebe15
commit f6a73463a6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
6 changed files with 13 additions and 12 deletions

View File

@ -16,6 +16,7 @@ pub fn write<P: AsRef<Path>>(path: P, content: TokenStream) -> Result<()> {
let mut config = rustfmt::Config::default();
config.set().format_macro_matchers(true);
config.set().normalize_doc_attributes(true);
config.set().reorder_imports(false);
let format_report = rustfmt::format(
rustfmt::Input::Text(content.to_string()),

2
src/gen/eq.rs generated
View File

@ -1,9 +1,9 @@
// This file is @generated by syn-internal-codegen.
// It is not intended for manual editing.
use crate::*;
#[cfg(any(feature = "derive", feature = "full"))]
use crate::tt::TokenStreamHelper;
use crate::*;
#[cfg(any(feature = "derive", feature = "full"))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
impl Eq for Abi {}

8
src/gen/fold.rs generated
View File

@ -3,12 +3,12 @@
#![allow(unreachable_code, unused_variables)]
#![allow(clippy::match_wildcard_for_single_variants)]
use crate::*;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::token::{Brace, Bracket, Paren, Group};
use proc_macro2::Span;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::gen::helper::fold::*;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::token::{Brace, Bracket, Group, Paren};
use crate::*;
use proc_macro2::Span;
#[cfg(feature = "full")]
macro_rules! full {
($e:expr) => {

2
src/gen/hash.rs generated
View File

@ -1,9 +1,9 @@
// This file is @generated by syn-internal-codegen.
// It is not intended for manual editing.
use crate::*;
#[cfg(any(feature = "derive", feature = "full"))]
use crate::tt::TokenStreamHelper;
use crate::*;
use std::hash::{Hash, Hasher};
#[cfg(any(feature = "derive", feature = "full"))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]

6
src/gen/visit.rs generated
View File

@ -2,12 +2,12 @@
// It is not intended for manual editing.
#![allow(unused_variables)]
#[cfg(any(feature = "full", feature = "derive"))]
use crate::gen::helper::visit::*;
use crate::*;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::punctuated::Punctuated;
use crate::*;
use proc_macro2::Span;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::gen::helper::visit::*;
#[cfg(feature = "full")]
macro_rules! full {
($e:expr) => {

6
src/gen/visit_mut.rs generated
View File

@ -2,12 +2,12 @@
// It is not intended for manual editing.
#![allow(unused_variables)]
#[cfg(any(feature = "full", feature = "derive"))]
use crate::gen::helper::visit_mut::*;
use crate::*;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::punctuated::Punctuated;
use crate::*;
use proc_macro2::Span;
#[cfg(any(feature = "full", feature = "derive"))]
use crate::gen::helper::visit_mut::*;
#[cfg(feature = "full")]
macro_rules! full {
($e:expr) => {