Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6d1e93d
Add support for $crate to Ident
Daniel-Aaron-Bloom Apr 14, 2025
9a7db56
moved tests
Kivooeo Jun 30, 2025
7ca9f93
tests/codegen/enum/enum-match.rs: accept negative range attribute
TimNN Jul 1, 2025
7c2cc2c
cleaned up some tests
Kivooeo Jun 30, 2025
49421d1
Remove support for dynamic allocas
mejrs Jun 24, 2025
0455577
fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuild…
dillona Jul 8, 2025
fab9c64
Add triagebot stdarch mention ping
Kobzol Jul 8, 2025
66bc234
tidy: refactor --extra-checks parsing
lolbinarycat Jul 3, 2025
96cdbb9
Win: Use exceptions with empty data for SEH panic exception copies
Fulgen301 Jul 8, 2025
25eb382
Error on moving unsized values rather than ICE'ing
mejrs Jul 8, 2025
9eb1805
tidy: factor out change detection logic and make it more robust
lolbinarycat Jul 3, 2025
4a6f697
tidy: update files_modified to take CiInfo
lolbinarycat Jul 3, 2025
64456e0
tidy: add `auto:` prefix to --extra-checks syntax
lolbinarycat Jul 3, 2025
6b349a4
tidy: warn when --extra-checks is passed an invalid lang:kind combo
lolbinarycat Jul 3, 2025
9aafc98
tidy: assume all files are modified in CI
lolbinarycat Jul 8, 2025
1f80fd0
bootstrap: add change tracker entry for new --extra-checks=auto: feature
lolbinarycat Jul 8, 2025
e7ef31d
mbe: Refactor diagnostics for invalid metavar expression syntax
tgross35 Jun 21, 2025
87e9819
mbe: Refactor the diagnostic for unrecognized metavariable expressions
tgross35 Jun 21, 2025
3f8b609
Rollup merge of #141996 - Daniel-Aaron-Bloom:dollar_crate, r=petroche…
tgross35 Jul 10, 2025
9e95e4b
Rollup merge of #142911 - mejrs:unsized, r=compiler-errors
tgross35 Jul 10, 2025
894dc34
Rollup merge of #142950 - tgross35:metavariable-expr-rework, r=petroc…
tgross35 Jul 10, 2025
e3e7b07
Rollup merge of #143270 - TimNN:fix-enum-match, r=nikic
tgross35 Jul 10, 2025
915a8ae
Rollup merge of #143298 - Kivooeo:tf23, r=tgross35
tgross35 Jul 10, 2025
fee2068
Rollup merge of #143398 - lolbinarycat:tidy-extra-checks-auto, r=Kobzol
tgross35 Jul 10, 2025
a1c2c61
Rollup merge of #143632 - dillona:ffi-param-names, r=jieyouxu
tgross35 Jul 10, 2025
8cae093
Rollup merge of #143644 - Kobzol:stdarch-mention, r=Amanieu
tgross35 Jul 10, 2025
9ec2968
Rollup merge of #143651 - Fulgen301:seh-exception-ptr, r=ChrisDenton
tgross35 Jul 10, 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
  • Loading branch information
Kivooeo committed Jul 4, 2025
commit 7c2cc2ce40f962edeb7badc50172c5b6ff280f12
54 changes: 32 additions & 22 deletions tests/ui/codegen/output-slot-init-vs-noninit.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
//! Check that output slots work correctly for both initializing and non-initializing assignments.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/24>.

//@ run-pass

#![allow(dead_code)]
#![allow(unused_assignments)]
#![allow(unknown_lints)]

#![allow(dead_assignment)]
#![allow(unused_variables)]

struct A { a: isize, b: isize }
struct Abox { a: Box<isize>, b: Box<isize> }
struct A {
a: isize,
b: isize,
}

fn ret_int_i() -> isize { 10 }
struct Abox {
a: Box<isize>,
b: Box<isize>,
}

fn ret_ext_i() -> Box<isize> { Box::new(10) }
fn ret_int_i() -> isize {
10
}

fn ret_int_rec() -> A { A {a: 10, b: 10} }
fn ret_ext_i() -> Box<isize> {
Box::new(10)
}

fn ret_ext_rec() -> Box<A> { Box::new(A {a: 10, b: 10}) }
fn ret_int_rec() -> A {
A { a: 10, b: 10 }
}

fn ret_ext_mem() -> Abox { Abox {a: Box::new(10), b: Box::new(10) } }
fn ret_ext_rec() -> Box<A> {
Box::new(A { a: 10, b: 10 })
}

fn ret_ext_mem() -> Abox {
Abox { a: Box::new(10), b: Box::new(10) }
}

fn ret_ext_ext_mem() -> Box<Abox> { Box::new(Abox{a: Box::new(10), b: Box::new(10) }) }
fn ret_ext_ext_mem() -> Box<Abox> {
Box::new(Abox { a: Box::new(10), b: Box::new(10) })
}

pub fn main() {
let mut int_i: isize;
Expand All @@ -29,40 +51,28 @@ pub fn main() {
let mut ext_rec: Box<A>;
let mut ext_mem: Abox;
let mut ext_ext_mem: Box<Abox>;
int_i = ret_int_i(); // initializing

int_i = ret_int_i(); // initializing
int_i = ret_int_i(); // non-initializing

int_i = ret_int_i(); // non-initializing

ext_i = ret_ext_i(); // initializing

ext_i = ret_ext_i(); // non-initializing

ext_i = ret_ext_i(); // non-initializing

int_rec = ret_int_rec(); // initializing

int_rec = ret_int_rec(); // non-initializing

int_rec = ret_int_rec(); // non-initializing

ext_rec = ret_ext_rec(); // initializing

ext_rec = ret_ext_rec(); // non-initializing

ext_rec = ret_ext_rec(); // non-initializing

ext_mem = ret_ext_mem(); // initializing

ext_mem = ret_ext_mem(); // non-initializing

ext_mem = ret_ext_mem(); // non-initializing

ext_ext_mem = ret_ext_ext_mem(); // initializing

ext_ext_mem = ret_ext_ext_mem(); // non-initializing

ext_ext_mem = ret_ext_ext_mem(); // non-initializing

}
14 changes: 8 additions & 6 deletions tests/ui/codegen/remark-flag-functionality.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
//! Check that `-Cremark` flag correctly emits LLVM optimization remarks.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/90924>.

//@ build-pass
//@ ignore-pass
//@ revisions: all inline merge1 merge2
//@ compile-flags: --crate-type=lib -Cdebuginfo=1 -Copt-level=2
//

// Check that remarks can be enabled individually or with "all":
//
//@ [all] compile-flags: -Cremark=all
//@ [inline] compile-flags: -Cremark=inline
//

// Check that values of -Cremark flag are accumulated:
//
//@ [merge1] compile-flags: -Cremark=all -Cremark=giraffe
//@ [merge2] compile-flags: -Cremark=inline -Cremark=giraffe

//@ dont-check-compiler-stderr
//@ dont-require-annotations: NOTE

#[no_mangle]
#[inline(never)]
pub fn f() {
}
pub fn f() {}

#[no_mangle]
pub fn g() {
Expand Down
21 changes: 14 additions & 7 deletions tests/ui/codegen/shift-right-operand-mutation.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
//! Ensure shift operations don't mutate their right operand.
//!
//! This test checks that expressions like `0 << b` don't accidentally
//! modify the variable `b` due to codegen issues with virtual registers.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/152>.

//@ run-pass

#![allow(unused_must_use)]
// Regression test for issue #152.
pub fn main() {
let mut b: usize = 1_usize;
while b < std::mem::size_of::<usize>() {
0_usize << b;
b <<= 1_usize;
println!("{}", b);
let mut b: usize = 1;
while b < size_of::<usize>() {
// This shift operation should not mutate `b`
let _ = 0_usize << b;
b <<= 1;
std::hint::black_box(b);
}
assert_eq!(size_of::<usize>(), b);
}
13 changes: 9 additions & 4 deletions tests/ui/codegen/sret-aliasing-rules.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//! Check that functions with sret results don't violate aliasing rules.
//!
//! When `foo = func(&mut foo)` is called, the compiler must avoid creating
//! two mutable references to the same variable simultaneously (one for the
//! parameter and one for the hidden sret out-pointer).
//!
//! Regression test for <https://github.com/rust-lang/rust/pull/18250>.

//@ run-pass

#[derive(Copy, Clone)]
Expand All @@ -14,10 +22,7 @@ pub fn foo(f: &mut Foo) -> Foo {
}

pub fn main() {
let mut f = Foo {
f1: 8,
_f2: 9,
};
let mut f = Foo { f1: 8, _f2: 9 };
f = foo(&mut f);
assert_eq!(f.f1, 8);
}
6 changes: 4 additions & 2 deletions tests/ui/macros/macro-paren-span-diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Be smart about span of parenthesized expression in macro.
//! Check that error spans in parenthesized macro expressions point to the call site.

#[rustfmt::skip]
macro_rules! paren {
($e:expr) => (($e))
// ^^^^ do not highlight here
}

mod m {
pub struct S {
x: i32
x: i32,
}

pub fn make() -> S {
S { x: 0 }
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/macro-paren-span-diagnostic.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0616]: field `x` of struct `S` is private
--> $DIR/paren-span.rs:19:14
--> $DIR/macro-paren-span-diagnostic.rs:21:14
|
LL | paren!(s.x);
| ^ private field
Expand Down
12 changes: 8 additions & 4 deletions tests/ui/panics/panic-during-display-formatting.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Check that panics in `Display::fmt` during printing are properly handled.

//@ run-pass
//@ needs-unwind

Expand All @@ -18,8 +20,10 @@ impl Display for A {

fn main() {
set_output_capture(Some(Arc::new(Mutex::new(Vec::new()))));
assert!(std::panic::catch_unwind(|| {
eprintln!("{}", A);
})
.is_err());
assert!(
std::panic::catch_unwind(|| {
eprintln!("{}", A);
})
.is_err()
);
}
6 changes: 4 additions & 2 deletions tests/ui/panics/panic-handler-closures.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//@ build-pass (FIXME(62277): could be check-pass?)
//! Check that closures can be used inside `#[panic_handler]` functions.

//@ check-pass

#![crate_type = "rlib"]
#![no_std]

#[panic_handler]
pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {
pub fn panicfmt(_: &::core::panic::PanicInfo) -> ! {
|x: u8| x;
loop {}
}
9 changes: 6 additions & 3 deletions tests/ui/parser/ufcs-return-unused-parens.fixed
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
//! Check that UFCS syntax works correctly in return statements
//! without requiring workaround parentheses.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/37765>.

//@ run-pass
//@ run-rustfix

#![allow(dead_code)]
#![warn(unused_parens)]

// Parser test for #37765

fn with_parens<T: ToString>(arg: T) -> String {
return <T as ToString>::to_string(&arg); //~WARN unnecessary parentheses around `return` value
return <T as ToString>::to_string(&arg); //~ WARN unnecessary parentheses around `return` value
}

fn no_parens<T: ToString>(arg: T) -> String {
Expand Down
9 changes: 6 additions & 3 deletions tests/ui/parser/ufcs-return-unused-parens.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
//! Check that UFCS syntax works correctly in return statements
//! without requiring workaround parentheses.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/37765>.

//@ run-pass
//@ run-rustfix

#![allow(dead_code)]
#![warn(unused_parens)]

// Parser test for #37765

fn with_parens<T: ToString>(arg: T) -> String {
return (<T as ToString>::to_string(&arg)); //~WARN unnecessary parentheses around `return` value
return (<T as ToString>::to_string(&arg)); //~ WARN unnecessary parentheses around `return` value
}

fn no_parens<T: ToString>(arg: T) -> String {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parser/ufcs-return-unused-parens.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
warning: unnecessary parentheses around `return` value
--> $DIR/path-lookahead.rs:10:12
--> $DIR/ufcs-return-unused-parens.rs:13:12
|
LL | return (<T as ToString>::to_string(&arg));
| ^ ^
|
note: the lint level is defined here
--> $DIR/path-lookahead.rs:5:9
--> $DIR/ufcs-return-unused-parens.rs:10:9
|
LL | #![warn(unused_parens)]
| ^^^^^^^^^^^^^
Expand Down
4 changes: 3 additions & 1 deletion tests/ui/traits/partialeq-ref-mismatch-diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Check diagnostic messages for `PartialEq` trait bound mismatches between `&T` and `T`.

fn foo<T: PartialEq>(a: &T, b: T) {
a == b; //~ ERROR E0277
}

fn foo2<T: PartialEq>(a: &T, b: T) where {
fn foo2<T: PartialEq>(a: &T, b: T) {
a == b; //~ ERROR E0277
}

Expand Down
8 changes: 4 additions & 4 deletions tests/ui/traits/partialeq-ref-mismatch-diagnostic.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: can't compare `&T` with `T`
--> $DIR/partialeq_help.rs:2:7
--> $DIR/partialeq-ref-mismatch-diagnostic.rs:4:7
|
LL | a == b;
| ^^ no implementation for `&T == T`
Expand All @@ -15,7 +15,7 @@ LL | fn foo<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
| ++++++++++++++++++++++

error[E0277]: can't compare `&T` with `T`
--> $DIR/partialeq_help.rs:6:7
--> $DIR/partialeq-ref-mismatch-diagnostic.rs:8:7
|
LL | a == b;
| ^^ no implementation for `&T == T`
Expand All @@ -25,10 +25,10 @@ help: consider dereferencing here
|
LL | *a == b;
| +
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
LL | fn foo2<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
| ++++++++++++++++
| ++++++++++++++++++++++

error: aborting due to 2 previous errors

Expand Down
Loading