-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 7 pull requests #92152
Rollup of 7 pull requests #92152
Conversation
These were left over in migrations to subtrees, which should generally be treated as-if it was local. Also fixes a warning caused by this change.
Sync rustc_codegen_cranelift Nothing exciting this time. Mostly internal refactorings. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
TryInto is part of the 2021 edition prelude
Co-authored-by: bjorn3 <[email protected]>
This version no longer has the old x86 backend
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes rust-lang#89598.
As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
Stabilise entry_insert This stabilises `HashMap:Entry::insert_entry` etc. Tracking issue rust-lang#65225. It will need an FCP. This was implemented in rust-lang#64656 two years ago. This PR includes the rename and change discussed in rust-lang#65225 (comment), happy to split if needed.
Improve suggestions for importing out-of-scope traits reexported as `_` 1. Fix up the `parent_map` query to prefer visible parents that _don't_ export items with the name `_`. * I'm not sure if I modified this query properly. Not sure if we want to check for other idents than `kw::Underscore`. * This also has the side-effect of not doing BFS on any modules re-exported as `_`, but I think that's desirable here too (or else we get suggestions for paths like `a::_::b` like in [this doctest example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d9505ea45bb80adf40bb991298f952be)). 2. Bail in `try_print_visible_def_path` if the `def_id` is re-exported as `_`, which will fall back to printing the def-id's real (definition) path. * Side-effect of this is that we print paths that are not actually public, but it seems we already sometimes suggest `use`ing paths that are private anyways. See [this doctest example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=bad513ed3241f8ff87579eed8046ad10) for demonstration of current behavior. 3. Suggest a glob-import (for example `my_library::prelude::*`) if the trait in question is only pub-exported as `_`, as a fallback. ``` use foo::bar::prelude::*; // trait MyTrait ``` * I think this is good fallback behavior to suggest instead of doing nothing. Thanks to the original issue filer for suggesting this. I was somewhat opinionated about behaviors in this PR, and I'm totally open to limiting the impact of my changes or only landing parts of this. Happy to receive feedback if there are better ways to the same end. Fixes rust-lang#86035
…joshtriplett Suggest adding a `#[cfg(test)]` to to a test module closes rust-lang#88138
Make `PTR::as_ref` and similar methods `const`. Tracking issue: rust-lang#91822 Feature gate: `#![feature(const_ptr_as_ref)]` ```rust // core::ptr impl<T: ?Sized> *const T { pub const unsafe fn as_ref<'a>(self) -> Option<&'a T>; pub const unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>> where T: Sized; pub const unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]>; } impl<T: ?Sized> *mut T { pub const unsafe fn as_ref<'a>(self) -> Option<&'a T>; pub const unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>> where T: Sized; pub const unsafe fn as_mut<'a>(self) -> Option<&'a mut T>; pub const unsafe fn as_uninit_mut<'a>(self) -> Option<&'a mut MaybeUninit<T>> where T: Sized; pub const unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]>; pub const unsafe fn as_uninit_slice_mut<'a>(self) -> Option<&'a mut [MaybeUninit<T>]>; } impl<T: Sized> NonNull<T> { pub const unsafe fn as_uninit_ref<'a>(&self) -> &'a MaybeUninit<T>; pub const unsafe fn as_uninit_mut<'a>(&mut self) -> &'a mut MaybeUninit<T>; } impl<T: ?Sized> NonNull<T> { pub const unsafe fn as_ref<'a>(&self) -> &'a T; pub const unsafe fn as_mut<'a>(&mut self) -> &'a mut T; pub const unsafe fn as_uninit_slice<'a>(&self) -> &'a [MaybeUninit<T>]; pub const unsafe fn as_uninit_slice_mut<'a>(&self) -> &'a mut [MaybeUninit<T>]; } ```
…cate-removal, r=jsha Move duplicates removal when generating results instead of when displaying them Currently, we store 200 results per tab and then display them. However, it was possible to have duplicates which is why we have this check. However, instead of doing it when displaying the results, it's much better instead to do it even before to simplify the display part a bit. r? `@jsha`
JoinHandle docs: add missing 'the'
…jorn3 Sync rustc_codegen_cranelift The main highlight this sync is improved support for inline assembly. Thanks `@nbdd0121!` Inline assembly is still disabled by default for builds in the main rust repo though. Cranelift will now also be built from the crates.io releases rather than the git repo. Git repos are incompatible with vendoring. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
@bors r+ rollup=never p=7 |
📌 Commit ee45a53 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3d57c61): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Successful merges:
_
#91412 (Improve suggestions for importing out-of-scope traits reexported as_
)#[cfg(test)]
to to a test module #91770 (Suggest adding a#[cfg(test)]
to to a test module)PTR::as_ref
and similar methodsconst
. #91823 (MakePTR::as_ref
and similar methodsconst
.)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup