Skip to content

Rollup of 10 pull requests #126374

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 31 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
80408e0
port symlinked-extern to rmake
Oneirical May 28, 2024
59acd23
port symlinked-rlib to rmake
Oneirical May 28, 2024
2ac5faa
port symlinked-libraries to rmake
Oneirical May 28, 2024
63bdcaa
add is_none_or
RalfJung Jun 12, 2024
4c208ac
use is_none_or in some places in the compiler
RalfJung Jun 12, 2024
ffe5439
Add test for walking order dependent opaque type behaviour
oli-obk Jun 12, 2024
6d93626
docs(rustc): Help users to check-cfg Cargo docs
epage Jun 12, 2024
4b809b9
Move MatchAgainstFreshVars to old solver
compiler-errors Jun 12, 2024
9232bd2
docs(rustc): Link unexpected_cfgs to the Cargo.toml docs
epage Jun 12, 2024
e171e64
docs(rustc): De-emphasize --cfg/--check-cfg note
epage Jun 12, 2024
52b2c88
Walk into alias-eq nested goals even if normalization fails
compiler-errors May 28, 2024
b0c1474
better error message for normalizes-to ambiguities
compiler-errors Jun 4, 2024
44040a0
Also passthrough for projection clauses
compiler-errors Jun 4, 2024
46391b7
Make `try_from_target_usize` method public
artemagvanian Jun 12, 2024
c453c82
Harmonize use of leaf and root obligation in trait error reporting
compiler-errors Jun 8, 2024
93d83c8
Bless and add ICE regression test
compiler-errors Jun 8, 2024
f8d12d9
Stop passing both trait pred and trait ref
compiler-errors Jun 7, 2024
2c0348a
Stop passing traitref/traitpredicate by ref
compiler-errors Jun 7, 2024
d1fa19c
Add urls to rust lang reference
sancho20021 Jun 12, 2024
ae24ebe
Rebase fallout
compiler-errors Jun 13, 2024
fb662f2
safe transmute: support `Variants::Single` enums
jswrenn Jun 12, 2024
1a6b1a1
Rollup merge of #125674 - Oneirical:another-day-another-test, r=jieyouxu
workingjubilee Jun 13, 2024
8719cc2
Rollup merge of #125688 - compiler-errors:alias-reporting, r=lcnr
workingjubilee Jun 13, 2024
25c55c5
Rollup merge of #126142 - compiler-errors:trait-ref-split, r=jackh726
workingjubilee Jun 13, 2024
573ad2b
Rollup merge of #126303 - sancho20021:patch-1, r=compiler-errors
workingjubilee Jun 13, 2024
f5af7ee
Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubilee
workingjubilee Jun 13, 2024
100588f
Rollup merge of #126337 - oli-obk:nested_gat_opaque, r=lcnr
workingjubilee Jun 13, 2024
f6cc226
Rollup merge of #126353 - compiler-errors:move-match, r=lcnr
workingjubilee Jun 13, 2024
9d946a3
Rollup merge of #126356 - epage:check-cfg, r=Urgau
workingjubilee Jun 13, 2024
d33ec8e
Rollup merge of #126358 - jswrenn:fix-125811, r=compiler-errors
workingjubilee Jun 13, 2024
3b10998
Rollup merge of #126362 - artemagvanian:patch-1, r=celinval
workingjubilee Jun 13, 2024
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
28 changes: 28 additions & 0 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,34 @@ pub fn source_root() -> PathBuf {
env_var("SOURCE_ROOT").into()
}

/// Creates a new symlink to a path on the filesystem, adjusting for Windows or Unix.
#[cfg(target_family = "windows")]
pub fn create_symlink<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) {
if link.as_ref().exists() {
std::fs::remove_dir(link.as_ref()).unwrap();
}
use std::os::windows::fs;
fs::symlink_file(original.as_ref(), link.as_ref()).expect(&format!(
"failed to create symlink {:?} for {:?}",
link.as_ref().display(),
original.as_ref().display(),
));
}

/// Creates a new symlink to a path on the filesystem, adjusting for Windows or Unix.
#[cfg(target_family = "unix")]
pub fn create_symlink<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) {
if link.as_ref().exists() {
std::fs::remove_dir(link.as_ref()).unwrap();
}
use std::os::unix::fs;
fs::symlink(original.as_ref(), link.as_ref()).expect(&format!(
"failed to create symlink {:?} for {:?}",
link.as_ref().display(),
original.as_ref().display(),
));
}

/// Construct the static library name based on the platform.
pub fn static_lib_name(name: &str) -> String {
// See tools.mk (irrelevant lines omitted):
Expand Down
3 changes: 0 additions & 3 deletions src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ run-make/std-core-cycle/Makefile
run-make/symbol-mangling-hashed/Makefile
run-make/symbol-visibility/Makefile
run-make/symbols-include-type-name/Makefile
run-make/symlinked-extern/Makefile
run-make/symlinked-libraries/Makefile
run-make/symlinked-rlib/Makefile
run-make/sysroot-crates-are-unstable/Makefile
run-make/target-cpu-native/Makefile
run-make/target-specs/Makefile
Expand Down
12 changes: 0 additions & 12 deletions tests/run-make/symlinked-extern/Makefile

This file was deleted.

21 changes: 21 additions & 0 deletions tests/run-make/symlinked-extern/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Crates that are resolved normally have their path canonicalized and all
// symlinks resolved. This did not happen for paths specified
// using the --extern option to rustc, which could lead to rustc thinking
// that it encountered two different versions of a crate, when it's
// actually the same version found through different paths.
// See https://github.com/rust-lang/rust/pull/16505

// This test checks that --extern and symlinks together
// can result in successful compilation.

//@ ignore-cross-compile

use run_make_support::{create_symlink, cwd, fs_wrapper, rustc};

fn main() {
rustc().input("foo.rs").run();
fs_wrapper::create_dir_all("other");
create_symlink("libfoo.rlib", "other");
rustc().input("bar.rs").library_search_path(cwd()).run();
rustc().input("baz.rs").extern_("foo", "other").library_search_path(cwd()).run();
}
11 changes: 0 additions & 11 deletions tests/run-make/symlinked-libraries/Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions tests/run-make/symlinked-libraries/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// When a directory and a symlink simultaneously exist with the same name,
// setting that name as the library search path should not cause rustc
// to avoid looking in the symlink and cause an error. This test creates
// a directory and a symlink named "other", and places the library in the symlink.
// If it succeeds, the library was successfully found.
// See https://github.com/rust-lang/rust/issues/12459

//@ ignore-cross-compile
use run_make_support::{create_symlink, dynamic_lib_name, fs_wrapper, rustc};

fn main() {
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
fs_wrapper::create_dir_all("other");
create_symlink(dynamic_lib_name("foo"), "other");
rustc().input("bar.rs").library_search_path("other").run();
}
10 changes: 0 additions & 10 deletions tests/run-make/symlinked-rlib/Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions tests/run-make/symlinked-rlib/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Rustc did not recognize libraries which were symlinked
// to files having extension other than .rlib. This was fixed
// in #32828. This test creates a symlink to "foo.xxx", which has
// an unusual file extension, and checks that rustc can successfully
// use it as an rlib library.
// See https://github.com/rust-lang/rust/pull/32828

//@ ignore-cross-compile

use run_make_support::{create_symlink, cwd, rustc};

fn main() {
rustc().input("foo.rs").crate_type("rlib").output("foo.xxx").run();
create_symlink("foo.xxx", "libfoo.rlib");
rustc().input("bar.rs").library_search_path(cwd()).run();
}