Skip to content
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

Subtree update of rust-analyzer #135775

Merged
merged 152 commits into from
Jan 20, 2025
Merged

Subtree update of rust-analyzer #135775

merged 152 commits into from
Jan 20, 2025

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Jan 20, 2025

r? @ghost

Giga-Bowser and others added 30 commits January 6, 2025 15:30
…`Into<ast::Expr>`

This will help with specializing the various `make::expr_*` functions later
`expr_unit` is just a shortcut for a common expression, so it belongs in `make::ext`
`make::match_arm` should take a single `ast::Pat`, and callers can handle creating an `ast::OrPat` if need be. It should also take a proper `ast::MatchGuard`, instead of making one itself.
We should immediately mark them as finished, on the first entry.

The funny (or sad) part was that this bug was pre-existing, but previously to rust-lang#18327, it was causing us to generate bindings non-stop, 65535 of them, until we get to the hardcoded repetition limit, and then throw it all away. And it was so Blazingly Fast that nobody noticed.

With rust-lang#18327 however, this is still what happens, except that now instead of *merging* the fragments into the result, we write them on-demand. Meaning that when we hit the limit, we've already written all previous entries. This is a minor change, I thought for myself when I was writing this, and it's actually for the better, so who cares. Minor change? Not so fast. This caused us to emit 65535 repetitions, all of which the MBE infra needs to handle when calling other macros with the expansion, and convert to rowan tree etc., which resulted a *massive* hang.

The test (and also `analysis-stats`) used to crash with stack overflow on this macro, because we were dropping some crazily deep rowan tree. Now they work properly. Because I am lazy, and also because I could not find the exact conditions that causes a macro match but with a missing binding, I just copied all macros from tracing. Easy.
fix: Fix a bug with missing binding in MBE
internal: Migrate `if let` replacement assists to `SyntaxEditor`
fix: Fix `env`/`option_env` macro check disregarding macro_rules definitions
Also changes `make::expr_empty_block()` to return `ast::BlockExpr` instead of `ast::Expr`
It should be left biased, not right biased, because when e.g. the use has typed `h` then requested completion, the `h` is what we want to find, not the next token (which might indeed be inside a macro call).

I'm not sure why I wrote `right_biased()` to begin with (I remember I had a reason and not just "both should work"), I might've copied the code in `expand_and_analyze()` (which is wrong, because there it lookups on the speculative file, where right biased will always find the correct token and left biased not).

This is still not perfect, because there might not be an identifier already typed then we might still end up in a macro call, but this is the best we can do.
More correctly, *also* per-token. Because as it turns out, while the top-level edition affects parsing (I think), the per-token edition affects escaping of identifiers/keywords.
lnicola and others added 16 commits January 20, 2025 11:12
the constant is wrong on some platforms (e.g., on mips64el it's 0x10, and 0x8
is RTLD_NOLOAD which makes all this functionality broken), the libc crate takes
care of those differences for us.

fallback to not setting the flag in non-glibc environments - some of them might
have support for it using a different value that we don't know about, and some
of them lack it entirely.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
…o-srv-portability

proc-macro-srv: make usage of RTLD_DEEPBIND portable
…neric-args

fix: Fix a bug where enum variants were not considered properly in type ns resolution
…es-on-background-thread

lsp-server: Drop outgoing messages on background thread
Extract variable assist triggers less eagerly
…m_into

feat: Add the ability to jump from `into` to `from` definitions
Properly record meaningful imports as re-exports in symbol index
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2025

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@lnicola
Copy link
Member Author

lnicola commented Jan 20, 2025

@bors r+ p=1 subtree sync

@bors
Copy link
Contributor

bors commented Jan 20, 2025

📌 Commit 1eb9d15 has been approved by lnicola

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 20, 2025
Subtree update of `rust-analyzer`

r? `@ghost`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133695 (Reexport likely/unlikely in std::hint)
 - rust-lang#135330 (Respect --sysroot for rustc -vV and -Cpasses=list)
 - rust-lang#135333 (Partial progress on rust-lang#132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase)
 - rust-lang#135741 (Recognise new IPv6 documentation range from IETF RFC 9637)
 - rust-lang#135770 (Update contributing docs for submodule/subtree changes)
 - rust-lang#135775 (Subtree update of `rust-analyzer`)
 - rust-lang#135776 (Subtree sync for rustc_codegen_cranelift)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b0eadb1 into rust-lang:master Jan 20, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 20, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2025
Rollup merge of rust-lang#135775 - lnicola:sync-from-ra, r=lnicola

Subtree update of `rust-analyzer`

r? ``@ghost``
@bors
Copy link
Contributor

bors commented Jan 20, 2025

⌛ Testing commit 1eb9d15 with merge f3d1d47...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.