Link impl items to corresponding trait items in late resolver.
Hygienically linking trait impl items to declarations in the trait can be done directly by the late resolver. In fact, it is already done to diagnose unknown items.
This PR uses this resolution work and stores the `DefId` of the trait item in the HIR. This avoids having to do this resolution manually later.
r? `@matthewjasper`
Related to #90639. The added `trait_item_id` field can be moved to `ImplItemRef` to be used directly by your PR.
Do not fail evaluation in const blocks
Evaluate const blocks with a const param-env, so we properly check `~const` trait bounds.
Fixes#92713
(I will fix the poor diagnostics in #92713 and #92712 in a separate PR)
cc `@nbdd0121` who wrote the code this PR touches in #89561
Generate more precise generator names
Currently all generators are named with a `generator$N` suffix, regardless of where they come from. This means an `async fn` shows up as a generator in stack traces, which can be surprising to async programmers since they should not need to know that async functions are implementated using generators.
This change generators a different name depending on the generator kind, allowing us to tell whether the generator is the result of an async block, an async closure, an async fn, or a plain generator.
r? `@tmandry`
cc `@michaelwoerister` `@wesleywiser` `@dpaoliello`
Remove `&mut` from `io::read_to_string` signature
``@m-ou-se`` [realized][1] that because `Read` is implemented for `&mut impl
Read`, there's no need to take `&mut` in `io::read_to_string`.
Removing the `&mut` from the signature allows users to remove the `&mut`
from their calls (and thus pass an owned reader) if they don't use the
reader later.
r? `@m-ou-se`
[1]: https://github.com/rust-lang/rust/issues/80218#issuecomment-874322129
Inline std::os::unix::ffi::OsStringExt methods
Those methods essentially do nothing at assembly level. On Unix systems, `OsString` is represented as a `Vec` without performing any transformations.
Use the new language identifier for Rust in the PDB debug format
Rust currently identifies as MASM (Microsoft Assembler) in the PDB
debug info format on Windows because no identifier was available.
This change pulls in a cherry-pick to Rust's LLVM that includes the
change to use the new identifier for Rust.
https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/cv-cfl-lang
Simplification of BigNum::bit_length
As indicated in the comment, the BigNum::bit_length function could be
optimized by using CLZ, which is often a single instruction instead a
loop.
I think the code is also simpler now without the loop.
I added some additional tests for Big8x3 and Big32x40 to ensure that
there were no regressions.
Optimize `impl_read_unsigned_leb128`
I see instruction count improvements of up to 3.5% locally with these changes, mostly on the smaller benchmarks.
r? `@michaelwoerister`
Rollup of 9 pull requests
Successful merges:
- #92191 (Prefer projection candidates instead of param_env candidates for Sized predicates)
- #92382 (Extend const_convert to rest of blanket core::convert impls)
- #92625 (Add `#[track_caller]` to `mirbug`)
- #92684 (Export `tcp::IntoIncoming`)
- #92743 (Use pre-interned symbols in a couple of places)
- #92838 (Clean up some links in RELEASES)
- #92868 (librustdoc: Address some clippy lints)
- #92875 (Make `opt_const_param_of` work in the presence of `GenericArg::Infer`)
- #92891 (Add myself to .mailmap)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
This hides the paintbrush icon on most pages by default, in preference
for the settings on the settings page. When loading from a local file,
and not in mobile view, continue to show the theme picker. That's
because some browsers limit access to localStorage from file:/// URLs,
so choosing a theme from settings.html doesn't take effect.
Faced with a very long word, browsers will let it overflow its
box horizontally rather than break it in the middle. We essentially
never want that behavior. We would rather break the word and keep it
inside its horizontal limits. So we apply a default overflow-wrap:
break-word/anywhere to the document as a while.
In some contexts we would rather add a horizontal scrollbar (code
blocks), or elide the excess text with an ellipsis (sidebar). Those
still work as expected.
Add `#[track_caller]` to `mirbug`
When a "'no errors encountered even though `delay_span_bug` issued" error results from the `mirbug` function, the file location information points to the `mirbug` function itself, rather than its caller. This doesn't make sense, since the caller is the real source of the bug. Adding `#[track_caller]` will produce diagnostics that are more useful to anyone fixing the ICE.