-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 10 pull requests #108052
Rollup of 10 pull requests #108052
Conversation
--wip-- [skip ci] get the generic text and put it int he suggestion, but suggestion not working on derive subdiagnostic refactor away from derives and use span_suggestion() instead. Show's the correct(?) generic contents, but overwrites the fn name :( x fmt drop commented code and s/todo/fixme get the correct diagnostic for functions, at least x fmt remove some debugs remove format remove debugs remove useless change remove useless change remove legacy approach correct lookahead + error message contains the ident name fmt refactor code tests add tests remoev debug remove comment
Co-authored-by: Takayuki Maeda <takoyaki0316@gmail.com>
This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it. See also fce944d
…66_fix, r=TaKO8Ki Suggest fix for misplaced generic params on fn item rust-lang#103366 fixes rust-lang#103366 This still has some work to go, but works for 2/3 of the initial base cases described in #1033366 simple fn: ``` error: expected identifier, found `<` --> shreys/test_1.rs:1:3 | 1 | fn<T> id(x: T) -> T { x } | ^ expected identifier | help: help: place the generic parameter list after the function name: | 1 | fn id<T>(x: T) -> T { x } | ~~~~ ``` Complicated bounds ``` error: expected identifier, found `<` --> spanishpear/test_2.rs:1:3 | 1 | fn<'a, B: 'a + std::ops::Add<Output = u32>> f(_x: B) { } | ^ expected identifier | help: help: place the generic parameter list after the function name: | 1 | fn f<'a, B: 'a + std::ops::Add<Output = u32>>(_x: B) { } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Opening a draft PR for comments on approach, particularly I have the following questions: - [x] Is it okay to be using `err.span_suggestion` over struct derives? I struggled to get the initial implementation (particularly the correct suggestion message) on struct derives, although I think given what I've learned since starting, I could attempt re-doing it with that approach. - [x] in the case where the snippet cannot be obtained from a span, is the `help` but no suggestion okay? I think yes (also, when does this case occur?) - [x] are there any red flags for the generalisation of this work for relevant item kinds (i.e. `struct`, `enum`, `trait`, and `union`). My basic testing indicates it does work for those types except the help tip is currently hardcoded to `after the function name` - which should change dependent on the item. - [x] I am planning to not show the suggestion if there is already a `<` after the item identifier, (i.e. if there are already generics, as after a function name per the original issue). Any major objections? - [x] Is the style of error okay? I wasn't sure if there was a way to make it display nicer, or if thats handled by span_suggestion These aren't blocking questions, and I will keep working on: - check if there is a `<` after the ident (and if so, not showing the suggestion) - generalize the help message - figuring out how to write/run/etc ui tests (including reading the docs for them) - logic cleanups
…_canonical_goal, r=lcnr Check for overflow in evaluate_canonical_goal r? `@lcnr`
…mpiler-errors Avoid ICE when the generic_span is empty Fixes rust-lang#107998 r? ```@TaKO8Ki```
"Basic usage" is redundant for there is just one example
…orkingjubilee Shrink size of array benchmarks Might've overdone it with the size of these benchmarks, as there's no need for them to be quite as large. Fixes rust-lang#108011
add message to update Cargo.toml when x is changed `@jyn514` Is this correct? As mentioned in rust-lang#108021
…-tooltips, r=GuillaumeGomez rustdoc: add more tooltips to intra-doc links This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it. See also rust-lang#39697 Partially solves https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931 (though the Internals thread asks for color-coding, while this PR adds a tooltip instead, it's accomplishing the same thing). Before: <img width="950" alt="image" src="https://user-images.githubusercontent.com/1593513/218653059-911cea01-7231-438a-ad98-be98ab73783f.png"> After: <img width="432" alt="image" src="https://user-images.githubusercontent.com/1593513/218653201-34ca3aa7-18f1-4cb1-be68-a1411bbe797e.png">
s/eval_usize/eval_target_usize/ for clarity r? `@nnethercote` as discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60Const.60.20and.20.60usize.60.2F.60u64.60 it is unclear what `usize` means and why we use a `u64` for something talking about `usize`. This renaming should make it clear that we're talking about `usize`s on the target platform, irrespective of the compiler host platform.
…ess, r=Mark-Simulacrum Avoid using a dead email address as the main email address This caused highfive to welcome me as a new contributor on every PR, because it couldn't find any commits of mine.
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR: previous master: 9bb6e60d1f In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (6e01157): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression 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.
|
An attempt to reduce the perf regression in rust-lang#108052 (comment)
…alloc, r=GuillaumeGomez rustdoc: reduce allocations when generating tooltips An attempt to reduce the perf regression in rust-lang#108052 (comment)
…GuillaumeGomez rustdoc: reduce allocations when generating tooltips An attempt to reduce the perf regression in rust-lang/rust#108052 (comment)
…GuillaumeGomez rustdoc: reduce allocations when generating tooltips An attempt to reduce the perf regression in rust-lang/rust#108052 (comment)
…GuillaumeGomez rustdoc: reduce allocations when generating tooltips An attempt to reduce the perf regression in rust-lang/rust#108052 (comment)
Successful merges:
fn
item #103366 )Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup