Skip to content

Commit 4d2978a

Browse files
committed
Update test suite to nightly-2025-06-08
1 parent 7ff5375 commit 4d2978a

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

tests/common/eq.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ use rustc_ast::ast::WherePredicate;
169169
use rustc_ast::ast::WherePredicateKind;
170170
use rustc_ast::ast::WhereRegionPredicate;
171171
use rustc_ast::ast::YieldKind;
172-
use rustc_ast::ptr::P;
173172
use rustc_ast::token::{self, CommentKind, Delimiter, IdentIsRaw, Lit, Token, TokenKind};
174173
use rustc_ast::tokenstream::{
175174
AttrTokenStream, AttrTokenTree, AttrsTarget, DelimSpacing, DelimSpan, LazyAttrTokenStream,
@@ -195,12 +194,6 @@ impl<T: ?Sized + SpanlessEq> SpanlessEq for Box<T> {
195194
}
196195
}
197196

198-
impl<T: ?Sized + SpanlessEq> SpanlessEq for P<T> {
199-
fn eq(&self, other: &Self) -> bool {
200-
SpanlessEq::eq(&**self, &**other)
201-
}
202-
}
203-
204197
impl<T: ?Sized + SpanlessEq> SpanlessEq for Arc<T> {
205198
fn eq(&self, other: &Self) -> bool {
206199
SpanlessEq::eq(&**self, &**other)

tests/common/parse.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ extern crate rustc_session;
66
extern crate rustc_span;
77

88
use rustc_ast::ast;
9-
use rustc_ast::ptr::P;
109
use rustc_session::parse::ParseSess;
1110
use rustc_span::FileName;
1211
use std::panic;
1312

14-
pub fn librustc_expr(input: &str) -> Option<P<ast::Expr>> {
13+
pub fn librustc_expr(input: &str) -> Option<Box<ast::Expr>> {
1514
match panic::catch_unwind(|| {
1615
let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
1716
let sess = ParseSess::new(locale_resources);

tests/test_precedence.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use crate::common::eq::SpanlessEq;
4343
use crate::common::parse;
4444
use quote::ToTokens;
4545
use rustc_ast::ast;
46-
use rustc_ast::ptr::P;
4746
use rustc_ast_pretty::pprust;
4847
use rustc_span::edition::Edition;
4948
use std::fs;
@@ -197,11 +196,11 @@ fn test_expressions(path: &Path, edition: Edition, exprs: Vec<syn::Expr>) -> (us
197196
(passed, failed)
198197
}
199198

200-
fn librustc_parse_and_rewrite(input: &str) -> Option<P<ast::Expr>> {
199+
fn librustc_parse_and_rewrite(input: &str) -> Option<Box<ast::Expr>> {
201200
parse::librustc_expr(input).map(librustc_parenthesize)
202201
}
203202

204-
fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
203+
fn librustc_parenthesize(mut librustc_expr: Box<ast::Expr>) -> Box<ast::Expr> {
205204
use rustc_ast::ast::{
206205
AssocItem, AssocItemKind, Attribute, BinOpKind, Block, BoundConstness, Expr, ExprField,
207206
ExprKind, GenericArg, GenericBound, Local, LocalKind, Pat, PolyTraitRef, Stmt, StmtKind,
@@ -276,7 +275,7 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
276275
}
277276

278277
impl MutVisitor for FullyParenthesize {
279-
fn visit_expr(&mut self, e: &mut P<Expr>) {
278+
fn visit_expr(&mut self, e: &mut Box<Expr>) {
280279
noop_visit_expr(e, self);
281280
match e.kind {
282281
ExprKind::Block(..) | ExprKind::If(..) | ExprKind::Let(..) => {}
@@ -346,9 +345,9 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
346345

347346
fn flat_map_assoc_item(
348347
&mut self,
349-
item: P<AssocItem>,
348+
item: Box<AssocItem>,
350349
ctxt: AssocCtxt,
351-
) -> SmallVec<[P<AssocItem>; 1]> {
350+
) -> SmallVec<[Box<AssocItem>; 1]> {
352351
match &item.kind {
353352
AssocItemKind::Const(const_item)
354353
if !const_item.generics.params.is_empty()
@@ -363,11 +362,11 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
363362
// We don't want to look at expressions that might appear in patterns or
364363
// types yet. We'll look into comparing those in the future. For now
365364
// focus on expressions appearing in other places.
366-
fn visit_pat(&mut self, pat: &mut P<Pat>) {
365+
fn visit_pat(&mut self, pat: &mut Box<Pat>) {
367366
let _ = pat;
368367
}
369368

370-
fn visit_ty(&mut self, ty: &mut P<Ty>) {
369+
fn visit_ty(&mut self, ty: &mut Box<Ty>) {
371370
let _ = ty;
372371
}
373372

0 commit comments

Comments
 (0)