Conversation
For example, this fixes a error for `impl fn()` (notice the capitalization)
… keyword_lifetime, invalid_label, invalid_visibility
…any_params, c_var_args_without_named_arg, c_var_args_not_last
Co-authored-by: RanolP <public.ranolp@gmail.com>
Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
…mulacrum Std module docs improvements My primary goal is to create a cleaner separation between primitive types and primitive type helper modules (fixes rust-lang#92777). I also changed a few header lines in other top-level std modules (seen at https://doc.rust-lang.org/std/) for consistency. Some conventions used/established: * "The \`Box\<T>` type for heap allocation." - if a module mainly provides a single type, name it and summarize its purpose in the module header * "Utilities for the _ primitive type." - this wording is used for the header of helper modules * Documentation for primitive types themselves are removed from helper modules * provided-by-core functionality of primitive types is documented in the primitive type instead of the helper module (such as the "Iteration" section in the slice docs) I wonder if some content in `std::ptr` should be in `pointer` but I did not address this.
…_maybeuninit, r=JohnTitor Add tests that check `Vec::retain` predicate execution order. This behaviour is documented for `Vec::retain` which means that there is code that rely on that but there weren't tests about that.
…, r=compiler-errors Recover keywords in trait bounds (_this pr was inspired by [this tweet](https://twitter.com/Azumanga/status/1552982326409367561)_) Recover keywords in trait bound, motivational example: ```rust fn f(_: impl fn()) {} // mistyped, meant `Fn` ``` <details><summary>Current nightly (3 needless and confusing errors!)</summary> <p> ```text error: expected identifier, found keyword `fn` --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | ^^ expected identifier, found keyword | help: escape `fn` to use it as an identifier | 1 | fn _f(_: impl r#fn()) {} | ++ error: expected one of `:` or `|`, found `)` --> ./t.rs:1:19 | 1 | fn _f(_: impl fn()) {} | ^ expected one of `:` or `|` error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found keyword `fn` --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | -^^ expected one of 9 possible tokens | | | help: missing `,` error: at least one trait must be specified --> ./t.rs:1:10 | 1 | fn _f(_: impl fn()) {} | ^^^^ ``` </p> </details> This PR: ```text error: expected identifier, found keyword `fn` --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | ^^ expected identifier, found keyword | help: escape `fn` to use it as an identifier | 1 | fn _f(_: impl r#fn()) {} | ++ error[E0405]: cannot find trait `r#fn` in this scope --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn` | ::: /home/waffle/projects/repos/rust/library/core/src/ops/function.rs:74:1 | 74 | pub trait Fn<Args>: FnMut<Args> { | ------------------------------- similarly named trait `Fn` defined here ``` It would be nice to have suggestion in the first error like "have you meant `Fn` trait", instead of a separate error, but the recovery is deep inside ident parsing, which makes it a lot harder to do. r? `@compiler-errors`
Migrate rustc_ast_passes diagnostics to `SessionDiagnostic` and translatable messages (first part) Doing a full migration of the `rustc_ast_passes` crate. Making a draft here since there's not yet a tracking issue for the migrations going on. `@rustbot` label +A-translation
Catch overflow early Although this code should raise an overflow error, it didn't because [check_recursion_limit](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/select/struct.SelectionContext.html#method.check_recursion_limit) it checks for `depth = 128` but not for `129` which should have triggered the overflow error. Anyways this catches that error early. Fixes rust-lang#95134
|
@bors r+ rollup=never p=5 |
|
☀️ Test successful - checks-actions |
|
📌 Perf builds for each rolled up PR: In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (ee8c31e): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Warning ⚠: The following benchmark(s) failed to build:
Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Successful merges:
Vec::retainpredicate execution order. #99386 (Add tests that checkVec::retainpredicate execution order.)SessionDiagnosticand translatable messages (first part) #100694 (Migrate rustc_ast_passes diagnostics toSessionDiagnosticand translatable messages (first part))Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup