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 #126669

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
012a458
Suggest removing unused tuple fields if they are the last fields
May 13, 2024
55fc6bd
Ban `ArrayToPointer` and `MutToConstPointer` from runtime MIR
scottmcm Jun 12, 2024
64bba35
`bug!` more uses of these in runtime stuff
scottmcm Jun 15, 2024
af10880
Make async drop code more consistent with regular drop code
zetanumbers Jun 17, 2024
1a8eae1
Apply suggestions from oli-obk's review
zetanumbers Jun 18, 2024
de473a5
Test that opaque types can't have themselves as a hidden type with in…
oli-obk Apr 11, 2024
83cb760
run_make_support nm implementation + bin-emit-no-symbols rmake rewrite
Oneirical May 30, 2024
c1597f9
try implementing suggestions
Oneirical Jun 5, 2024
977d3f6
use llvm_readobj in run-make test instead of nm
Oneirical Jun 18, 2024
1299aef
Make pretty printing for `f16` and `f128` consistent
tgross35 Jun 19, 2024
2126c1d
rustc_type_ir: Omit some struct fields from Debug output
fmease Jun 19, 2024
f9c6e86
Rollup merge of #123782 - oli-obk:equal_tait_args, r=compiler-errors
fmease Jun 19, 2024
c9a8f61
Rollup merge of #124580 - gurry:124556-suggest-remove-tuple-field, r=…
fmease Jun 19, 2024
f875b94
Rollup merge of #125787 - Oneirical:infinite-test-a-novel, r=jieyouxu
fmease Jun 19, 2024
59888e8
Rollup merge of #126308 - scottmcm:ban-some-coercions, r=saethlin
fmease Jun 19, 2024
19f2634
Rollup merge of #126594 - zetanumbers:fix-cross-crate-async-drop-glue…
fmease Jun 19, 2024
8571dcd
Rollup merge of #126654 - tgross35:f16-f128-pretty-print, r=jackh726
fmease Jun 19, 2024
903bc4e
Rollup merge of #126656 - fmease:skip-debug-for-_, r=compiler-errors
fmease Jun 19, 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
Prev Previous commit
Next Next commit
run_make_support nm implementation + bin-emit-no-symbols rmake rewrite
Oneirical committed Jun 18, 2024
commit 83cb760e2c2b9fa3f0bb90ad2941f4cbceba2255
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 149 files
2 changes: 1 addition & 1 deletion src/doc/reference
Submodule reference updated 1 files
+1 −3 src/items/unions.md
2 changes: 1 addition & 1 deletion src/doc/rust-by-example
2 changes: 1 addition & 1 deletion src/tools/cargo
Submodule cargo updated 285 files
48 changes: 48 additions & 0 deletions src/tools/run-make-support/src/nm/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
use crate::{fs_wrapper, object};
use object::{Object, ObjectSection};
use std::path::Path;

#[derive(Debug)]
pub struct Nm {
file: Option<object::File>,
}

pub fn nm() -> Nm {
Nm::new()
}

impl Nm {
/// Construct a bare `nm` invocation.
pub fn new() -> Self {
Self { file: None }
}

/// Specify the file to analyze the symbols of.
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
&mut Self {
file: Some(
object::File::parse(fs_wrapper::read(path))
.expect(format!("Failed to parse ELF file at {:?}", path.as_ref().display())),
),
}
}

/// Collect all symbols of an object file into a String.
pub fn collect_symbols(&self) -> String {
let object_file = self.file;
let mut symbols_str = String::new();
for section in object_file.sections() {
if let Ok(ObjectSection::SymbolTable(st)) = section.parse::<object::SymbolTable>() {
for symbol in st.symbols() {
symbols_str.push_str(&format!(
"{:016x} {:?} {}\n",
symbol.address(),
symbol.kind(),
symbol.name()
));
}
}
}
symbols_str
}
}
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
@@ -84,7 +84,6 @@ run-make/issue-37839/Makefile
run-make/issue-40535/Makefile
run-make/issue-47384/Makefile
run-make/issue-47551/Makefile
run-make/issue-51671/Makefile
run-make/issue-68794-textrel-on-minimal-lib/Makefile
run-make/issue-69368/Makefile
run-make/issue-83045/Makefile
File renamed without changes.
19 changes: 19 additions & 0 deletions tests/run-make/bin-emit-no-symbols/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// When setting the crate type as a "bin" (in app.rs),
// this could cause a bug where some symbols would not be
// emitted in the object files. This has been fixed, and
// this test checks that the correct symbols have been successfully
// emitted inside the object files.
// See https://github.com/rust-lang/rust/issues/51671

use run_make_support::{nm, rustc, tmp_dir};

fn main() {
rustc().emit("obj").input("app.rs").run();
//FIXME(Oneirical): This should eventually be rmake_out_path
let nm = nm(tmp_dir().join("app.o"));
assert!(
nm.contains("rust_begin_unwind")
&& nm.contains("rust_eh_personality")
&& nm.contains("__rg_oom")
);
}
9 changes: 0 additions & 9 deletions tests/run-make/issue-51671/Makefile

This file was deleted.