Skip to content

Rollup of 13 pull requests #143876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8d0e0c6
interpret/allocation: expose init + write_wildcards on a range
nia-e Jul 8, 2025
889582e
Check assoc consts and tys later like assoc fns
mu001999 Jul 6, 2025
e681d1a
constify `From` and `Into`
oli-obk Jul 11, 2025
3fe3edb
Add --compile-time-deps argument for x check
bjorn3 Jul 11, 2025
34426dc
Fix fallback for CI_JOB_NAME
nikic Jul 11, 2025
87958ad
Avoid building C++ for rustc_llvm with --compile-time-deps
bjorn3 Jul 11, 2025
ae1075b
Update description for flag
bjorn3 Jul 11, 2025
8be915f
Preserve the .debug_gdb_scripts section
sebastianpoeplau Jul 3, 2025
3751e13
slice: Mark `rotate_left`, `rotate_right` unstably const
okaneco Jul 6, 2025
73edfe7
clippy: fix test filtering when TESTNAME is empty
RalfJung Jul 12, 2025
acbbc18
fix span for deferred command execution
Shourya742 Jul 12, 2025
57ee3f2
add span to streaming command execution flow
Shourya742 Jul 12, 2025
ccc302b
Move --compile-time-deps
bjorn3 Jul 12, 2025
10bec8f
Add change_tracker.rs entry
bjorn3 Jul 12, 2025
9ed5378
replace binding and shadowed_glob on NameResolution with non_glob_bin…
b-naber Jul 11, 2025
a9a238b
explicitly drop span_guard in wait_for_output
Shourya742 Jul 12, 2025
e3fc6e5
merge source and target bindings into single field
LorrensP-2158466 Jul 9, 2025
47b8a32
moved tests
Kivooeo Jul 1, 2025
9893470
cleaned up some tests
Kivooeo Jul 1, 2025
d683da0
make `cfg_select` a builtin macro
folkertdev Jul 4, 2025
2a757d3
Rollup merge of #143301 - Kivooeo:tf26, r=tgross35
matthiaskrgr Jul 13, 2025
c68b085
Rollup merge of #143461 - folkertdev:cfg-select-builtin-macro, r=petr…
matthiaskrgr Jul 13, 2025
0fc0430
Rollup merge of #143519 - mu001999-contrib:dead-code/impl-items, r=pe…
matthiaskrgr Jul 13, 2025
90c7005
Rollup merge of #143554 - okaneco:const_slice_rotate, r=Amanieu,tgross35
matthiaskrgr Jul 13, 2025
5b3c9a5
Rollup merge of #143634 - nia-e:init-and-wildcards, r=RalfJung
matthiaskrgr Jul 13, 2025
8817408
Rollup merge of #143679 - sebastianpoeplau:preserve-debug-gdb-scripts…
matthiaskrgr Jul 13, 2025
a2859af
Rollup merge of #143685 - LorrensP-2158466:merge-import-bindings, r=p…
matthiaskrgr Jul 13, 2025
f80ad62
Rollup merge of #143734 - LorrensP-2158466:refactor-resolve-resolutio…
matthiaskrgr Jul 13, 2025
8a764dc
Rollup merge of #143774 - oli-obk:const_from, r=fee1-dead
matthiaskrgr Jul 13, 2025
3736467
Rollup merge of #143785 - bjorn3:faster_ra_build_script_build, r=Kobzol
matthiaskrgr Jul 13, 2025
e398b5a
Rollup merge of #143786 - nikic:ci-job-name-fallback, r=marcoieni
matthiaskrgr Jul 13, 2025
cdf7277
Rollup merge of #143825 - RalfJung:clippy-test-filter, r=llogiq
matthiaskrgr Jul 13, 2025
29f2761
Rollup merge of #143826 - Shourya742:2025-07-12-fix-command-trace, r=…
matthiaskrgr Jul 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleaned up some tests
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
  • Loading branch information
Kivooeo committed Jul 12, 2025
commit 98934707eb7824cd48ee3889d4570c1406c39ba4
25 changes: 0 additions & 25 deletions tests/ui/auxiliary/svh-a-base.rs

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/auxiliary/svh-b.rs

This file was deleted.

9 changes: 8 additions & 1 deletion tests/ui/cast/cast-enum-to-primitive-error.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//! This test verifies that a direct non-primitive cast from an enum to an integer type
//! is correctly disallowed, even when a `From` implementation exists for that enum.

//@ run-rustfix

#![allow(dead_code, unused_variables)]

enum NonNullary {
Nullary,
Other(isize),
Expand All @@ -16,5 +21,7 @@ impl From<NonNullary> for isize {

fn main() {
let v = NonNullary::Nullary;
let val = isize::from(v); //~ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
let val = isize::from(v);
//~^ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
//~| HELP consider using the `From` trait instead
}
9 changes: 8 additions & 1 deletion tests/ui/cast/cast-enum-to-primitive-error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//! This test verifies that a direct non-primitive cast from an enum to an integer type
//! is correctly disallowed, even when a `From` implementation exists for that enum.

//@ run-rustfix

#![allow(dead_code, unused_variables)]

enum NonNullary {
Nullary,
Other(isize),
Expand All @@ -16,5 +21,7 @@ impl From<NonNullary> for isize {

fn main() {
let v = NonNullary::Nullary;
let val = v as isize; //~ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
let val = v as isize;
//~^ ERROR non-primitive cast: `NonNullary` as `isize` [E0605]
//~| HELP consider using the `From` trait instead
}
2 changes: 1 addition & 1 deletion tests/ui/cast/cast-enum-to-primitive-error.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0605]: non-primitive cast: `NonNullary` as `isize`
--> $DIR/tag-variant-cast-non-nullary.rs:19:15
--> $DIR/cast-enum-to-primitive-error.rs:24:15
|
LL | let val = v as isize;
| ^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less
Expand Down
4 changes: 3 additions & 1 deletion tests/ui/cast/coercion-as-explicit-cast.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! This test checks that various forms of "trivial" casts and coercions
//! can be explicitly performed using the `as` keyword without compilation errors.

//@ run-pass
// Test that all coercions can actually be done using casts (modulo the lints).

#![allow(trivial_casts, trivial_numeric_casts)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/cast/coercion-as-explicit-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: method `foo` is never used
--> $DIR/trivial_casts-rpass.rs:7:8
--> $DIR/coercion-as-explicit-cast.rs:9:8
|
LL | trait Foo {
| --- method in this trait
Expand Down
17 changes: 13 additions & 4 deletions tests/ui/generics/generic-enum-errors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
enum Quux<T> { Bar }
//~^ ERROR: parameter `T` is never used
//! This test checks that unused generics are rejected by compiler

fn foo(c: Quux) { assert!((false)); } //~ ERROR missing generics for enum `Quux`
enum Quux<T> {
//~^ ERROR: parameter `T` is never used
Bar,
}

fn main() { panic!(); }
fn foo(c: Quux) {
//~^ ERROR missing generics for enum `Quux`
assert!((false));
}

fn main() {
panic!();
}
14 changes: 7 additions & 7 deletions tests/ui/generics/generic-enum-errors.stderr
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
error[E0392]: type parameter `T` is never used
--> $DIR/tag-type-args.rs:1:11
--> $DIR/generic-enum-errors.rs:3:11
|
LL | enum Quux<T> { Bar }
LL | enum Quux<T> {
| ^ unused type parameter
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead

error[E0107]: missing generics for enum `Quux`
--> $DIR/tag-type-args.rs:4:11
--> $DIR/generic-enum-errors.rs:8:11
|
LL | fn foo(c: Quux) { assert!((false)); }
LL | fn foo(c: Quux) {
| ^^^^ expected 1 generic argument
|
note: enum defined here, with 1 generic parameter: `T`
--> $DIR/tag-type-args.rs:1:6
--> $DIR/generic-enum-errors.rs:3:6
|
LL | enum Quux<T> { Bar }
LL | enum Quux<T> {
| ^^^^ -
help: add missing generic argument
|
LL | fn foo(c: Quux<T>) { assert!((false)); }
LL | fn foo(c: Quux<T>) {
| +++

error: aborting due to 2 previous errors
Expand Down
7 changes: 4 additions & 3 deletions tests/ui/modules/module-super-access.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Check path resolution using `super`

//@ run-pass

#![allow(dead_code)]
Expand All @@ -6,10 +8,9 @@ pub mod a {
pub fn f() {}
pub mod b {
fn g() {
super::f();
super::f(); // Accessing `f` from module `a` (parent of `b`)
}
}
}

pub fn main() {
}
pub fn main() {}
6 changes: 4 additions & 2 deletions tests/ui/modules/super-at-crate-root.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Check that `super` keyword used at the crate root (top-level) results in a compilation error
//! as there is no parent module to resolve.

use super::f; //~ ERROR there are too many leading `super` keywords

fn main() {
}
fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/modules/super-at-crate-root.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0433]: failed to resolve: there are too many leading `super` keywords
--> $DIR/super-at-top-level.rs:1:5
--> $DIR/super-at-crate-root.rs:4:5
|
LL | use super::f;
| ^^^^^ there are too many leading `super` keywords
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/parser/syntactic-trailing-commas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//! Checks trailing commas are accepted in various places:
//! - Generic parameters in function and struct definitions.
//! - Function and method arguments.
//! - Tuple and array literal expressions.
//! - Tuple and array destructuring patterns, including those with `..`.
//! - Enum variant declarations.
//! - Attributes.

//@ run-pass

fn f<T,>(_: T,) {}
Expand Down
6 changes: 5 additions & 1 deletion tests/ui/ptr_ops/ptr-swap-basic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
//! Check the basic functionality of `std::mem::swap` to ensure it correctly
//! exchanges the values of two mutable variables.

//@ run-pass

use std::mem::swap;

pub fn main() {
let mut x = 3; let mut y = 7;
let mut x = 3;
let mut y = 7;
swap(&mut x, &mut y);
assert_eq!(x, 7);
assert_eq!(y, 3);
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/ptr_ops/ptr-swap-overlapping-regions.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
//! Check that `std::ptr::swap` behaves correctly when the source and destination
//! pointers refer to the same memory location, avoiding issues like overlapping `memcpy`.
//!
//! Regression test: <https://github.com/rust-lang/rust/issues/5041>

//@ run-pass

#![allow(dead_code)]
// Issue #5041 - avoid overlapping memcpy when src and dest of a swap are the same


use std::ptr;

pub fn main() {
let mut test = TestDescAndFn {
desc: TestDesc {
name: TestName::DynTestName("test".to_string()),
should_fail: false
},
desc: TestDesc { name: TestName::DynTestName("test".to_string()), should_fail: false },
testfn: TestFn::DynTestFn(22),
};
do_swap(&mut test);
Expand All @@ -24,7 +24,7 @@ fn do_swap(test: &mut TestDescAndFn) {
}

pub enum TestName {
DynTestName(String)
DynTestName(String),
}

pub enum TestFn {
Expand All @@ -34,7 +34,7 @@ pub enum TestFn {

pub struct TestDesc {
name: TestName,
should_fail: bool
should_fail: bool,
}

pub struct TestDescAndFn {
Expand Down
11 changes: 9 additions & 2 deletions tests/ui/recursion/recursion-tail-call-no-arg-leak.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
//! This test verifies that tail call optimization does not lead to argument slot leaks.
//!
//! Regression test for: <https://github.com/rust-lang/rust/issues/160>

//@ run-pass
// use of tail calls causes arg slot leaks, issue #160.

fn inner(dummy: String, b: bool) { if b { return inner(dummy, false); } }
fn inner(dummy: String, b: bool) {
if b {
return inner(dummy, false);
}
}

pub fn main() {
inner("hi".to_string(), true);
Expand Down
25 changes: 21 additions & 4 deletions tests/ui/recursion/recursion-tail-cps.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
//! Verify that mutually recursive functions use CPS to avoid overflowing the stack.

//@ run-pass

fn checktrue(rs: bool) -> bool { assert!(rs); return true; }
fn checktrue(rs: bool) -> bool {
assert!(rs);
return true;
}

pub fn main() { let k = checktrue; evenk(42, k); oddk(45, k); }
pub fn main() {
let k = checktrue;
evenk(42, k);
oddk(45, k);
}

fn evenk(n: isize, k: fn(bool) -> bool) -> bool {
println!("evenk");
println!("{}", n);
if n == 0 { return k(true); } else { return oddk(n - 1, k); }
if n == 0 {
return k(true);
} else {
return oddk(n - 1, k);
}
}

fn oddk(n: isize, k: fn(bool) -> bool) -> bool {
println!("oddk");
println!("{}", n);
if n == 0 { return k(false); } else { return evenk(n - 1, k); }
if n == 0 {
return k(false);
} else {
return evenk(n - 1, k);
}
}
11 changes: 9 additions & 2 deletions tests/ui/svh/svh-no-api-change-no-recompile.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
//! This test verifies that the Signature Version Hash (SVH) system correctly identifies
//! when changes to an auxiliary crate do not affect its public API.
//!
//! Specifically, it checks that adding non-public items to a crate does not alter
//! its SVH, preventing unnecessary recompilations of dependent crates.

//@ run-pass
// note that these aux-build directives must be in this order

// Note that these aux-build directives must be in this order

//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-base.rs


extern crate a;
extern crate b;

Expand Down
7 changes: 6 additions & 1 deletion tests/ui/traits/trait-method-signature-mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
//! This test verifies that implementing a trait method with a signature that does not
//! exactly match its declaration in the trait results in a compilation error.
//! Specifically, it checks for errors when the number of parameters or the return type
//! in the `impl` differs from the trait definition.

trait Foo {
fn foo(&mut self, x: i32, y: i32) -> i32;
}

impl Foo for i32 {
fn foo(
&mut self, //~ ERROR
&mut self, //~ ERROR method `foo` has 2 parameters but the declaration
x: i32,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/traits/trait-method-signature-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0050]: method `foo` has 2 parameters but the declaration in trait `Foo::foo` has 3
--> $DIR/trait-method-number-parameters.rs:7:9
--> $DIR/trait-method-signature-mismatch.rs:12:9
|
LL | fn foo(&mut self, x: i32, y: i32) -> i32;
| ------------------------- trait requires 3 parameters
Expand Down
9 changes: 8 additions & 1 deletion tests/ui/traits/tryfrominterror-result-comparison.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
//! This test verifies that `std::num::TryFromIntError` correctly implements `PartialEq`,
//! allowing `Result<T, TryFromIntError>` values to be compared for equality using `==`.
//! It specifically checks a successful numeric conversion scenario where the `Result::Ok`
//! variant is compared, ensuring that the comparison yields the expected boolean result.

//@ run-pass

#![allow(unused_must_use)]
#![allow(unused_must_use)] // Allow ignoring the result of the comparison for the test's purpose

use std::convert::TryFrom;
use std::num::TryFromIntError;

fn main() {
let x: u32 = 125;
// Attempt to convert u32 to u8, which should succeed as 125 fits in u8.
let y: Result<u8, TryFromIntError> = u8::try_from(x);
// Verify that the Result can be correctly compared with an Ok value.
y == Ok(125);
}
Loading
Loading