-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #121252
Rollup of 7 pull requests #121252
Conversation
…me are handled as expected on mobile
…d trait bound When encountering ```rust struct Foo; struct Bar; impl From<Bar> for Foo { fn from(_: Bar) -> Self { Foo } } fn qux(_: impl From<Bar>) {} fn main() { qux(Bar.into()); } ``` Suggest removing `.into()`: ``` error[E0283]: type annotations needed --> f100.rs:8:13 | 8 | qux(Bar.into()); | --- ^^^^ | | | required by a bound introduced by this call | = note: cannot satisfy `_: From<Bar>` note: required by a bound in `qux` --> f100.rs:6:16 | 6 | fn qux(_: impl From<Bar>) {} | ^^^^^^^^^ required by this bound in `qux` help: try using a fully qualified path to specify the expected types | 8 | qux(<Bar as Into<T>>::into(Bar)); | +++++++++++++++++++++++ ~ help: consider removing this method call, as the receiver has type `Bar` and `Bar: From<Bar>` can be fulfilled | 8 - qux(Bar.into()); 8 + qux(Bar); | ``` Fix rust-lang#71252
…ame, r=notriddle rustdoc: Correctly handle long crate names on mobile Fixes rust-lang#120471. It now renders like this: ![image](https://github.com/rust-lang/rust/assets/3050060/065b4b8b-ba55-4163-a928-8d7bf735c111) r? `@notriddle`
…rrors Detect when method call on argument could be removed to fulfill failed trait bound When encountering ```rust struct Foo; struct Bar; impl From<Bar> for Foo { fn from(_: Bar) -> Self { Foo } } fn qux(_: impl From<Bar>) {} fn main() { qux(Bar.into()); } ``` Suggest removing `.into()`: ``` error[E0283]: type annotations needed --> f100.rs:8:13 | 8 | qux(Bar.into()); | --- ^^^^ | | | required by a bound introduced by this call | = note: cannot satisfy `_: From<Bar>` note: required by a bound in `qux` --> f100.rs:6:16 | 6 | fn qux(_: impl From<Bar>) {} | ^^^^^^^^^ required by this bound in `qux` help: try using a fully qualified path to specify the expected types | 8 | qux(<Bar as Into<T>>::into(Bar)); | +++++++++++++++++++++++ ~ help: consider removing this method call, as the receiver has type `Bar` and `Bar: From<Bar>` trivially holds | 8 - qux(Bar.into()); 8 + qux(Bar); | ``` Fix rust-lang#71252
…-rendering, r=GuillaumeGomez rustdoc: fix and refactor HTML rendering a bit * refactoring: get rid of a bunch of manual `f.alternate()` branches * not sure why this wasn't done so already, is this perf-sensitive? * fix an ICE in debug builds of rustdoc * rustdoc used to crash on empty outlives-bounds: `where 'a:` * properly escape const generic defaults * actually print empty trait and outlives-bounds (doesn't work for cross-crate reexports yet, will fix that at some other point) since they can have semantic significance * outlives-bounds: forces lifetime params to be early-bound instead of late-bound which is technically speaking part of the public API * trait-bounds: can affect the well-formedness, consider * makeshift “const-evaluatable” bounds under `generic_const_exprs` * bounds to force wf-checking in light of rust-lang#100041 (quite artificial I know, I couldn't figure out something better), see rust-lang#121160 (comment)
…s, r=compiler-errors Add more checks for `unnamed_fields` during HIR analysis Fixes rust-lang#121151 I also found that we don't prevent enums here so ```rs #[repr(C)] #[derive(Debug)] enum A { #[default] B, C, } #[repr(C)] #[derive(Debug)] struct D { _: A, } ``` leads to an ICE on an `self.is_struct() || self.is_union()` assertion, so fixed that too.
…triddle Fix missing trait impls for type in rustc docs Fixes rust-lang#76736
…-bindings, r=compiler-errors AstConv: Refactor lowering of associated item bindings a bit Split off from rust-lang#119385 as discussed, namely the first two commits (modulo one `FIXME` getting turned into a `NOTE`). The second commit removes `astconv::ConvertedBinding{,Kind}` in favor of `hir::TypeBinding{,Kind}`. The former was a — in my opinion — super useless intermediary. As you can tell from the diff, its removal shaves off some code. Furthermore, yeeting it will make it easier to implement the type resolution fixes in rust-lang#119385. Nothing in this PR should have any semantic effect. r? `@compiler-errors` <sub>**Addendum** as in rust-lang#118668: What I call “associated item bindings” are commonly referred to as “type bindings” for historical reasons. Nowadays, “type bindings” include assoc type bindings, assoc const bindings and RTN (return type notation) which is why I prefer not to use this outdated term.</sub>
…mpiler-errors Use better heuristic for printing Cargo specific diagnostics It was [reported](rust-lang#82450 (comment)) in the check-cfg call for testing that the Rust for Linux project is setting the `CARGO` env without compiling with it, which is an issue since we are using the `CARGO` env as a proxy for "was launched from Cargo". This PR switch to the `CARGO_CRATE_NAME` [Cargo env](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates), which shouldn't collide (as much) with other build systems. I also took the opportunity to consolidate all the checks under the same function.
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: d3df8ff851 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (23a3d77): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 642.411s -> 640.08s (-0.36%) |
Successful merges:
unnamed_fields
during HIR analysis #121198 (Add more checks forunnamed_fields
during HIR analysis)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup