Skip to content
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

Rollup of 7 pull requests #125120

Merged
merged 21 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f2de5fb
rewrite issue-14500 to rmake
Oneirical May 12, 2024
a1b5ea0
make tidy happy
Oneirical May 12, 2024
71fd2cf
fix function call and import
Oneirical May 12, 2024
2e4c90c
Don't do post-method-probe error reporting steps if we're in a sugges…
compiler-errors May 14, 2024
1ad28a6
Uplift AliasTy
compiler-errors May 13, 2024
9f8cdb2
Remove to_term
compiler-errors May 13, 2024
45b50d3
lto function, static_library call, rename
Oneirical May 14, 2024
8f97a25
Add test to make sure suggestions are still quick
compiler-errors May 14, 2024
dbd2ca6
Use a proper probe for shadowing impl
compiler-errors May 7, 2024
57c32a1
style-guide: When breaking binops handle multi-line first operand better
joshtriplett Jan 11, 2024
e2d9c0d
Fix missing word
joshtriplett Jan 20, 2024
e098eb1
Wording improvement
joshtriplett Jan 20, 2024
f97d915
Use new utility functions/methods in run-make tests
GuillaumeGomez May 14, 2024
ade33b0
only find segs chain for missing methods when no available candidates
bvanjoi May 13, 2024
3628783
Rollup merge of #119838 - joshtriplett:style-guide-binop-indent, r=co…
compiler-errors May 14, 2024
0458d8a
Rollup merge of #124844 - compiler-errors:shadow-probe, r=lcnr
compiler-errors May 14, 2024
844c7e8
Rollup merge of #125047 - Oneirical:test5, r=jieyouxu
compiler-errors May 14, 2024
8c64acd
Rollup merge of #125080 - bvanjoi:fix-124946, r=nnethercote
compiler-errors May 14, 2024
712e7c3
Rollup merge of #125088 - compiler-errors:uplift-alias-ty, r=lcnr
compiler-errors May 14, 2024
d59f430
Rollup merge of #125100 - compiler-errors:faster, r=nnethercote
compiler-errors May 14, 2024
31016d5
Rollup merge of #125118 - GuillaumeGomez:cleanup-run-make, r=jieyouxu
compiler-errors May 14, 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
13 changes: 13 additions & 0 deletions src/tools/run-make-support/src/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@ impl Rustc {
self
}

/// Enables link time optimizations in rustc. Equivalent to `-Clto``.
pub fn lto(&mut self) -> &mut Self {
self.cmd.arg("-Clto");
self
}

/// Add a directory to the library search path.
pub fn library_search_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
self.cmd.arg("-L");
self.cmd.arg(path.as_ref());
self
}

/// Specify the edition year.
pub fn edition(&mut self, edition: &str) -> &mut Self {
self.cmd.arg("--edition");
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ run-make/issue-107094/Makefile
run-make/issue-10971-temps-dir/Makefile
run-make/issue-109934-lto-debuginfo/Makefile
run-make/issue-11908/Makefile
run-make/issue-14500/Makefile
run-make/issue-14698/Makefile
run-make/issue-15460/Makefile
run-make/issue-18943/Makefile
Expand Down
15 changes: 0 additions & 15 deletions tests/run-make/issue-14500/Makefile

This file was deleted.

26 changes: 26 additions & 0 deletions tests/run-make/reachable-extern-fn-available-lto/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Test to make sure that reachable extern fns are always available in final
// productcs, including when link time optimizations (LTO) are used.

// In this test, the `foo` crate has a reahable symbol,
// and is a dependency of the `bar` crate. When the `bar` crate
// is compiled with LTO, it shouldn't strip the symbol from `foo`, and that's the
// only way that `foo.c` will successfully compile.
// See https://github.com/rust-lang/rust/issues/14500

//@ ignore-cross-compile

use run_make_support::{cc, extra_c_flags, run, rustc, static_lib, tmp_dir};

fn main() {
let libbar_path = static_lib("bar");
rustc().input("foo.rs").crate_type("rlib").run();
rustc()
.input("bar.rs")
.crate_type("staticlib")
.lto()
.library_search_path(".")
.output(&libbar_path)
.run();
cc().input("foo.c").input(libbar_path).args(&extra_c_flags()).out_exe("foo").run();
run("foo");
}