File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
compiler/rustc_ast_pretty/src/pprust/state
src/tools/rustfmt/src/config Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 11use rustc_ast:: Expr ;
22use rustc_ast:: util:: { classify, parser} ;
33
4- // The default amount of fixing is minimal fixing. Fixups should be turned on
5- // in a targeted fashion where needed.
4+ // The default amount of fixing is minimal fixing, so all fixups are set to `false` by `Default`.
5+ // Fixups should be turned on in a targeted fashion where needed.
66#[ derive( Copy , Clone , Debug , Default ) ]
77pub ( crate ) struct FixupContext {
88 /// Print expression such that it can be parsed back as a statement
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ macro_rules! default_impl {
161161default_impl ! { ( ) , ( ) , "Returns the default value of `()`" }
162162default_impl ! { bool , false , "Returns the default value of `false`" }
163163default_impl ! { char , '\x00' , "Returns the default value of `\\ x00`" }
164+ default_impl ! { AsciiChar , AsciiChar :: Null , "Returns the default value of `Null`" }
164165
165166default_impl ! { usize , 0 , "Returns the default value of `0`" }
166167default_impl ! { u8 , 0 , "Returns the default value of `0`" }
Original file line number Diff line number Diff line change @@ -155,11 +155,9 @@ pub enum ReportTactic {
155155
156156/// What Rustfmt should emit. Mostly corresponds to the `--emit` command line
157157/// option.
158- #[ derive( Default ) ]
159158#[ config_type]
160159pub enum EmitMode {
161160 /// Emits to files.
162- #[ default]
163161 Files ,
164162 /// Writes the output to stdout.
165163 Stdout ,
@@ -312,6 +310,12 @@ impl ::std::str::FromStr for WidthHeuristics {
312310 }
313311}
314312
313+ impl Default for EmitMode {
314+ fn default ( ) -> EmitMode {
315+ EmitMode :: Files
316+ }
317+ }
318+
315319/// A set of directories, files and modules that rustfmt should ignore.
316320#[ derive( Default , Clone , Debug , PartialEq ) ]
317321pub struct IgnoreList {
@@ -421,12 +425,10 @@ pub trait CliOptions {
421425}
422426
423427/// The edition of the syntax and semantics of code (RFC 2052).
424- #[ derive( Default ) ]
425428#[ config_type]
426429pub enum Edition {
427430 #[ value = "2015" ]
428431 #[ doc_hint = "2015" ]
429- #[ default]
430432 /// Edition 2015.
431433 Edition2015 ,
432434 #[ value = "2018" ]
@@ -443,6 +445,12 @@ pub enum Edition {
443445 Edition2024 ,
444446}
445447
448+ impl Default for Edition {
449+ fn default ( ) -> Edition {
450+ Edition :: Edition2015
451+ }
452+ }
453+
446454impl From < Edition > for rustc_span:: edition:: Edition {
447455 fn from ( edition : Edition ) -> Self {
448456 match edition {
You can’t perform that action at this time.
0 commit comments