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 9 pull requests #132273

Closed
wants to merge 23 commits into from

Conversation

workingjubilee
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

SpriteOvO and others added 23 commits October 27, 2024 03:17
Depend on rustc_abi in compiler crates that use it indirectly but have
not yet taken on that dependency, and are not entangled in my other PRs.
This leaves an "excise rustc_target" step after the dust settles.
Updated for changes in the package server workflow.
This reduces the need of the compiler to peek on the fields of LayoutS.
…jgillot

Lower AST node id only once

Fixes rust-lang#96346.

I basically followed the given instructions except the inline part.

`lower_jump_destination` can't reuse local existing `HirId` due to unknown name resolution result so I created an additional mapping for labels.

r? ``@cjgillot``
…it, r=dtolnay

Add a new trait `proc_macro::ToTokens`

Tracking issue rust-lang#130977

This PR adds a new trait `ToTokens`, implemented for types that can be interpolated inside a `quote!` invocation.

```rust
impl ToTokens for TokenTree
impl ToTokens for TokenStream
impl ToTokens for Literal
impl ToTokens for Ident
impl ToTokens for Punct
impl ToTokens for Group
impl<T: ToTokens + ?Sized> ToTokens for &T
impl<T: ToTokens + ?Sized> ToTokens for &mut T
impl<T: ToTokens + ?Sized> ToTokens for Box<T>
impl<T: ToTokens + ?Sized> ToTokens for Rc<T>
impl<T: ToTokens + ToOwned + ?Sized> ToTokens for Cow<'_, T>
impl<T: ToTokens> ToTokens for Option<T>
impl ToTokens for u{8,16,32,64,128}
impl ToTokens for i{8,16,32,64,128}
impl ToTokens for f{32,64}
impl ToTokens for {u,i}size
impl ToTokens for bool
impl ToTokens for char
impl ToTokens for str
impl ToTokens for String
impl ToTokens for CStr
impl ToTokens for CString
```

~This PR also implements the migration mentioned in the tracking issue, replacing `Extend<Token{Tree,Stream}>` with `Extend<T: ToTokens>`, and replacing `FromIterator<Token{Tree,Stream}>` with `FromIterator<T: ToTokens>`.~
**UPDATE**: Reverted.

```diff
-impl FromIterator<TokenTree> for TokenStream
-impl FromIterator<TokenStream> for TokenStream
+impl<T: ToTokens> FromIterator<T> for TokenStream

-impl Extend<TokenTree> for TokenStream
-impl Extend<TokenStream> for TokenStream
+impl<T: ToTokens> Extend<T> for TokenStream
```

I'm going to leave some comments in the review where I'm unsure and concerned.

r? `@dtolnay`
CC `@tgross35`
…ir, r=celinval

stable_mir: Directly use types from rustc_abi

In most cases, rustc_target is not necessary, so use rustc_abi instead of its reexports.
…mpiler-errors

compiler: Add rustc_abi dependence to the compiler

Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not *significantly* entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
…piler-errors

Add `LayoutS::is_uninhabited` and use it

Use accessors for the things that accessors are good at: reducing everyone's need to be nosy and peek at the internals of every data structure.
…s-margins, r=notriddle

[rustdoc] Unify variant struct fields margins with struct fields

As discussed in rust-lang#132220.

| before | after |
|-|-|
| ![image](https://github.com/user-attachments/assets/d8d8336d-7fe4-45fb-a5a5-36a4023223f5) | ![Screenshot from 2024-10-28 11-17-24](https://github.com/user-attachments/assets/9d0d9633-b857-45b4-9217-7d0d1aa8f770) |

r? ``@notriddle``
…r-errors

cg_llvm: Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char`

In `rustc_codegen_llvm` there are many uses of `.as_ptr().cast()` to convert a string or byte-slice to `*const c_char`, which then gets passed through FFI.

This works, but is fragile, because there's nothing constraining the pointer cast to actually be from `u8` to `c_char`. If the original value changes to something else that has an `as_ptr` method, or the context changes to expect something other than `c_char`, the cast will silently do the wrong thing.

By making the cast more explicit via a helper method, we can be sure that it will either perform the intended cast, or fail at compile time.
…none, r=compiler-errors

refactor: cleaner check to return None

It's very nit change. Refactor to shorten verbose check when returning None for `backend_feature_name`.
Updating Fuchsia platform-support documentation

Updated for changes in the package server workflow.

r? `@tmandry` `@erickt`
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler 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. rollup A PR which is a rollup labels Oct 28, 2024
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Oct 28, 2024

📌 Commit d3946e1 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 28, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 28, 2024
@workingjubilee
Copy link
Member Author

@bors r-

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#16 2.653 Building wheels for collected packages: reuse
#16 2.654   Building wheel for reuse (pyproject.toml): started
#16 2.896   Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 2.897   Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132720 sha256=026f3bb0f1aa8090b861fd0a0939cb1a782396d84c8aab7875096557d637a0f6
#16 2.897   Stored in directory: /tmp/pip-ephem-wheel-cache-rgoij90p/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 2.900 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.291 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#16 3.291 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#16 DONE 3.4s
---
    Checking rustc_smir v0.0.0 (/checkout/compiler/rustc_smir)
error[E0412]: cannot find type `LayoutS` in crate `rustc_abi`
  --> compiler/rustc_smir/src/rustc_smir/convert/abi.rs:52:40
   |
52 | impl<'tcx> Stable<'tcx> for rustc_abi::LayoutS<rustc_abi::FieldIdx, rustc_abi::VariantIdx> {
   |
  ::: /checkout/compiler/rustc_abi/src/layout/ty.rs:61:1
   |
   |
61 | pub struct Layout<'a>(pub Interned<'a, LayoutData<FieldIdx, VariantIdx>>);


error[E0599]: no method named `stable` found for struct `Interned<'_, LayoutData<FieldIdx, rustc_abi::VariantIdx>>` in the current scope
    |
    |
758 |         id.internal(&mut *tables, tcx).0.stable(&mut *tables)
    |
help: there is a method `hash_stable` with a similar name, but with different arguments
   --> /checkout/compiler/rustc_data_structures/src/stable_hasher.rs:46:5
    |
    |
46  |     fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher);


error[E0599]: no method named `stable` found for reference `&[LayoutData<FieldIdx, rustc_abi::VariantIdx>]` in the current scope
   --> compiler/rustc_smir/src/rustc_smir/convert/abi.rs:175:58
    |
175 |                     variants: variants.iter().as_slice().stable(tables),
    |
help: there is a method `hash_stable` with a similar name, but with different arguments
   --> /checkout/compiler/rustc_data_structures/src/stable_hasher.rs:46:5
    |
    |
46  |     fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher);

Some errors have detailed explanations: E0412, E0599.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `rustc_smir` (lib) due to 3 previous errors

@workingjubilee workingjubilee deleted the rollup-shj8txa branch October 28, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-compiler Relevant to the compiler 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants