-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rolling up PRs in the queue #16092
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
Merged
Merged
Rolling up PRs in the queue #16092
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think this is an improvement of the previous warning message, which - like the comment that I removed implies - is in need of some improvement. I've opted to point the user in the right direction w.r.t how to fix the problem, which I think is good form. Not being familiar with the repr(...) attribute, I personally had to check the lint rules myself to figure out what was wrong. Hopefully, this will save he next person some time and headache. Signed-off-by: Anton Lofgren <alofgren@op5.com>
It is being changed because the previous wording was ambiguous. `a.divides(b)` implied `a % b == 0` but it sounds like the other way around. `9.divides(&3) == true` but we might read that as "does 9 divide 3?". It has been renamed to sidestep the ambiguity. Work around the change by using `is_multiple_of` instead. [breaking-change]
Correct `str` to `src`
Sometimes dsymutil writes to stdout/stderr which rust isn't reading, which may cause a deadlock. Closes rust-lang#16060
* Make the code fill up the full width of the page (no massive whitespace on the left) * Move the code down to make it not intersect the logo * Set a min-width and remove the max-width so that the code doesn't scroll internally, but instead scrolls the page, meaning horizontal scroll bars are always available * Set overflow to actually overflow, just to be sure Fixes rust-lang#15891
… intrinsics Fixes rust-lang#15972 and rust-lang#16011.
It's a small step forward in application of RFC 39 to the code base itself. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
… and color (raw) strings as such in attributes. This fixes cases where a string contains ] inside an attribute: that ] used to incorrectly end the attribute coloring. For large (many lines) doc comments, I’ve found preferable to use `#![doc = r#"..."#]` to avoid prefixing every line with `//!`.
Closes rust-lang#15296 (Update disclaimer to improve clarity and intent) Closes rust-lang#15804 (Don't ICE when dealing with the count expr for fixed array types in various places.) Closes rust-lang#15893 (lint: Improve ffi-unsafe enum lint warning) Closes rust-lang#16045 (Rename Integer divides to is_multiple_of.) Closes rust-lang#16055 (manual: update list of feature gates, add phase attribute) Closes rust-lang#16056 (Improve documentation of rounding functions) Closes rust-lang#16061 (Remove references to non-existant functions in the std::path documentation) Closes rust-lang#16062 (Fix documentation error in MutableVectorAllocating::move_from) Closes rust-lang#16063 (adding discuss.rust-lang to community) Closes rust-lang#16064 (rustc: Switch dsymutil status => output) Closes rust-lang#16066 (making raw source display better) Closes rust-lang#16079 (doc: add missing word) Closes rust-lang#16080 (Update LLVM to fix miscompilations due to wrongfully removed lifetime intrinsics) Closes rust-lang#16084 (Elide lifetimes around Arc<T>.) Closes rust-lang#16085 (Gedit/gtksourceview language spec: add raw strings) Closes rust-lang#16086 (Implement Hash for DList)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 18, 2024
feat: Introduce term search to rust-analyzer # Introduce term search to `rust-analyzer` _I've marked this as draft as there might be some shortcomings, please point them out so I can fix them. Otherwise I think it is kind of ready as I think I'll rather introduce extra functionality in follow up PRs._ Term search (or I guess expression search for rust) is a technique to generate code by basically making the types match. Consider the following program ```rust fn wrap(arg: i32) -> Option<i32> { todo!(); } ``` From the types of values in scope and constructors of `Option`, we can produce the expected result of wrapping the argument in `Option` Dependently typed languages such as `Idris2` and `Agda` have similar tools to help with proofs, but this can be also used in everyday development as a "auto-complete". # Demo videos https://github.com/rust-lang/rust-analyzer/assets/19900308/7b68a1b7-7dba-4e31-9221-6c7485e77d88 https://github.com/rust-lang/rust-analyzer/assets/19900308/0fae530a-aabb-4b28-af71-e19f8d3d64b2 # What does it currently do - It works well with locals, free functions, type constructors and non-static impl methods that take items by value. - Works with functions/methods that take shared references, but not with unique references (very conservative). - Can handle projections to struct fields (eg. `foo.bar.baz`) but this might me more conservative than it has to be to avoid conflicting with borrow checker - Should create only valid programs (no type / borrow checking errors). Tested with `rust-analyzer analysis-stats /path/to/ripgrep/Cargo.toml --run-term-search --validate-term-search` (basically running `cargo check` on all of the generated programs and only error seems to be due to type inference which is more of issue of testing method. # Performace / fitness ```txt ripgrep (latest) Tail Expr syntactic hits: 130/1692 (7%) Tail Exprs found: 523/1692 (30%) Term search avg time: 9ms Term search: 15.64s, 97ginstr, 8mb rust-analyzer (on this branch) Tail Expr syntactic hits: 804/13860 (5%) Tail Exprs found: 6757/13860 (48%) Term search avg time: 78ms Term search: 1088.23s, 6765ginstr, 98mb ``` Highly generic code seems to blow up the search space so currently the amount of generics allowed is functions/methods is limited down to 0 (1 didn't give much improvement and 2 is already like 0.5+s search time) # Plans for the future (not in this PR) - ``~~Add impl methods that do not take `self` type (should be quite straight forward)~~ Done - Be smarter (aka less restrictive) about borrow checking - this seems quite hard but since the current approach is rather naive I think some easy improvement is available. - ``~~See if it works as a autocomplete while typing~~ Done _Feel free to ask questions / point of shortcoming either here or on Zulip, I'll be happy to address them. I'm doing this as part of my MSc thesis so I'll be working on it till summer anyway 😄_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.