@@ -659,7 +659,7 @@ impl OutputFilenames {
659659 single_output_file,
660660 temps_directory,
661661 outputs,
662- filestem : format ! ( "{}{}" , out_filestem , extra ) ,
662+ filestem : format ! ( "{out_filestem}{extra}" ) ,
663663 }
664664 }
665665
@@ -1514,7 +1514,7 @@ pub fn get_cmd_lint_options(
15141514
15151515 let lint_cap = matches. opt_str ( "cap-lints" ) . map ( |cap| {
15161516 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 }`" ) ) )
15181518 } ) ;
15191519
15201520 ( lint_opts, describe_lints, lint_cap)
@@ -1533,8 +1533,7 @@ pub fn parse_color(matches: &getopts::Matches) -> ColorConfig {
15331533 ErrorOutputType :: default ( ) ,
15341534 & format ! (
15351535 "argument for `--color` must be auto, \
1536- always or never (instead was `{}`)",
1537- arg
1536+ always or never (instead was `{arg}`)"
15381537 ) ,
15391538 ) ,
15401539 }
@@ -1579,7 +1578,7 @@ pub fn parse_json(matches: &getopts::Matches) -> JsonConfig {
15791578 "future-incompat" => json_future_incompat = true ,
15801579 s => early_error (
15811580 ErrorOutputType :: default ( ) ,
1582- & format ! ( "unknown `--json` option `{}`" , s ) ,
1581+ & format ! ( "unknown `--json` option `{s }`" ) ,
15831582 ) ,
15841583 }
15851584 }
@@ -1619,8 +1618,7 @@ pub fn parse_error_format(
16191618 ErrorOutputType :: HumanReadable ( HumanReadableErrorType :: Default ( color) ) ,
16201619 & format ! (
16211620 "argument for `--error-format` must be `human`, `json` or \
1622- `short` (instead was `{}`)",
1623- arg
1621+ `short` (instead was `{arg}`)"
16241622 ) ,
16251623 ) ,
16261624 }
@@ -1654,8 +1652,7 @@ pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
16541652 ErrorOutputType :: default ( ) ,
16551653 & format ! (
16561654 "argument for `--edition` must be one of: \
1657- {}. (instead was `{}`)",
1658- EDITION_NAME_LIST , arg
1655+ {EDITION_NAME_LIST}. (instead was `{arg}`)"
16591656 ) ,
16601657 )
16611658 } ) ,
@@ -1670,7 +1667,7 @@ pub fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
16701667 edition, LATEST_STABLE_EDITION
16711668 )
16721669 } 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" )
16741671 } ;
16751672 early_error ( ErrorOutputType :: default ( ) , & msg)
16761673 }
@@ -1718,9 +1715,8 @@ fn parse_output_types(
17181715 early_error (
17191716 error_format,
17201717 & 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( ) ,
17241720 ) ,
17251721 )
17261722 } ) ;
@@ -1758,9 +1754,8 @@ fn should_override_cgus_and_disable_thinlto(
17581754 early_warn (
17591755 error_format,
17601756 & format ! (
1761- "`--emit={}` with `-o` incompatible with \
1757+ "`--emit={ot }` with `-o` incompatible with \
17621758 `-C codegen-units=N` for N > 1",
1763- ot
17641759 ) ,
17651760 ) ;
17661761 }
@@ -1835,7 +1830,7 @@ fn collect_print_requests(
18351830 }
18361831 }
18371832 "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 }`" ) ) ,
18391834 } ) ) ;
18401835
18411836 prints
@@ -1849,7 +1844,7 @@ pub fn parse_target_triple(
18491844 Some ( target) if target. ends_with ( ".json" ) => {
18501845 let path = Path :: new ( & target) ;
18511846 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" ) )
18531848 } )
18541849 }
18551850 Some ( target) => TargetTriple :: TargetTriple ( target) ,
@@ -1892,8 +1887,7 @@ fn parse_opt_level(
18921887 error_format,
18931888 & format ! (
18941889 "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}`)"
18971891 ) ,
18981892 ) ;
18991893 }
@@ -1927,8 +1921,7 @@ fn select_debuginfo(
19271921 error_format,
19281922 & format ! (
19291923 "debug info level needs to be between \
1930- 0-2 (instead was `{}`)",
1931- arg
1924+ 0-2 (instead was `{arg}`)"
19321925 ) ,
19331926 ) ;
19341927 }
@@ -1943,10 +1936,9 @@ crate fn parse_assert_incr_state(
19431936 match opt_assertion {
19441937 Some ( s) if s. as_str ( ) == "loaded" => Some ( IncrementalStateAssertion :: Loaded ) ,
19451938 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+ }
19501942 None => None ,
19511943 }
19521944}
@@ -1991,7 +1983,7 @@ fn parse_native_lib_kind(
19911983 }
19921984 s => early_error (
19931985 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" ) ,
19951987 ) ,
19961988 } ;
19971989 match modifiers {
@@ -2066,9 +2058,8 @@ fn parse_native_lib_modifiers(
20662058 _ => early_error (
20672059 error_format,
20682060 & 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"
20722063 ) ,
20732064 ) ,
20742065 }
@@ -2109,7 +2100,7 @@ fn parse_borrowck_mode(dopts: &DebuggingOptions, error_format: ErrorOutputType)
21092100 match dopts. borrowck . as_ref ( ) {
21102101 "migrate" => BorrowckMode :: Migrate ,
21112102 "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 }`" ) ) ,
21132104 }
21142105}
21152106
@@ -2197,7 +2188,7 @@ pub fn parse_externs(
21972188 ) ;
21982189 }
21992190 }
2200- _ => early_error ( error_format, & format ! ( "unknown --extern option `{}`" , opt ) ) ,
2191+ _ => early_error ( error_format, & format ! ( "unknown --extern option `{opt }`" ) ) ,
22012192 }
22022193 }
22032194 }
@@ -2234,7 +2225,7 @@ fn parse_extern_dep_specs(
22342225 let loc = parts. next ( ) . unwrap_or_else ( || {
22352226 early_error (
22362227 error_format,
2237- & format ! ( "`--extern-location`: specify location for extern crate `{}`" , name ) ,
2228+ & format ! ( "`--extern-location`: specify location for extern crate `{name }`" ) ,
22382229 )
22392230 } ) ;
22402231
@@ -2255,14 +2246,14 @@ fn parse_extern_dep_specs(
22552246 let json = json:: from_str ( raw) . unwrap_or_else ( |_| {
22562247 early_error (
22572248 error_format,
2258- & format ! ( "`--extern-location`: malformed json location `{}`" , raw ) ,
2249+ & format ! ( "`--extern-location`: malformed json location `{raw }`" ) ,
22592250 )
22602251 } ) ;
22612252 ExternDepSpec :: Json ( json)
22622253 }
22632254 [ bad, ..] => early_error (
22642255 error_format,
2265- & format ! ( "unknown location type `{}`: use `raw` or `json`" , bad ) ,
2256+ & format ! ( "unknown location type `{bad }`: use `raw` or `json`" ) ,
22662257 ) ,
22672258 [ ] => early_error ( error_format, "missing location specification" ) ,
22682259 } ;
@@ -2527,9 +2518,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
25272518 && !target_triple. triple ( ) . contains ( "apple" )
25282519 && cg. split_debuginfo . is_some ( )
25292520 {
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" ) ;
25332522 }
25342523
25352524 // 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 {
25612550 } ;
25622551
25632552 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}" ) ) ;
25652554 } ) ;
25662555
25672556 let ( path, remapped) =
@@ -2636,12 +2625,11 @@ fn parse_pretty(debugging_opts: &DebuggingOptions, efmt: ErrorOutputType) -> Opt
26362625 "argument to `unpretty` must be one of `normal`, `identified`, \
26372626 `expanded`, `expanded,identified`, `expanded,hygiene`, \
26382627 `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}"
26412629 ) ,
26422630 ) ,
26432631 } ;
2644- tracing:: debug!( "got unpretty option: {:?}" , first ) ;
2632+ tracing:: debug!( "got unpretty option: {first :?}" ) ;
26452633 Some ( first)
26462634}
26472635
@@ -2667,7 +2655,7 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
26672655 "cdylib" => CrateType :: Cdylib ,
26682656 "bin" => CrateType :: Executable ,
26692657 "proc-macro" => CrateType :: ProcMacro ,
2670- _ => return Err ( format ! ( "unknown crate type: `{}`" , part ) ) ,
2658+ _ => return Err ( format ! ( "unknown crate type: `{part }`" ) ) ,
26712659 } ;
26722660 if !crate_types. contains ( & new_part) {
26732661 crate_types. push ( new_part)
0 commit comments