Skip to content

Clean up some tests in tests/ui #138471

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

Merged
merged 3 commits into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions tests/ui/attributes/outer-mod-attr-applies-only-to-first.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Regression test to check that outer attributes applied to the first module item is applied to
//! its attached module item only, and not also to other subsequent module items
//!
//! Commit: <https://github.com/rust-lang/rust/commit/7aee9f7b56f8d96f9444ebb1d06e32e024b81974>

//@ check-pass
//@ compile-flags: --cfg=first
//@ no-auto-check-cfg

#[cfg(first)]
mod hello {}

#[cfg(not_set)]
mod hello {}

fn main() {}
25 changes: 0 additions & 25 deletions tests/ui/dupe-first-attr.rs

This file was deleted.

18 changes: 0 additions & 18 deletions tests/ui/duplicate_entry_error.rs

This file was deleted.

20 changes: 20 additions & 0 deletions tests/ui/error-codes/E0152-duplicate-lang-items.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//! Validates the correct printing of E0152 in the case of duplicate "lang_item" function
//! definitions.
//!
//! Issue: <https://github.com/rust-lang/rust/issues/31788>
//@ error-pattern: first defined in crate `std`
//@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
#![feature(lang_items)]

extern crate core;

use core::panic::PanicInfo;

#[lang = "panic_impl"]
fn panic_impl(info: &PanicInfo) -> ! {
//~^ ERROR: found duplicate lang item `panic_impl`
loop {}
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
error[E0152]: found duplicate lang item `panic_impl`
--> $DIR/duplicate_entry_error.rs:13:1
--> $DIR/E0152-duplicate-lang-items.rs:15:1
|
LL | / fn panic_impl(info: &PanicInfo) -> ! {
LL | |
LL | | loop {}
LL | | }
| |_^
|
= note: the lang item is first defined in crate `std` (which `duplicate_entry_error` depends on)
= note: the lang item is first defined in crate `std` (which `E0152_duplicate_lang_items` depends on)
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
= note: second definition in the local crate (`duplicate_entry_error`)
= note: second definition in the local crate (`E0152_duplicate_lang_items`)

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for duplicated label in E0381 error message.
//!
//! Issue: <https://github.com/rust-lang/rust/issues/129274>
fn main() {
fn test() {
loop {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0381]: used binding `blah` is possibly-uninitialized
--> $DIR/duplicate-label-E0381-issue-129274.rs:8:33
--> $DIR/E0381-duplicated-label.rs:11:33
|
LL | let blah: Option<String>;
| ---- binding declared here but left uninitialized
Expand Down
Loading