Support defaults for static EIIs#156583
Conversation
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
LGTM, but I’ll defer to @JonathanBrouwer in case I’ve missed anything.
r? JonathanBrouwer
|
|
|
I'm currently on holidays but would like to take a look, might take me a few days to get around to it |
81c9617 to
d7f16d7
Compare
There was a problem hiding this comment.
@bors r+ rollup
Looks good, thanks!
Wanted to implement this immediately after my PR that implemented static EIIs but forgot :3
|
@bors r=JonathanBrouwer,mu001999 |
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
|
This pull request was unapproved. This PR was contained in a rollup (#156679), which was unapproved. |
|
After some investigation, I think this is hitting an LLVM issue: llvm/llvm-project#111321 For @_RNvNvCshLcOpHkWMCm_17decl_with_default1__5DECL1 =
constant [8 x i8] c"\05\00\00\00\00\00\00\00", align 8
@_RNvCshLcOpHkWMCm_17decl_with_default5DECL1 =
linkonce alias i64, ptr @_RNvNvCshLcOpHkWMCm_17decl_with_default1__5DECL1The second symbol is the EII foreign item symbol. In the generated Mach-O object it becomes non-external: Then, when the aux crate is built as a dylib, ld64 fails because the linker’s initial-undefines list requires the EII symbol to be externally resolvable: I also checked whether What should I do here?
|
|
(I'm at Rustweek this week, I'll take a look at this next week) |
I'd avoid refactoring to avoid weak aliases, as that would require a lot of code changes and might work less well dynamically linked libraries. (sorry for the late reply, have been very busy and then a bit ill) |
|
Reminder, once the PR becomes ready for a review, use |
Some update from my side: I actually tried patching LLVM locally a few days ago, and with that patch the Rust tests here passed on macOS. When I was about to open an LLVM PR, I found that this collided with llvm/llvm-project#198148. The approach there is basically the same as mine, so I did not open a competing PR. I have not tested that exact patch yet, though. I am not sure how long the full path usually takes: LLVM review/merge, possible backport, updating https://github.com/rust-lang/llvm-project, then updating the LLVM submodule here. If that goes smoothly, waiting for the upstream LLVM fix would be fine, but I would guess it will not be immediate.
So I agree with this approach to work around this on the Rust side for now. One question about the diagnostic: should it point users somewhere? Maybe the tracking issue? |
Very impressive, good job! Indeed waiting on that to land sounds like the best option then.
I'd say create a new issue (linked to the tracking issue) for this. Give this issue the |
d7f16d7 to
26766eb
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
26766eb to
80d5676
Compare
|
@rustbot ready |
80d5676 to
cdb6acc
Compare
|
@bors r=JonathanBrouwer,mu001999 |
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
Rollup of 23 pull requests Successful merges: - #157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty) - #157282 (Fix post-monomorphization error note race in the parallel frontend) - #157352 (Make the retained dep graph deterministic under the parallel frontend) - #157601 (Emit error for unused target expression in glob and list delegations) - #157611 (Update `browser-ui-test` version to `0.24.0`) - #157620 (Add a strategy FnMut to inject behavior into the flush cycle) - #157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded) - #157647 (Start using comptime for reflection intrinsics and their wrapper functions) - #157719 (resolve: Partially revert "Remove a special case for dummy imports") - #156497 (fix-155516: Don't suggest wrong unwrap expect) - #156583 (Support defaults for static EIIs) - #157013 (Ensure inferred let pattern types are well-formed) - #157230 (borrowck: avoid ICE describing fields on generic params) - #157288 (platform support: add SNaN erratum to MIPS targets) - #157350 (compiletest: ignore SVG `y` offset in by-lines comparison) - #157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs) - #157384 (Add `#[rustc_dump_generics]` attribute) - #157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`) - #157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N)) - #157691 (Move symbol hiding code to a new file) - #157697 (Add more tests that exercise the well-formedness checking of lazy type aliases) - #157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N)) - #157703 (Fix doc link to Instant sub in saturating caveat) Failed merges: - #157699 (Arg splat experiment - hir FnDecl impl)
Rollup of 23 pull requests Successful merges: - #157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty) - #157282 (Fix post-monomorphization error note race in the parallel frontend) - #157352 (Make the retained dep graph deterministic under the parallel frontend) - #157601 (Emit error for unused target expression in glob and list delegations) - #157611 (Update `browser-ui-test` version to `0.24.0`) - #157620 (Add a strategy FnMut to inject behavior into the flush cycle) - #157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded) - #157647 (Start using comptime for reflection intrinsics and their wrapper functions) - #157719 (resolve: Partially revert "Remove a special case for dummy imports") - #156497 (fix-155516: Don't suggest wrong unwrap expect) - #156583 (Support defaults for static EIIs) - #157013 (Ensure inferred let pattern types are well-formed) - #157230 (borrowck: avoid ICE describing fields on generic params) - #157288 (platform support: add SNaN erratum to MIPS targets) - #157350 (compiletest: ignore SVG `y` offset in by-lines comparison) - #157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs) - #157384 (Add `#[rustc_dump_generics]` attribute) - #157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`) - #157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N)) - #157691 (Move symbol hiding code to a new file) - #157697 (Add more tests that exercise the well-formedness checking of lazy type aliases) - #157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N)) - #157703 (Fix doc link to Instant sub in saturating caveat) Failed merges: - #157699 (Arg splat experiment - hir FnDecl impl)
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
…JonathanBrouwer,mu001999 Support defaults for static EIIs Tracking issue: rust-lang#125418 rust-lang#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it. Maybe I should remove `no-prefer-dynamic` if rust-lang#156577 is accepted.
Rollup of 31 pull requests Successful merges: - #141030 (Expand free alias types during variance computation) - #154853 (mgca: Register `ConstArgHasType` when normalizing projection consts) - #155527 (Replace printables table with `unicode_data.rs` tables) - #156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`) - #157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty) - #157282 (Fix post-monomorphization error note race in the parallel frontend) - #157352 (Make the retained dep graph deterministic under the parallel frontend) - #157601 (Emit error for unused target expression in glob and list delegations) - #157611 (Update `browser-ui-test` version to `0.24.0`) - #157620 (Add a strategy FnMut to inject behavior into the flush cycle) - #157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded) - #157646 (Keep rename-imported main alive in dead-code analysis under `--test`) - #157647 (Start using comptime for reflection intrinsics and their wrapper functions) - #157719 (resolve: Partially revert "Remove a special case for dummy imports") - #155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os}) - #155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args) - #155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`) - #156497 (fix-155516: Don't suggest wrong unwrap expect) - #156583 (Support defaults for static EIIs) - #157013 (Ensure inferred let pattern types are well-formed) - #157196 (Only suggest reborrowing a moved value where the reborrow is valid) - #157230 (borrowck: avoid ICE describing fields on generic params) - #157288 (platform support: add SNaN erratum to MIPS targets) - #157330 (remove `IsTypeConst` from `hir::TraitItemKind`) - #157350 (compiletest: ignore SVG `y` offset in by-lines comparison) - #157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs) - #157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`) - #157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N)) - #157691 (Move symbol hiding code to a new file) - #157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N)) - #157703 (Fix doc link to Instant sub in saturating caveat) Failed merges: - #157699 (Arg splat experiment - hir FnDecl impl)
View all comments
Tracking issue: #125418
#154193 added EII support for statics, but left default implementations for "a followup PR". This PR implements it.
Maybe I should remove
no-prefer-dynamicif #156577 is accepted.