-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Rollup of 11 pull requests #151997
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
Closed
Closed
Rollup of 11 pull requests #151997
+516
−230
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Makes the use expressions significantly shorter.
So that `pub-priv1.rs` test does not have to (ab)use the `aux-crate` directive for this purpose. This is very edge-casey so I don't think we should document this in rustc-dev-guide. If someone needs to do this they will look at the code and easily find the functionality. This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.
…ed uptream c static libraries
It doesn't use `self`, which means it doesn't need to be part of the `QueryContext` trait; we can just call `extract` directly where necessary.
Various `QueryStackFrame` variables are called `query`; `frame` is a better name. And various `QueryInfo` variables are called `frame`; `info` is a better name. This eliminates some confusing `query.query()` occurrences, which is a good sign, and some `frame.query` occurrences become `info.frame`.
Putting `+ 'tcx` on the `QueryDispatcher` trait lets a few other places be simplified.
It's defined and used in `rustc_query_impl`; `rustc_query_system` doesn't need it. So it can just be an inherent method on `QueryCtxt`.
The term of "discard" is misleading. An error is not discarded but converted to an `Option::None`.
Export globals via a `doc(hidden)` module. In test code, use the globals from `realstd` so that they are properly initialized.
Co-authored-by: lcnr <[email protected]>
…jorn3,petrochenkov link modifier `export-symbols`: export all global symbols from selected uptream c static libraries In order to be able to export symbols from a specified upstream C static library, I redesigned a solution that, compared to a previous PR rust-lang#150335 I submitted, will not have any extra symbols leaking out. The following points should be noted: - This attribute will select and import the `Global` symbols of the first matching library it finds. - Developers should ensure that there are no libraries with the same name. - This modifier is only compatible with `static` linking kind - By default, upstream C static libraries will not export their `Global` symbols regardless of whether `LTO` optimization is enabled. However, after enabling this attribute, if the upstream C static library has `LTO` optimization enabled, the compiler will issue an error to inform the developer that the linked C library is invalid. The test code is the same as the PR rust-lang#150335. Here are the results: 1. `cargo +include-libs rustc --release -- -L. -lstatic:+export-symbols=c_add` (or you can use `#[link(name = "c_add", kind= "static", modifier = "+export-symbols")]` in the file) ```bash U abort@GLIBC_2.2.5 U bcmp@GLIBC_2.2.5 0000000000014f60 T c_add U calloc@GLIBC_2.2.5 U close@GLIBC_2.2.5 0000000000014f70 T c_sub w __cxa_finalize@GLIBC_2.2.5 w __cxa_thread_atexit_impl@GLIBC_2.18 U dl_iterate_phdr@GLIBC_2.2.5 0000000000014ee0 T downstream_add U __errno_location@GLIBC_2.2.5 U free@GLIBC_2.2.5 U fstat64@GLIBC_2.33 U getcwd@GLIBC_2.2.5 U getenv@GLIBC_2.2.5 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable U lseek64@GLIBC_2.2.5 U malloc@GLIBC_2.2.5 U memcpy@GLIBC_2.14 U memmove@GLIBC_2.2.5 U memset@GLIBC_2.2.5 U mmap64@GLIBC_2.2.5 U munmap@GLIBC_2.2.5 U open64@GLIBC_2.2.5 U posix_memalign@GLIBC_2.2.5 U pthread_key_create@GLIBC_2.34 U pthread_key_delete@GLIBC_2.34 U pthread_setspecific@GLIBC_2.34 U read@GLIBC_2.2.5 U readlink@GLIBC_2.2.5 U realloc@GLIBC_2.2.5 U realpath@GLIBC_2.3 U stat64@GLIBC_2.33 w statx@GLIBC_2.28 U strlen@GLIBC_2.2.5 U syscall@GLIBC_2.2.5 U __tls_get_addr@GLIBC_2.3 U _Unwind_Backtrace@GCC_3.3 U _Unwind_DeleteException@GCC_3.0 U _Unwind_GetDataRelBase@GCC_3.0 U _Unwind_GetIP@GCC_3.0 U _Unwind_GetIPInfo@GCC_4.2.0 U _Unwind_GetLanguageSpecificData@GCC_3.0 U _Unwind_GetRegionStart@GCC_3.0 U _Unwind_GetTextRelBase@GCC_3.0 U _Unwind_RaiseException@GCC_3.0 U _Unwind_Resume@GCC_3.0 U _Unwind_SetGR@GCC_3.0 U _Unwind_SetIP@GCC_3.0 U write@GLIBC_2.2.5 U writev@GLIBC_2.2.5 ``` 3. `cargo +nightly rustc --release -- -L ./` ```bash U abort@GLIBC_2.2.5 U bcmp@GLIBC_2.2.5 U calloc@GLIBC_2.2.5 U close@GLIBC_2.2.5 w __cxa_finalize@GLIBC_2.2.5 w __cxa_thread_atexit_impl@GLIBC_2.18 U dl_iterate_phdr@GLIBC_2.2.5 0000000000011e10 T downstream_add U __errno_location@GLIBC_2.2.5 U free@GLIBC_2.2.5 U fstat64@GLIBC_2.33 U getcwd@GLIBC_2.2.5 U getenv@GLIBC_2.2.5 w gettid@GLIBC_2.30 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable U lseek64@GLIBC_2.2.5 U malloc@GLIBC_2.2.5 U memcpy@GLIBC_2.14 U memmove@GLIBC_2.2.5 U memset@GLIBC_2.2.5 U mmap64@GLIBC_2.2.5 U munmap@GLIBC_2.2.5 U open64@GLIBC_2.2.5 U posix_memalign@GLIBC_2.2.5 U pthread_key_create@GLIBC_2.34 U pthread_key_delete@GLIBC_2.34 U pthread_setspecific@GLIBC_2.34 U read@GLIBC_2.2.5 U readlink@GLIBC_2.2.5 U realloc@GLIBC_2.2.5 U realpath@GLIBC_2.3 U stat64@GLIBC_2.33 w statx@GLIBC_2.28 U strlen@GLIBC_2.2.5 U syscall@GLIBC_2.2.5 U __tls_get_addr@GLIBC_2.3 U _Unwind_Backtrace@GCC_3.3 U _Unwind_GetDataRelBase@GCC_3.0 U _Unwind_GetIP@GCC_3.0 U _Unwind_GetIPInfo@GCC_4.2.0 U _Unwind_GetLanguageSpecificData@GCC_3.0 U _Unwind_GetRegionStart@GCC_3.0 U _Unwind_GetTextRelBase@GCC_3.0 U _Unwind_RaiseException@GCC_3.0 U _Unwind_Resume@GCC_3.0 U _Unwind_SetGR@GCC_3.0 U _Unwind_SetIP@GCC_3.0 U write@GLIBC_2.2.5 U writev@GLIBC_2.2.5 ``` r? @bjorn3
…thar compiletest: Support `--extern` modifiers with `proc-macro` directive So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose. This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality. This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted. r? @Zalathar --- Follow-up to: - rust-lang#151353 - rust-lang#151670 ### Unblocks: - rust-lang#151691, because without this fix that test fails (see rust-lang#151691 (comment))
…rcote Use `#![feature(adt_const_params)]` for static query flags As suggested by rust-lang#151633 (comment), this replaces multiple clunky const booleans with a single const struct, which is a bit nicer. This should also make it easier to experiment with statically resolving other flags, like `eval_always`. There are currently no other compiler crates using `feature(adt_const_params)`, so hopefully it's mature enough for a simple use-case like this one.
…ianne Use default field values in a few more cases Makes the use expressions significantly shorter.
… r=tgross35 more float constants Add constants discussed in rust-lang#146939 rust-lang/libs-team#661 Retry of rust-lang#146934 r? @tgross35
…-relate, r=lcnr regression test for alias-relate changes in lub r? @lcnr
explain why we dont skip some of this work when there are field projections Perf says it doesn't help 🤷
Update documentation for `Result::ok()` The term of "discard" is misleading. An error is not discarded but converted to an `Option::None`.
…thar Query cleanups A few small cleanups in the query system. r? @Zalathar
…r=jhpratt Fix uninitialized UEFI globals in tests Export globals via a `doc(hidden)` module. In test code, use the globals from `realstd` so that they are properly initialized. CC @Ayush1325
Port `#[rustc_hidden_type_of_opaque]` to attribute parser
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 2, 2026
…uwer Rollup of 11 pull requests Successful merges: - #150992 (link modifier `export-symbols`: export all global symbols from selected uptream c static libraries) - #151695 (compiletest: Support `--extern` modifiers with `proc-macro` directive) - #151938 (Use `#![feature(adt_const_params)]` for static query flags) - #151172 (Use default field values in a few more cases) - #151825 (more float constants) - #151870 (regression test for alias-relate changes in lub) - #151902 (explain why we dont skip some of this work when there are field projections) - #151974 (Update documentation for `Result::ok()`) - #151978 (Query cleanups) - #151979 (Fix uninitialized UEFI globals in tests) - #151992 (Port `#[rustc_hidden_type_of_opaque]` to attribute parser)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 6ad3d3d failed: CI. Failed job:
|
Contributor
|
PR #150992, which is a member of this rollup, was unapproved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-compiletest
Area: The compiletest test runner
A-query-system
Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)
A-run-make
Area: port run-make Makefiles to rmake.rs
A-testsuite
Area: The testsuite used to check the correctness of rustc
rollup
A PR which is a rollup
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
WG-trait-system-refactor
The Rustc Trait System Refactor Initiative (-Znext-solver)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
export-symbols: export all global symbols from selected uptream c static libraries #150992 (link modifierexport-symbols: export all global symbols from selected uptream c static libraries)--externmodifiers withproc-macrodirective #151695 (compiletest: Support--externmodifiers withproc-macrodirective)#![feature(adt_const_params)]for static query flags #151938 (Use#![feature(adt_const_params)]for static query flags)Result::ok()#151974 (Update documentation forResult::ok())#[rustc_hidden_type_of_opaque]to attribute parser #151992 (Port#[rustc_hidden_type_of_opaque]to attribute parser)r? @ghost
Create a similar rollup