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 6 pull requests #93834

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f4799b8
debuginfo: Make some helper functions in rustc_codegen_llvm::debuginf…
michaelwoerister Jan 25, 2022
fc7f419
debuginfo: Bring back DW_AT_containing_type for vtables after it has …
michaelwoerister Jan 25, 2022
03733ca
`#[used(linker)]` attribute (https://github.com/dtolnay/linkme/issues…
cynecx Nov 22, 2021
e075586
add tests and fix comments
cynecx Feb 7, 2022
475e4ee
Remove obsolete no-op #[main] attribute from compiler.
jeremyBanks Feb 7, 2022
ed21805
debuginfo: Bring back DW_AT_containing_type for vtables -- address re…
michaelwoerister Feb 8, 2022
7806454
rustdoc: fix spacing of non-toggled impl blocks
jsha Feb 8, 2022
438826f
add more tests and make used(linker/compiler) mutually exclusive
cynecx Feb 8, 2022
933963e
Add tracking issue
nikic Feb 9, 2022
1705933
Move tests into attributes directory to pacify tidy
nikic Feb 9, 2022
3d3318b
Fix typo in `std::fmt` docs
wooorm Feb 9, 2022
f43e3a8
Allow substitutions in `rustc_on_unimplemented` predicate
compiler-errors Dec 2, 2021
fea0015
Suggest collecting into `Vec<_>` when collecting into `[_]`
compiler-errors Dec 2, 2021
ba6b5df
Rollup merge of #91443 - compiler-errors:bad_collect_into_slice, r=we…
matthiaskrgr Feb 9, 2022
93da8ca
Rollup merge of #91504 - cynecx:used_retain, r=nikic
matthiaskrgr Feb 9, 2022
f437190
Rollup merge of #93503 - michaelwoerister:fix-vtable-holder-debuginfo…
matthiaskrgr Feb 9, 2022
a0cdc78
Rollup merge of #93753 - jeremyBanks:main-conflict, r=petrochenkov
matthiaskrgr Feb 9, 2022
2184cf7
Rollup merge of #93763 - jsha:re-space-empty-impls, r=GuillaumeGomez
matthiaskrgr Feb 9, 2022
07d0299
Rollup merge of #93799 - wooorm:patch-1, r=dtolnay
matthiaskrgr Feb 9, 2022
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: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl<'gcc, 'tcx> StaticMethods for CodegenCx<'gcc, 'tcx> {
// TODO(antoyo): set link section.
}

if attrs.flags.contains(CodegenFnAttrFlags::USED) {
if attrs.flags.contains(CodegenFnAttrFlags::USED) || attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER) {
self.add_used_global(global.to_rvalue());
}
}
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_codegen_llvm/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ impl<'ll> StaticMethods for CodegenCx<'ll, '_> {
}

if attrs.flags.contains(CodegenFnAttrFlags::USED) {
// `USED` and `USED_LINKER` can't be used together.
assert!(!attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER));

// The semantics of #[used] in Rust only require the symbol to make it into the
// object file. It is explicitly allowed for the linker to strip the symbol if it
// is dead. As such, use llvm.compiler.used instead of llvm.used.
Expand All @@ -530,6 +533,12 @@ impl<'ll> StaticMethods for CodegenCx<'ll, '_> {
// in some versions of the gold linker.
self.add_compiler_used_global(g);
}
if attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER) {
// `USED` and `USED_LINKER` can't be used together.
assert!(!attrs.flags.contains(CodegenFnAttrFlags::USED));

self.add_used_global(g);
}
}
}

Expand Down
Loading