Skip to content

Commit 7c1555c

Browse files
authored
Rollup merge of rust-lang#138471 - spencer3035:move-ui-test-1ofn, r=jieyouxu
Clean up some tests in tests/ui I cleaned up 3 top level tests, keeping the changes minor because it is my first PR and wanted to get feedback before doing more changes/PRs. Tracking issues: rust-lang#73494 rust-lang#133895 r? jieyouxu
2 parents e42f339 + 27077b9 commit 7c1555c

7 files changed

+43
-47
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//! Regression test to check that outer attributes applied to the first module item is applied to
2+
//! its attached module item only, and not also to other subsequent module items
3+
//!
4+
//! Commit: <https://github.com/rust-lang/rust/commit/7aee9f7b56f8d96f9444ebb1d06e32e024b81974>
5+
6+
//@ check-pass
7+
//@ compile-flags: --cfg=first
8+
//@ no-auto-check-cfg
9+
10+
#[cfg(first)]
11+
mod hello {}
12+
13+
#[cfg(not_set)]
14+
mod hello {}
15+
16+
fn main() {}

Diff for: tests/ui/dupe-first-attr.rs

-25
This file was deleted.

Diff for: tests/ui/duplicate_entry_error.rs

-18
This file was deleted.

Diff for: tests/ui/error-codes/E0152-duplicate-lang-items.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//! Validates the correct printing of E0152 in the case of duplicate "lang_item" function
2+
//! definitions.
3+
//!
4+
//! Issue: <https://github.com/rust-lang/rust/issues/31788>
5+
6+
//@ error-pattern: first defined in crate `std`
7+
//@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
8+
#![feature(lang_items)]
9+
10+
extern crate core;
11+
12+
use core::panic::PanicInfo;
13+
14+
#[lang = "panic_impl"]
15+
fn panic_impl(info: &PanicInfo) -> ! {
16+
//~^ ERROR: found duplicate lang item `panic_impl`
17+
loop {}
18+
}
19+
20+
fn main() {}

Diff for: tests/ui/duplicate_entry_error.stderr renamed to tests/ui/error-codes/E0152-duplicate-lang-items.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error[E0152]: found duplicate lang item `panic_impl`
2-
--> $DIR/duplicate_entry_error.rs:13:1
2+
--> $DIR/E0152-duplicate-lang-items.rs:15:1
33
|
44
LL | / fn panic_impl(info: &PanicInfo) -> ! {
55
LL | |
66
LL | | loop {}
77
LL | | }
88
| |_^
99
|
10-
= note: the lang item is first defined in crate `std` (which `duplicate_entry_error` depends on)
10+
= note: the lang item is first defined in crate `std` (which `E0152_duplicate_lang_items` depends on)
1111
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
12-
= note: second definition in the local crate (`duplicate_entry_error`)
12+
= note: second definition in the local crate (`E0152_duplicate_lang_items`)
1313

1414
error: aborting due to 1 previous error
1515

Diff for: tests/ui/duplicate-label-E0381-issue-129274.rs renamed to tests/ui/error-codes/E0381-duplicated-label.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Regression test for duplicated label in E0381 error message.
2+
//!
3+
//! Issue: <https://github.com/rust-lang/rust/issues/129274>
14
fn main() {
25
fn test() {
36
loop {

Diff for: tests/ui/duplicate-label-E0381-issue-129274.stderr renamed to tests/ui/error-codes/E0381-duplicated-label.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0381]: used binding `blah` is possibly-uninitialized
2-
--> $DIR/duplicate-label-E0381-issue-129274.rs:8:33
2+
--> $DIR/E0381-duplicated-label.rs:11:33
33
|
44
LL | let blah: Option<String>;
55
| ---- binding declared here but left uninitialized

0 commit comments

Comments
 (0)