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

Closed
wants to merge 20 commits into from

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

camelid and others added 20 commits January 12, 2025 20:33
It's never overridden, so it shouldn't be on the trait.
The two implementations were identical, so there's no need to use a
trait method.
The new code is more explicit and avoids trait magic that added needless
complexity to this part of rustdoc.
Thereby, we also allow accessing thread::current before main: as the runtime no longer tries to install its own handle, this will no longer trigger an abort. Rather, the name returned from name will only be "main" after the runtime initialization code has run, but I think that is acceptable.

This new approach also requires some changes to the signal handling code, as calling `thread::current` would now allocate when called on the main thread, which is not acceptable. I fixed this by adding a new function (`with_current_name`) that performs all the naming logic without allocation or without initializing the thread ID (which could allocate on some platforms).
constants and statics are nullary functions, and struct fields are unary functions.
Signed-off-by: onur-ozkan <[email protected]>
…-func, r=notriddle

Treat other items as functions for the purpose of type-based search

specifically, constants and statics are nullary functions, and struct fields are unary functions.

fixes rust-lang#130204

r? `@notriddle`
std: lazily allocate the main thread handle

rust-lang#123550 eliminated the allocation of the main thread handle, but at the cost of greatly increased complexity. This PR proposes another approach: Instead of creating the main thread handle itself, the runtime simply remembers the thread ID of the main thread. The main thread handle is then only allocated when it is used, using the same lazy-initialization mechanism as for non-runtime use of `thread::current`, and the `name` method uses the thread ID to identify the main thread handle and return the correct name ("main") for it.

Thereby, we also allow accessing `thread::current` before main: as the runtime no longer tries to install its own handle, this will no longer trigger an abort. Rather, the name returned from `name` will only be "main" after the runtime initialization code has run, but I think that is acceptable.

This new approach also requires some changes to the signal handling code, as calling `thread::current` would now allocate when called on the main thread, which is not acceptable. I fixed this by adding a new function (`with_current_name`) that performs all the naming logic without allocation or without initializing the thread ID (which could allocate on some platforms).

Reverts rust-lang#123550, CC `@GnomedDev`
…-unstable, r=davidtwco

deprecate `std::intrinsics::transmute` etc, use `std::mem::*` instead

The `rustc_allowed_through_unstable_modules` attribute lets users call `std::mem::transmute` as `std::intrinsics::transmute`. The former is a reexport of the latter, and for a long time we didn't properly check stability for reexports, so making this a hard error now would be a breaking change for little gain. But at the same time, `std::intrinsics::transmute` is not the intended path for this function, so I think it is a good idea to show a deprecation warning when that path is used. This PR implements that, for all the functions in `std::intrinsics` that carry the attribute.

I assume this will need `@rust-lang/libs-api` FCP.
…omez

rustdoc: Remove `AttributesExt` trait magic that added needless complexity

The new code is more explicit and avoids trait magic that added needless
complexity to this part of rustdoc.
…leteness, r=lcnr

Prefer lower `TraitUpcasting` candidates in selection

Fixes rust-lang#135463. The underlying cause is this ambiguity, but it's more clear (and manifests as a coercion error, rather than a MIR validation error) when it's written the way I did in the UI test.

Sorry this is cursed r? lcnr
@rustbot rustbot added O-unix Operating system: Unix-like O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jan 15, 2025
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=6 rollup=never

@bors
Copy link
Contributor

bors commented Jan 15, 2025

📌 Commit 3a7ed84 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2025
@bors
Copy link
Contributor

bors commented Jan 15, 2025

⌛ Testing commit 3a7ed84 with merge 4b42d72...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2025
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#131806 (Treat other items as functions for the purpose of type-based search)
 - rust-lang#132654 (std: lazily allocate the main thread handle)
 - rust-lang#135003 (deprecate `std::intrinsics::transmute` etc, use `std::mem::*` instead)
 - rust-lang#135428 (rustdoc: Remove `AttributesExt` trait magic that added needless complexity)
 - rust-lang#135498 (Prefer lower `TraitUpcasting` candidates in selection)
 - rust-lang#135529 (remove outdated FIXME)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#21 exporting to docker image format
#21 sending tarball 27.9s done
#21 DONE 35.3s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
  Downloaded boml v0.3.1
   Compiling boml v0.3.1
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
    Finished `release` profile [optimized] target(s) in 3.86s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
Testing quoted.js ... OK
Testing reference-shrink.js ... OK
Testing regex.js ... OK
Testing return-based-sort.js ... FAILED
[ query `-> AllocError`]==> '{"path":"core::alloc::AllocError","name":"clone"}' was supposed to be before '{"dist":300,"displayPath":"<span>core::</span><span>alloc::</span><span>AllocError::</span>","crate":"core","ty":13,"name":"clone","path":"core::alloc","descShard":{"crate":"core","shard":1,"start":2092,"len":2922,"promise":{}},"descIndex":402,"exactPath":"core::alloc","parent":{"ty":5,"name":"AllocError","path":"core::alloc","exactPath":"core::alloc","unboxFlag":false},"type":{"inputs":[{"id":11,"name":"reference","ty":1,"path":null,"exactPath":null,"generics":[{"id":20,"name":"AllocError","ty":5,"path":"core::alloc","exactPath":"core::alloc","generics":[],"bindings":{},"unboxFlag":false}],"bindings":{},"unboxFlag":true}],"output":[{"id":20,"name":"AllocError","ty":5,"path":"core::alloc","exactPath":"core::alloc","generics":[],"bindings":{},"unboxFlag":false}],"where_clause":[]},"paramNames":[""],"id":9751,"word":"clone","normalizedName":"clone","bitIndex":5882,"implDisambiguator":null,"fullPath":"core::alloc::AllocError::clone|13","displayTypeSignature":{},"href":"../core/alloc/struct.AllocError.html#method.clone","desc":"","displayType":"&AllocError -> `AllocError`","displayMappedNames":"","displayWhereClause":""}'
Testing return-specific.js ... OK
Testing should-fail.js ... OK
Testing simd-type-signatures.js ... OK
Testing string-from_ut.js ... OK
Testing string-from_ut.js ... OK
Testing struct-vec.js ... OK
Testing transmute-fail.js ... OK
Testing transmute.js ... OK
Testing typed-query.js ... OK
Testing vec-new.js ... OK
Testing vec-type-signatures.js ... OK
Testing write.js ... OK
Command has failed. Rerun with -v to see more details.
  local time: Wed Jan 15 14:58:37 UTC 2025
  network time: Wed, 15 Jan 2025 14:58:37 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants