Skip to content

Move some tests out of tests/ui #140551

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 1 commit into from
May 4, 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
10 changes: 0 additions & 10 deletions src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,7 @@ ui/auto-traits/issue-23080-2.rs
ui/auto-traits/issue-23080.rs
ui/auto-traits/issue-83857-ub.rs
ui/auto-traits/issue-84075.rs
ui/auxiliary/issue-13560-1.rs
ui/auxiliary/issue-13560-2.rs
ui/auxiliary/issue-13560-3.rs
ui/auxiliary/issue-16822.rs
ui/auxiliary/issue-18502.rs
ui/auxiliary/issue-24106.rs
ui/auxiliary/issue-76387.rs
ui/bench/issue-32062.rs
ui/binding/issue-40402-1.rs
ui/binding/issue-40402-2.rs
Expand Down Expand Up @@ -1378,12 +1372,8 @@ ui/intrinsics/issue-28575.rs
ui/intrinsics/issue-84297-reifying-copy.rs
ui/invalid/issue-114435-layout-type-err.rs
ui/issue-11881.rs
ui/issue-13560.rs
ui/issue-15924.rs
ui/issue-16822.rs
ui/issue-18502.rs
ui/issue-24106.rs
ui/issue-76387-llvm-miscompile.rs
ui/issues-71798.rs
ui/issues/auxiliary/issue-11224.rs
ui/issues/auxiliary/issue-11508.rs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
//@ no-prefer-dynamic

#![crate_type = "dylib"]
6 changes: 6 additions & 0 deletions tests/ui/attributes/no_link/auxiliary/no_link-crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//@ no-prefer-dynamic

#![crate_type = "rlib"]

#[macro_use] #[no_link] extern crate empty_crate_1 as t1;
#[macro_use] extern crate empty_crate_2 as t2;
17 changes: 17 additions & 0 deletions tests/ui/attributes/no_link/multiple-crates-and-no_link.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//! Regression test for #13560. Previously, it was possible to
//! trigger an assert in crate numbering if a series of crates
//! being loaded included a "syntax-only" extern crate.
//! But it appears we don't mess with crate numbering for
//! `#[no_link]` crates anymore, so this test doesn't seem
//! to test anything now.
Comment on lines +4 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: I think we'll leave this as an exercise to the person modifying #[no_link]-the-attribute...

Copy link
Contributor Author

@mejrs mejrs May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not rub it in ;)


//@ run-pass
//@ needs-crate-type: dylib
//@ aux-build:empty-crate-1.rs
//@ aux-build:empty-crate-2.rs
//@ aux-build:no_link-crate.rs

extern crate empty_crate_2 as t2;
extern crate no_link_crate as t3;

fn main() {}
19 changes: 19 additions & 0 deletions tests/ui/attributes/no_link/no-link-unknown-crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Unfortunately the development of `#[phase]` and `#[no_link]`
//! predates Zulip, and thus has been lost in the sands of time.
//! Understanding the true nature of this test has been left as
//! an exercise for the reader.
//!
//! But we guess from the git history that originally this
//! test was supposed to check that we error if we can't find
//! an extern crate annotated with `#[phase(syntax)]`,
//! see `macro-crate-unknown-crate.rs` in
//! <https://github.com/rust-lang/rust/pull/11151>. Later, we changed
//! `#[phase]` to `#![feature(plugin)]` and added a `#[no_link]`.
//!
//! I suppose that this now tests that we still error if we can't
//! find a `#[no_link]` extern crate?

#[no_link]
extern crate doesnt_exist; //~ ERROR can't find crate

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0463]: can't find crate for `doesnt_exist`
--> $DIR/no-link-unknown-crate.rs:2:1
--> $DIR/no-link-unknown-crate.rs:17:1
|
LL | extern crate doesnt_exist;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
Expand Down
51 changes: 0 additions & 51 deletions tests/ui/auxiliary/inner_static.rs

This file was deleted.

6 changes: 0 additions & 6 deletions tests/ui/auxiliary/issue-13560-3.rs

This file was deleted.

12 changes: 12 additions & 0 deletions tests/ui/cross-crate/inline-cross-crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Dpn't ice on using an inlined function from another crate
//! See <https://github.com/rust-lang/rust/issues/18502> and
//! <https://github.com/rust-lang/rust/issues/18501>

//@ run-pass
//@ aux-build:inline-cross-crate.rs

extern crate inline_cross_crate as fmt;

fn main() {
::fmt::baz();
}
22 changes: 22 additions & 0 deletions tests/ui/cross-crate/llvm-miscompile-MarkValue-MaybeLive.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/76387>
//! Tests that LLVM doesn't miscompile this
//! See upstream fix: <https://reviews.llvm.org/D88529>.

//@ compile-flags: -C opt-level=3
//@ aux-build: llvm-miscompile-MarkValue-MaybeLive.rs
//@ run-pass

extern crate llvm_miscompile_MarkValue_MaybeLive;

use llvm_miscompile_MarkValue_MaybeLive::FatPtr;

fn print(data: &[u8]) {
println!("{:#?}", data);
}

fn main() {
let ptr = FatPtr::new(20);
let data = unsafe { std::slice::from_raw_parts(ptr.as_ptr(), ptr.len()) };

print(data);
}
10 changes: 0 additions & 10 deletions tests/ui/impl-privacy-xc-1.rs

This file was deleted.

14 changes: 0 additions & 14 deletions tests/ui/inner-static.rs

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/issue-13560.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/issue-18502.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/issue-24106.rs

This file was deleted.

21 changes: 0 additions & 21 deletions tests/ui/issue-76387-llvm-miscompile.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! The non_fmt_panics lint detects panic!(..) invocations where
//! the first argument is not a formatting string.
//!
//! Also, this test checks that this is not emitted if it originates
//! in an external macro.

//@ run-rustfix
//@ rustfix-only-machine-applicable
//@ build-pass (FIXME(62277): should be check-pass)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! The non_fmt_panics lint detects panic!(..) invocations where
//! the first argument is not a formatting string.
//!
//! Also, this test checks that this is not emitted if it originates
//! in an external macro.

//@ run-rustfix
//@ rustfix-only-machine-applicable
//@ build-pass (FIXME(62277): should be check-pass)
Expand Down
Loading
Loading