Skip to content

Commit

Permalink
rustfmt: set style_edition = "2024"
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 23, 2025
1 parent e981ebe commit a43d29d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ error_on_line_overflow = true
# Override the default formatting style.
# See https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81.
use_small_heuristics = "Max"
# This is the default of 2024 edition https://github.com/rust-lang/rust/pull/114764.
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3370)
overflow_delimited_expr = true
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/4991).
Expand All @@ -27,6 +26,7 @@ use_try_shorthand = true
# Set the default settings again to always apply the proper formatting without
# being affected by the editor settings.
edition = "2018"
style_edition = "2024"
hard_tabs = false
newline_style = "Unix"
tab_spaces = 4
2 changes: 1 addition & 1 deletion src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use proc_macro::{Delimiter, Ident, Literal, Span, TokenStream, TokenTree};

use crate::{iter::TokenIter, to_tokens::ToTokens, utils::tt_span, Result};
use crate::{Result, iter::TokenIter, to_tokens::ToTokens, utils::tt_span};

pub(crate) struct Func {
attrs: Vec<Attribute>,
Expand Down
2 changes: 1 addition & 1 deletion src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Based on https://github.com/dtolnay/proc-macro-hack/blob/0.5.19/src/iter.rs

use proc_macro::{token_stream, Delimiter, TokenStream, TokenTree};
use proc_macro::{Delimiter, TokenStream, TokenTree, token_stream};

pub(crate) struct TokenIter {
stack: Vec<token_stream::IntoIter>,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::iter::FromIterator;

use proc_macro::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};

use crate::{iter::TokenIter, Result};
use crate::{Result, iter::TokenIter};

pub(crate) fn tt_span(tt: Option<&TokenTree>) -> Span {
tt.map_or_else(Span::call_site, TokenTree::span)
Expand Down
4 changes: 3 additions & 1 deletion test_suite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use std::{env, process::Command};

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-check-cfg=cfg(rustc_1_31,rustc_1_33,rustc_1_39,rustc_1_46,rustc_1_61,rustc_1_83,const_unstable)");
println!(
"cargo:rustc-check-cfg=cfg(rustc_1_31,rustc_1_33,rustc_1_39,rustc_1_46,rustc_1_61,rustc_1_83,const_unstable)"
);

let cfg = autocfg::new();
if cfg.probe_rustc_version(1, 31) {
Expand Down

0 comments on commit a43d29d

Please sign in to comment.