Rollup merge of #154112 - cyrgani:macros-folder, r=Kivooeo

some `tests/ui/macros` cleanup

Move most tests that do not run any code from `//@ run-pass` to `//@ check-pass` and merge the (outdated) `die-macro-*` tests into one file.
This commit is contained in:
Jonathan Brouwer
2026-03-25 19:52:57 +01:00
committed by GitHub
34 changed files with 38 additions and 65 deletions
-7
View File
@@ -1,7 +0,0 @@
//@ run-fail
//@ error-pattern:test
//@ needs-subprocess
fn main() {
panic!("test");
}
-11
View File
@@ -1,11 +0,0 @@
//@ run-fail
//@ error-pattern:test
//@ needs-subprocess
fn f() {
panic!("test");
}
fn main() {
f();
}
-16
View File
@@ -1,16 +0,0 @@
//@ run-pass
#![allow(dead_code)]
// Just testing that panic!() type checks in statement or expr
#![allow(unreachable_code)]
fn f() {
panic!();
let _x: isize = panic!();
}
pub fn main() {
}
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(dead_code)]
#[macro_export]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(dead_code)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(unused_macros)]
macro_rules! m {
($e:expr) => {
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! descriptions {
($name:ident is $desc:expr) => {
// Check that we will correctly expand attributes
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! compiles_fine {
(#[$at:meta]) => {
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
fn main() {
vec![1_usize, 2, 3].len();
}
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(non_snake_case)]
macro_rules! doc {
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
// When expanding a macro, documentation attributes (including documentation comments) must be
// passed "as is" without being parsed. Otherwise, some text will be incorrectly interpreted as
// escape sequences, leading to an ICE.
+1 -1
View File
@@ -1,5 +1,5 @@
//@ edition:2015..2021
//@ run-pass
//@ check-pass
#![allow(unused_macros)]
// Check the macro follow sets (see corresponding cfail test).
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(unused_macros)]
// Regression test for issue #25436: check that things which can be
// followed by any token also permit X* to come afterwards.
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![feature(decl_macro)]
pub fn moo() {
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! four {
() => (4)
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! make_foo {
() => (
struct Foo;
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! default {
($($x:tt)*) => { $($x)* }
}
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! list {
( ($($id:ident),*) ) => (());
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
//@ edition:2018
macro_rules! pat_bar {
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(dead_code, unused_imports, unused_macro_rules)]
/**
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
// Test of allowing two sequences repetitions in a row,
// functionality added as byproduct of RFC amendment #1384
// https://github.com/rust-lang/rfcs/pull/1384
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
//@ aux-build:two_macros-rpass.rs
#![warn(unused_attributes)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
//@ aux-build:two_macros.rs
#[macro_use]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
//@ aux-build:two_macros.rs
#[macro_use(macro_one, macro_two)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
//@ aux-build:two_macros.rs
#[macro_use(macro_two)]
@@ -1,7 +1,14 @@
//@ run-fail
//@ error-pattern:test
//@ needs-subprocess
// Just testing that panic!() type checks in statement or expr
fn f() {
let __isize: isize = panic!("test");
panic!();
}
fn main() {
let __isize: isize = panic!("test");
f();
}
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(unused_must_use)]
#![allow(dead_code)]
#![allow(unused_assignments)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
// Issue #14660
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
// Issue #17436
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
macro_rules! foo {
($t:ty; $p:path;) => {}
}
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
//@ aux-build:two_macros.rs
#[macro_use(macro_one)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_local_definitions)]
+1 -1
View File
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(unused_imports)]
//@ aux-build:use-macro-self.rs