@@ -659,7 +659,7 @@ impl OutputFilenames {
659
659
single_output_file,
660
660
temps_directory,
661
661
outputs,
662
- filestem : format ! ( "{}{}" , out_filestem , extra ) ,
662
+ filestem : format ! ( "{out_filestem}{extra}" ) ,
663
663
}
664
664
}
665
665
@@ -1514,7 +1514,7 @@ pub fn get_cmd_lint_options(
1514
1514
1515
1515
let lint_cap = matches. opt_str ( "cap-lints" ) . map ( |cap| {
1516
1516
lint:: Level :: from_str ( & cap)
1517
- . unwrap_or_else ( || early_error ( error_format, & format ! ( "unknown lint level: `{}`" , cap ) ) )
1517
+ . unwrap_or_else ( || early_error ( error_format, & format ! ( "unknown lint level: `{cap }`" ) ) )
1518
1518
} ) ;
1519
1519
1520
1520
( lint_opts, describe_lints, lint_cap)
@@ -1533,8 +1533,7 @@ pub fn parse_color(matches: &getopts::Matches) -> ColorConfig {
1533
1533
ErrorOutputType :: default ( ) ,
1534
1534
& format ! (
1535
1535
"argument for `--color` must be auto, \
1536
- always or never (instead was `{}`)",
1537
- arg
1536
+ always or never (instead was `{arg}`)"
1538
1537
) ,
1539
1538
) ,
1540
1539
}
@@ -1579,7 +1578,7 @@ pub fn parse_json(matches: &getopts::Matches) -> JsonConfig {
1579
1578
"future-incompat" => json_future_incompat = true ,
1580
1579
s => early_error (
1581
1580
ErrorOutputType :: default ( ) ,
1582
- & format ! ( "unknown `--json` option `{}`" , s ) ,
1581
+ & format ! ( "unknown `--json` option `{s }`" ) ,
1583
1582
) ,
1584
1583
}
1585
1584
}
@@ -1619,8 +1618,7 @@ pub fn parse_error_format(
1619
1618
ErrorOutputType :: HumanReadable ( HumanReadableErrorType :: Default ( color) ) ,
1620
1619
& format ! (
1621
1620
"argument for `--error-format` must be `human`, `json` or \
1622
- `short` (instead was `{}`)",
1623
- arg
1621
+ `short` (instead was `{arg}`)"
1624
1622
) ,
1625
1623
) ,
1626
1624
}
@@ -1654,8 +1652,7 @@ pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
1654
1652
ErrorOutputType :: default ( ) ,
1655
1653
& format ! (
1656
1654
"argument for `--edition` must be one of: \
1657
- {}. (instead was `{}`)",
1658
- EDITION_NAME_LIST , arg
1655
+ {EDITION_NAME_LIST}. (instead was `{arg}`)"
1659
1656
) ,
1660
1657
)
1661
1658
} ) ,
@@ -1670,7 +1667,7 @@ pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
1670
1667
edition, LATEST_STABLE_EDITION
1671
1668
)
1672
1669
} else {
1673
- format ! ( "edition {} is unstable and only available with -Z unstable-options" , edition )
1670
+ format ! ( "edition {edition } is unstable and only available with -Z unstable-options" )
1674
1671
} ;
1675
1672
early_error ( ErrorOutputType :: default ( ) , & msg)
1676
1673
}
@@ -1718,9 +1715,8 @@ fn parse_output_types(
1718
1715
early_error (
1719
1716
error_format,
1720
1717
& format ! (
1721
- "unknown emission type: `{}` - expected one of: {}" ,
1722
- shorthand,
1723
- OutputType :: shorthands_display( ) ,
1718
+ "unknown emission type: `{shorthand}` - expected one of: {display}" ,
1719
+ display = OutputType :: shorthands_display( ) ,
1724
1720
) ,
1725
1721
)
1726
1722
} ) ;
@@ -1758,9 +1754,8 @@ fn should_override_cgus_and_disable_thinlto(
1758
1754
early_warn (
1759
1755
error_format,
1760
1756
& format ! (
1761
- "`--emit={}` with `-o` incompatible with \
1757
+ "`--emit={ot }` with `-o` incompatible with \
1762
1758
`-C codegen-units=N` for N > 1",
1763
- ot
1764
1759
) ,
1765
1760
) ;
1766
1761
}
@@ -1835,7 +1830,7 @@ fn collect_print_requests(
1835
1830
}
1836
1831
}
1837
1832
"link-args" => PrintRequest :: LinkArgs ,
1838
- req => early_error ( error_format, & format ! ( "unknown print request `{}`" , req ) ) ,
1833
+ req => early_error ( error_format, & format ! ( "unknown print request `{req }`" ) ) ,
1839
1834
} ) ) ;
1840
1835
1841
1836
prints
@@ -1849,7 +1844,7 @@ pub fn parse_target_triple(
1849
1844
Some ( target) if target. ends_with ( ".json" ) => {
1850
1845
let path = Path :: new ( & target) ;
1851
1846
TargetTriple :: from_path ( & path) . unwrap_or_else ( |_| {
1852
- early_error ( error_format, & format ! ( "target file {:?} does not exist" , path ) )
1847
+ early_error ( error_format, & format ! ( "target file {path :?} does not exist" ) )
1853
1848
} )
1854
1849
}
1855
1850
Some ( target) => TargetTriple :: TargetTriple ( target) ,
@@ -1892,8 +1887,7 @@ fn parse_opt_level(
1892
1887
error_format,
1893
1888
& format ! (
1894
1889
"optimization level needs to be \
1895
- between 0-3, s or z (instead was `{}`)",
1896
- arg
1890
+ between 0-3, s or z (instead was `{arg}`)"
1897
1891
) ,
1898
1892
) ;
1899
1893
}
@@ -1927,8 +1921,7 @@ fn select_debuginfo(
1927
1921
error_format,
1928
1922
& format ! (
1929
1923
"debug info level needs to be between \
1930
- 0-2 (instead was `{}`)",
1931
- arg
1924
+ 0-2 (instead was `{arg}`)"
1932
1925
) ,
1933
1926
) ;
1934
1927
}
@@ -1943,10 +1936,9 @@ crate fn parse_assert_incr_state(
1943
1936
match opt_assertion {
1944
1937
Some ( s) if s. as_str ( ) == "loaded" => Some ( IncrementalStateAssertion :: Loaded ) ,
1945
1938
Some ( s) if s. as_str ( ) == "not-loaded" => Some ( IncrementalStateAssertion :: NotLoaded ) ,
1946
- Some ( s) => early_error (
1947
- error_format,
1948
- & format ! ( "unexpected incremental state assertion value: {}" , s) ,
1949
- ) ,
1939
+ Some ( s) => {
1940
+ early_error ( error_format, & format ! ( "unexpected incremental state assertion value: {s}" ) )
1941
+ }
1950
1942
None => None ,
1951
1943
}
1952
1944
}
@@ -1991,7 +1983,7 @@ fn parse_native_lib_kind(
1991
1983
}
1992
1984
s => early_error (
1993
1985
error_format,
1994
- & format ! ( "unknown library kind `{}`, expected one of dylib, framework, or static" , s ) ,
1986
+ & format ! ( "unknown library kind `{s }`, expected one of dylib, framework, or static" ) ,
1995
1987
) ,
1996
1988
} ;
1997
1989
match modifiers {
@@ -2066,9 +2058,8 @@ fn parse_native_lib_modifiers(
2066
2058
_ => early_error (
2067
2059
error_format,
2068
2060
& format ! (
2069
- "unrecognized linking modifier `{}`, expected one \
2070
- of: bundle, verbatim, whole-archive, as-needed",
2071
- modifier
2061
+ "unrecognized linking modifier `{modifier}`, expected one \
2062
+ of: bundle, verbatim, whole-archive, as-needed"
2072
2063
) ,
2073
2064
) ,
2074
2065
}
@@ -2109,7 +2100,7 @@ fn parse_borrowck_mode(dopts: &DebuggingOptions, error_format: ErrorOutputType)
2109
2100
match dopts. borrowck . as_ref ( ) {
2110
2101
"migrate" => BorrowckMode :: Migrate ,
2111
2102
"mir" => BorrowckMode :: Mir ,
2112
- m => early_error ( error_format, & format ! ( "unknown borrowck mode `{}`" , m ) ) ,
2103
+ m => early_error ( error_format, & format ! ( "unknown borrowck mode `{m }`" ) ) ,
2113
2104
}
2114
2105
}
2115
2106
@@ -2197,7 +2188,7 @@ pub fn parse_externs(
2197
2188
) ;
2198
2189
}
2199
2190
}
2200
- _ => early_error ( error_format, & format ! ( "unknown --extern option `{}`" , opt ) ) ,
2191
+ _ => early_error ( error_format, & format ! ( "unknown --extern option `{opt }`" ) ) ,
2201
2192
}
2202
2193
}
2203
2194
}
@@ -2234,7 +2225,7 @@ fn parse_extern_dep_specs(
2234
2225
let loc = parts. next ( ) . unwrap_or_else ( || {
2235
2226
early_error (
2236
2227
error_format,
2237
- & format ! ( "`--extern-location`: specify location for extern crate `{}`" , name ) ,
2228
+ & format ! ( "`--extern-location`: specify location for extern crate `{name }`" ) ,
2238
2229
)
2239
2230
} ) ;
2240
2231
@@ -2255,14 +2246,14 @@ fn parse_extern_dep_specs(
2255
2246
let json = json:: from_str ( raw) . unwrap_or_else ( |_| {
2256
2247
early_error (
2257
2248
error_format,
2258
- & format ! ( "`--extern-location`: malformed json location `{}`" , raw ) ,
2249
+ & format ! ( "`--extern-location`: malformed json location `{raw }`" ) ,
2259
2250
)
2260
2251
} ) ;
2261
2252
ExternDepSpec :: Json ( json)
2262
2253
}
2263
2254
[ bad, ..] => early_error (
2264
2255
error_format,
2265
- & format ! ( "unknown location type `{}`: use `raw` or `json`" , bad ) ,
2256
+ & format ! ( "unknown location type `{bad }`: use `raw` or `json`" ) ,
2266
2257
) ,
2267
2258
[ ] => early_error ( error_format, "missing location specification" ) ,
2268
2259
} ;
@@ -2527,9 +2518,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
2527
2518
&& !target_triple. triple ( ) . contains ( "apple" )
2528
2519
&& cg. split_debuginfo . is_some ( )
2529
2520
{
2530
- {
2531
- early_error ( error_format, "`-Csplit-debuginfo` is unstable on this platform" ) ;
2532
- }
2521
+ early_error ( error_format, "`-Csplit-debuginfo` is unstable on this platform" ) ;
2533
2522
}
2534
2523
2535
2524
// Try to find a directory containing the Rust `src`, for more details see
@@ -2561,7 +2550,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
2561
2550
} ;
2562
2551
2563
2552
let working_dir = std:: env:: current_dir ( ) . unwrap_or_else ( |e| {
2564
- early_error ( error_format, & format ! ( "Current directory is invalid: {}" , e ) ) ;
2553
+ early_error ( error_format, & format ! ( "Current directory is invalid: {e}" ) ) ;
2565
2554
} ) ;
2566
2555
2567
2556
let ( path, remapped) =
@@ -2636,12 +2625,11 @@ fn parse_pretty(debugging_opts: &DebuggingOptions, efmt: ErrorOutputType) -> Opt
2636
2625
"argument to `unpretty` must be one of `normal`, `identified`, \
2637
2626
`expanded`, `expanded,identified`, `expanded,hygiene`, \
2638
2627
`ast-tree`, `ast-tree,expanded`, `hir`, `hir,identified`, \
2639
- `hir,typed`, `hir-tree`, `thir-tree`, `mir` or `mir-cfg`; got {}",
2640
- name
2628
+ `hir,typed`, `hir-tree`, `thir-tree`, `mir` or `mir-cfg`; got {name}"
2641
2629
) ,
2642
2630
) ,
2643
2631
} ;
2644
- tracing:: debug!( "got unpretty option: {:?}" , first ) ;
2632
+ tracing:: debug!( "got unpretty option: {first :?}" ) ;
2645
2633
Some ( first)
2646
2634
}
2647
2635
@@ -2667,7 +2655,7 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
2667
2655
"cdylib" => CrateType :: Cdylib ,
2668
2656
"bin" => CrateType :: Executable ,
2669
2657
"proc-macro" => CrateType :: ProcMacro ,
2670
- _ => return Err ( format ! ( "unknown crate type: `{}`" , part ) ) ,
2658
+ _ => return Err ( format ! ( "unknown crate type: `{part }`" ) ) ,
2671
2659
} ;
2672
2660
if !crate_types. contains ( & new_part) {
2673
2661
crate_types. push ( new_part)
0 commit comments