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 10 pull requests #126979

Merged
merged 24 commits into from
Jun 26, 2024
Merged
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2a6a423
Change E0369 diagnostic give note information for foreign items.
surechen Jun 25, 2024
d9a3423
miri: make sure we can find link_section statics even for the local c…
RalfJung Jun 25, 2024
b6074ff
resolve: Tweak some naming around import ambiguities
petrochenkov Jun 25, 2024
6ba0a84
rewrite lto-empty to rmake
Oneirical Jun 25, 2024
fe2406b
rewrite invalid-so to rmake
Oneirical Jun 25, 2024
ee529b7
rewrite and rename issue-20626 to rmake
Oneirical Jun 25, 2024
6402909
delay bug in RPITIT refinement checking with resolution errors
lqd Jun 25, 2024
133e7b1
fix Drop items getting leaked in Filter::next_chunk
the8472 Jun 23, 2024
2be2d77
add comments explaining optimizations for Filter::next_chunk
the8472 Jun 24, 2024
0d7aef9
regression test for leaks in the the Filter::next_chunk implementation
the8472 Jun 25, 2024
275d922
Rename tcx to cx
compiler-errors Jun 21, 2024
efa48bf
Bump black, ruff and platformdirs
DianQK Jun 20, 2024
cf0251d
Fix a span in `parse_ty_bare_fn`.
nnethercote Jun 17, 2024
0addda6
Fix bad replacement for unsafe extern block suggestion
chenyukang Jun 26, 2024
dd6b046
Rollup merge of #126724 - nnethercote:fix-parse_ty_bare_fn-span, r=co…
matthiaskrgr Jun 26, 2024
dc22ffc
Rollup merge of #126812 - compiler-errors:tcx-cx, r=lcnr
matthiaskrgr Jun 26, 2024
cf22be1
Rollup merge of #126879 - the8472:next-chunk-filter-drop, r=cuviper
matthiaskrgr Jun 26, 2024
95332b8
Rollup merge of #126925 - surechen:fix_125631, r=compiler-errors
matthiaskrgr Jun 26, 2024
5c4ede8
Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors
matthiaskrgr Jun 26, 2024
8b3bbee
Rollup merge of #126954 - petrochenkov:globamb, r=compiler-errors
matthiaskrgr Jun 26, 2024
bf8da39
Rollup merge of #126964 - Oneirical:total-catestrophe, r=Kobzol
matthiaskrgr Jun 26, 2024
8c6c6a7
Rollup merge of #126968 - lqd:issue-126670, r=compiler-errors
matthiaskrgr Jun 26, 2024
ee07d90
Rollup merge of #126971 - DianQK:bump, r=Kobzol
matthiaskrgr Jun 26, 2024
b272086
Rollup merge of #126973 - chenyukang:yukang-fix-126756-unsafe-suggest…
matthiaskrgr Jun 26, 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
12 changes: 2 additions & 10 deletions compiler/rustc_passes/src/reachable.rs
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::Node;
use rustc_middle::bug;
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::middle::privacy::{self, Level};
use rustc_middle::mir::interpret::{ConstAllocation, ErrorHandled, GlobalAlloc};
use rustc_middle::query::Providers;
@@ -178,15 +178,7 @@ impl<'tcx> ReachableContext<'tcx> {
if !self.any_library {
// If we are building an executable, only explicitly extern
// types need to be exported.
let codegen_attrs = if self.tcx.def_kind(search_item).has_codegen_attrs() {
self.tcx.codegen_fn_attrs(search_item)
} else {
CodegenFnAttrs::EMPTY
};
let is_extern = codegen_attrs.contains_extern_indicator();
let std_internal =
codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
if is_extern || std_internal {
if has_custom_linkage(self.tcx, search_item) {
self.reachable_symbols.insert(search_item);
}
} else {
16 changes: 16 additions & 0 deletions src/tools/miri/tests/pass/tls/win_tls_callback.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Ensure that we call Windows TLS callbacks in the local crate.
//@only-target-windows
// Calling eprintln in the callback seems to (re-)initialize some thread-local storage
// and then leak the memory allocated for that. Let's just ignore these leaks,
// that's not what this test is about.
//@compile-flags: -Zmiri-ignore-leaks

#[link_section = ".CRT$XLB"]
#[used] // Miri only considers explicitly `#[used]` statics for `lookup_link_section`
pub static CALLBACK: unsafe extern "system" fn(*const (), u32, *const ()) = tls_callback;

unsafe extern "system" fn tls_callback(_h: *const (), _dw_reason: u32, _pv: *const ()) {
eprintln!("in tls_callback");
}

fn main() {}
1 change: 1 addition & 0 deletions src/tools/miri/tests/pass/tls/win_tls_callback.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
in tls_callback