Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 0 additions & 2 deletions src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2710,8 +2710,6 @@ ui/limits/issue-75158-64.rs
ui/link-native-libs/issue-109144.rs
ui/link-native-libs/issue-43925.rs
ui/link-native-libs/issue-43926.rs
ui/link-native-libs/issue-70093/issue-70093-link-directives.rs
ui/link-native-libs/issue-70093/issue-70093.rs
ui/linkage-attr/auxiliary/issue-12133-dylib.rs
ui/linkage-attr/auxiliary/issue-12133-dylib2.rs
ui/linkage-attr/auxiliary/issue-12133-rlib.rs
Expand Down
10 changes: 0 additions & 10 deletions tests/ui/link-native-libs/issue-70093/issue-70093.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
//@ compile-flags: -Zlink-directives=no
//@ ignore-windows - this will probably only work on unixish systems
//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling

Expand Down
20 changes: 20 additions & 0 deletions tests/ui/link-native-libs/issue-70093/link-native-libraries.rs
Copy link
Member

@jieyouxu jieyouxu Dec 31, 2024

Choose a reason for hiding this comment

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

Suggestion: could we slightly document what this test is actually checking?

I opened two tracking issues:

But the original issue #70093 is not very obvious in what this test is actually trying to check for. If it's not obvious to you either, then I guess throw in a FIXME(#134947, #134948) lol.

Copy link
Member Author

Choose a reason for hiding this comment

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

These tests were the first time I'd heard of link-directives and link-native-libraries but I think I get the intent. Let me see what I can write.

Copy link
Member

Choose a reason for hiding this comment

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

Same for me, which is how I found out they had no MCPs nor tracking issues, and -Zlink-directives I believe has zero documentation either.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tbh, I think they have a lot of overlap with each other. And also with using the -l compiler flag when used to override native libs (but that currently has a much more limited effect).

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//@ run-pass
//@ compile-flags: -Zlink-native-libraries=no -Cdefault-linker-libraries=yes
//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling

//@ revisions: other
//@[other] ignore-msvc

//@ revisions: msvc
// On Windows MSVC, default-linker-libraries=yes doesn't work because
// rustc drives the linker directly instead of going through another compiler.
// Therefore rustc would need to implement default-linker-libraries itself but doesn't.
// So instead we use -Clink-arg to directly set the required msvcrt.lib as a link arg.
//@[msvc] compile-flags: -Clink-arg=msvcrt.lib
//@[msvc] only-msvc

#[link(name = "some-random-non-existent-library", kind = "static")]
extern "C" {}

fn main() {}
Loading