Skip to content

Subtree update of rust-analyzer #119289

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

Closed
wants to merge 84 commits into from
Closed

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Dec 25, 2023

r? ghost

GuillaumeGomez and others added 30 commits December 11, 2023 16:44
…lstrieb

Add support for `--env` on `tracked_env::var`

Follow-up of rust-lang#118368.
Part of Part of rust-lang#80792.

It adds support of the `--env` option for proc-macros through `tracked_env::var`.

r? `@Nilstrieb`
…cola

internal: Move proc-macro knowledge out of base-db into hir-expand

It does not make much sense to me to have that live in base-db, additionally, it kind of conflicts with moving span things out into a separate crate
internal: Split out a span crate

Allows getting rid of some of the dependency injection generics that my rewrite introduced
internal: Don't fail changelog generation on missing PRs

One year later 😅.
internal: Move out `WithFixture` into dev-dep only crate
fix: resolve alias before resolve variant

Closes rust-lang#15943 (again)
…barsky

internal: Add minimal support for the 2024 edition

CC rust-lang#16146
Fixes rust-lang#16110.

The way rust desugars doc comments when expanding macros
is rendering it as raw strings delimited with hashes.
Rust-analyzer wasn't aware of this, so the desugared doc
comments wouldn't match correctly when on the LHS of macro
declarations.

This PR fixes this by porting the code used by rustc: https://github.com/rust-lang/rust/blob/4cfdbd328b7171b2328d11b950b1af0978d6b1ef/compiler/rustc_ast/src/tokenstream.rs#L6837
After markdown syntax removal the length of the text is roughly the
same so we can reserve memory beforehand
minor: use a single push_str instead of 2 push
…-to-raw-string, r=Veykril

fix(mbe): desugar doc correctly for mbe

Fixes rust-lang#16110.

The way rust desugars doc comments when expanding macros is rendering it as raw strings delimited with hashes. Rust-analyzer wasn't aware of this, so the desugared doc comments wouldn't match correctly when on the LHS of macro declarations.

This PR fixes this by porting the code used by rustc:
https://github.com/rust-lang/rust/blob/59096cdad0e527ce4d254b55aca58539f726d3d6/compiler/rustc_ast/src/tokenstream.rs#L662-L671
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lnicola
Copy link
Member Author

lnicola commented Dec 25, 2023

I honestly have no idea 😩.

@Veykril
Copy link
Member

Veykril commented Jan 2, 2024

Oh no, this breaks now because the proc-macro-impl test crate has a feature flag ... can we just add a #[allow(unexpected_cfgs)] to the crate's root module?

@@ -1,6 +1,10 @@
//! Exports a few trivial procedural macros for testing.

#![cfg(feature = "sysroot-abi")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#![cfg(feature = "sysroot-abi")]
#![allow(unexpected_cfgs)]
#![cfg(feature = "sysroot-abi")]

That is this might just work?

@lnicola
Copy link
Member Author

lnicola commented Jan 2, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 2, 2024

📌 Commit 0ccd7c9 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 2, 2024

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 2, 2024
@rust-log-analyzer

This comment has been minimized.

@bjorn3
Copy link
Member

bjorn3 commented Jan 2, 2024

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 2, 2024
@Veykril
Copy link
Member

Veykril commented Jan 2, 2024

pub const ALLOW_FEATURES: &'static str = "rustc_private,proc_macro_internals,proc_macro_diagnostic,proc_macro_span,proc_macro_span_shrink";

Guess we also need to add proc_macro_def_site here now (then it really should work though 😅)

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 2, 2024
@lnicola
Copy link
Member Author

lnicola commented Jan 2, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 2, 2024

📌 Commit 9de5fae has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 2, 2024

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 2, 2024
@lnicola
Copy link
Member Author

lnicola commented Jan 3, 2024

@bors r-

Hopefully superseded by #119542.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 3, 2024
@lnicola lnicola closed this Jan 3, 2024
@lnicola lnicola deleted the sync-from-ra branch January 3, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.