Skip to content

Commit d8424bd

Browse files
committed
Sync with rust-lang/rust
1 parent e3f0a53 commit d8424bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+367
-238
lines changed

Cargo.lock

Lines changed: 81 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cargo_metadata = "0.18"
4040
clap = { version = "4.4.2", features = ["derive"] }
4141
clap-cargo = "0.12.0"
4242
diff = "0.1"
43-
dirs = "5.0"
43+
dirs = "6.0"
4444
getopts = "0.2"
4545
ignore = "0.4"
4646
itertools = "0.12"

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2025-04-02"
2+
channel = "nightly-2025-10-07"
33
components = ["llvm-tools", "rustc-dev"]

src/chains.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
use std::borrow::Cow;
5959
use std::cmp::min;
6060

61-
use rustc_ast::{ast, ptr};
61+
use rustc_ast::ast;
6262
use rustc_span::{BytePos, Span, symbol};
6363
use tracing::debug;
6464

@@ -190,7 +190,7 @@ enum ChainItemKind {
190190
MethodCall(
191191
ast::PathSegment,
192192
Vec<ast::GenericArg>,
193-
ThinVec<ptr::P<ast::Expr>>,
193+
ThinVec<Box<ast::Expr>>,
194194
),
195195
StructField(symbol::Ident),
196196
TupleField(symbol::Ident, bool),
@@ -344,7 +344,7 @@ impl ChainItem {
344344
fn rewrite_method_call(
345345
method_name: symbol::Ident,
346346
types: &[ast::GenericArg],
347-
args: &[ptr::P<ast::Expr>],
347+
args: &[Box<ast::Expr>],
348348
span: Span,
349349
context: &RewriteContext<'_>,
350350
shape: Shape,

src/closures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_ast::{Label, ast, ptr};
1+
use rustc_ast::{Label, ast};
22
use rustc_span::Span;
33
use thin_vec::thin_vec;
44
use tracing::debug;
@@ -169,7 +169,7 @@ fn rewrite_closure_with_block(
169169
let block = ast::Block {
170170
stmts: thin_vec![ast::Stmt {
171171
id: ast::NodeId::root(),
172-
kind: ast::StmtKind::Expr(ptr::P(body.clone())),
172+
kind: ast::StmtKind::Expr(Box::new(body.clone())),
173173
span: body.span,
174174
}],
175175
id: ast::NodeId::root(),

src/config/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ mod test {
555555
#[allow(dead_code)]
556556
mod mock {
557557
use super::super::*;
558-
use crate::config_option_with_style_edition_default;
559558
use rustfmt_config_proc_macro::config_type;
560559

561560
#[config_type]

src/expr.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::cmp::min;
33

44
use itertools::Itertools;
55
use rustc_ast::token::{Delimiter, Lit, LitKind};
6-
use rustc_ast::{ForLoopKind, MatchKind, ast, ptr, token};
6+
use rustc_ast::{ForLoopKind, MatchKind, ast, token};
77
use rustc_span::{BytePos, Span};
88
use tracing::debug;
99

@@ -1464,7 +1464,7 @@ fn choose_separator_tactic(context: &RewriteContext<'_>, span: Span) -> Option<S
14641464
pub(crate) fn rewrite_call(
14651465
context: &RewriteContext<'_>,
14661466
callee: &str,
1467-
args: &[ptr::P<ast::Expr>],
1467+
args: &[Box<ast::Expr>],
14681468
span: Span,
14691469
shape: Shape,
14701470
) -> RewriteResult {
@@ -1727,7 +1727,7 @@ fn struct_lit_can_be_aligned(fields: &[ast::ExprField], has_base: bool) -> bool
17271727
fn rewrite_struct_lit<'a>(
17281728
context: &RewriteContext<'_>,
17291729
path: &ast::Path,
1730-
qself: &Option<ptr::P<ast::QSelf>>,
1730+
qself: &Option<Box<ast::QSelf>>,
17311731
fields: &'a [ast::ExprField],
17321732
struct_rest: &ast::StructRest,
17331733
attrs: &[ast::Attribute],
@@ -2126,7 +2126,7 @@ fn rewrite_assignment(
21262126
context: &RewriteContext<'_>,
21272127
lhs: &ast::Expr,
21282128
rhs: &ast::Expr,
2129-
op: Option<&ast::BinOp>,
2129+
op: Option<&ast::AssignOp>,
21302130
shape: Shape,
21312131
) -> RewriteResult {
21322132
let operator_str = match op {
@@ -2356,8 +2356,10 @@ fn rewrite_expr_addrof(
23562356
) -> RewriteResult {
23572357
let operator_str = match (mutability, borrow_kind) {
23582358
(ast::Mutability::Not, ast::BorrowKind::Ref) => "&",
2359+
(ast::Mutability::Not, ast::BorrowKind::Pin) => "&pin const ",
23592360
(ast::Mutability::Not, ast::BorrowKind::Raw) => "&raw const ",
23602361
(ast::Mutability::Mut, ast::BorrowKind::Ref) => "&mut ",
2362+
(ast::Mutability::Mut, ast::BorrowKind::Pin) => "&pin mut ",
23612363
(ast::Mutability::Mut, ast::BorrowKind::Raw) => "&raw mut ",
23622364
};
23632365
rewrite_unary_prefix(context, operator_str, expr, shape)

src/imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl UseSegment {
184184
modsep: bool,
185185
) -> Option<UseSegment> {
186186
let name = rewrite_ident(context, path_seg.ident);
187-
if name.is_empty() || name == "{{root}}" {
187+
if name.is_empty() {
188188
return None;
189189
}
190190
let kind = match name {

0 commit comments

Comments
 (0)