File tree 3 files changed +15
-6
lines changed
compiler/rustc_ast_pretty/src/pprust/state
src/tools/rustfmt/src/config
3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
use rustc_ast:: Expr ;
2
2
use rustc_ast:: util:: { classify, parser} ;
3
3
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.
6
6
#[ derive( Copy , Clone , Debug , Default ) ]
7
7
pub ( crate ) struct FixupContext {
8
8
/// 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 {
161
161
default_impl ! { ( ) , ( ) , "Returns the default value of `()`" }
162
162
default_impl ! { bool , false , "Returns the default value of `false`" }
163
163
default_impl ! { char , '\x00' , "Returns the default value of `\\ x00`" }
164
+ default_impl ! { AsciiChar , AsciiChar :: Null , "Returns the default value of `Null`" }
164
165
165
166
default_impl ! { usize , 0 , "Returns the default value of `0`" }
166
167
default_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 {
155
155
156
156
/// What Rustfmt should emit. Mostly corresponds to the `--emit` command line
157
157
/// option.
158
- #[ derive( Default ) ]
159
158
#[ config_type]
160
159
pub enum EmitMode {
161
160
/// Emits to files.
162
- #[ default]
163
161
Files ,
164
162
/// Writes the output to stdout.
165
163
Stdout ,
@@ -312,6 +310,12 @@ impl ::std::str::FromStr for WidthHeuristics {
312
310
}
313
311
}
314
312
313
+ impl Default for EmitMode {
314
+ fn default ( ) -> EmitMode {
315
+ EmitMode :: Files
316
+ }
317
+ }
318
+
315
319
/// A set of directories, files and modules that rustfmt should ignore.
316
320
#[ derive( Default , Clone , Debug , PartialEq ) ]
317
321
pub struct IgnoreList {
@@ -421,12 +425,10 @@ pub trait CliOptions {
421
425
}
422
426
423
427
/// The edition of the syntax and semantics of code (RFC 2052).
424
- #[ derive( Default ) ]
425
428
#[ config_type]
426
429
pub enum Edition {
427
430
#[ value = "2015" ]
428
431
#[ doc_hint = "2015" ]
429
- #[ default]
430
432
/// Edition 2015.
431
433
Edition2015 ,
432
434
#[ value = "2018" ]
@@ -443,6 +445,12 @@ pub enum Edition {
443
445
Edition2024 ,
444
446
}
445
447
448
+ impl Default for Edition {
449
+ fn default ( ) -> Edition {
450
+ Edition :: Edition2015
451
+ }
452
+ }
453
+
446
454
impl From < Edition > for rustc_span:: edition:: Edition {
447
455
fn from ( edition : Edition ) -> Self {
448
456
match edition {
You can’t perform that action at this time.
0 commit comments