Advertisement · 728 × 90

Posts by Lukas Wirth

Calendar tier list when

4 hours ago 1 0 1 0

congrats!

3 weeks ago 2 0 0 0

But even without macros I don't think I would change my mind on this, it is just weird having a float token from the lexer stage that can be part of a field access chain depending on the preceding context and the actual text of the token itself, it unnecessarily complicates the parser imo.

3 weeks ago 6 0 0 0

So one solution would've been to completely revamp how we deal with the lexer output (both rustc and r-a use the same lexer), parser and macro TokenTree handling which for obvious reasons no one would ever want to bother with as that is way too much work.

3 weeks ago 5 0 1 0

I think kind of both? Rust's macro system forces you to think about two different sources of tokens, and rust-analyzer's current parser system makes specific requirements to the input. We differ a fair bit from rustc in how we model the parser input though I don't recall as to why.

3 weeks ago 4 0 1 0

It was a pain to make it work with macros in rust-analyzer, so much so that it took us years to fix. So this choice basically enforces specific requirements for your parser (which r-a's did not really support).

3 weeks ago 1 0 1 0

Starting the morning by having to review a pull request that merely changes a complex regex. Thus my morning is already in shambles as I am tasked to review a change in an unreadable language.

3 weeks ago 19 0 2 0

Removing field syntax for tuples/tuple struct, that is no `foo.0` etc. It makes parsing so incredibly annoying in Rust as you might have to split float tokens from the lexer depending on what was preceding it

3 weeks ago 4 0 1 0
Post image

** Speaker announcement ** Catch Vlad Beskrovny & Lukas Wirth's talk 'One Language, Two IDE Engines' at RustWeek 2026!
Info & tickets: 2026.rustweek.org/talks/ides/

See you in Utrecht May 18-23, 2026!

@lukaswirth.dev

#rustweek2026 #rustlang

1 month ago 17 3 0 0

oh sweet, I was wondering whether that was a thing already or not

1 month ago 1 0 0 0
Advertisement

Usually you want a reference to the `dyn Any` inside the box, `&Box<dyn Any>` will unfortunately be a reference to the box itself, just that the box is now unsized to `dyn Any`.

1 month ago 9 0 1 0
Preview
Talk schedule - RustWeek 2026 RustWeek 2026, The Netherlands - May 18 - 23 2026. The world's biggest Rust conference returns to beautiful Utrecht, welcoming over 900+ community members, professionals and the maintainers of Rust.

The RustWeek 2026 schedule, including the talk details for RustWeek 2026, is now published!

2026.rustweek.org/schedule/tue...
2026.rustweek.org/schedule/wed...

Don't forget to buy your ticket!

#rustweek2026 #rust

1 month ago 4 2 0 0

The fact that `&Box<dyn Any>` is coercible to `&dyn Any` is such a big footgun ...

1 month ago 16 0 3 0

This might get me to watch eurovision again, love that guy and some of his songs

1 month ago 3 0 0 0
Preview
RustWeek Speakers Announced! - RustWeek 2026 RustWeek 2026, The Netherlands - May 18 - 23 2026. The world's biggest Rust conference returns to beautiful Utrecht, welcoming over 900+ community members, professionals and the maintainers of Rust.

** RustWeek Speakers Announced! **
Check out the selected speakers and talks here:
2026.rustweek.org/blog/2026-02...

Thanks to everyone who submitted to our CFP!

#rust #rustweek2026

1 month ago 15 6 0 7
Post image

"Vestige"
It's been a while since I last dedicated an illustration to this duo and I wanted to practice drawing desert scenes again, so here's the result c:

1 month ago 376 96 1 0

hey uhhh. I got fired yesterday. if anyone has rust positions in the Netherlands let me know!

1 month ago 66 39 6 2
Preview
Reduce intensity of refreshing pull diagnostics by ConradIrwin · Pull Request #47510 · zed-industries/zed Before this change we&#39;d spawn N tasks in parallel on every keystroke, afterwards we only allow 1 background diagnostic refresh in flight at a time. This also fixed a bug where we&#39;d send O(n...

People are on it, we presume we are overloading rust-analyzer with diagnostic requests, filling the threadpool queue with lots of blocking work github.com/zed-industri...

2 months ago 7 0 1 0

This can vastly speed up initial project indexing depending on your project as the proc-macro server process can only expand a single macro at a given time (due to macros observing the process environment). Once rust-analyzer becomes a bit more parallel it will also speed up things in general.

2 months ago 7 0 0 0
internal: Parallelize proc macro expansion by Shourya742 · Pull Request #21385 · rust-lang/rust-analyzer This PR replaces the single proc-macro server per workspace with a small pool of server processes.

If you are on the preview rust-analyzer releases you can now enable using multiple proc-macro servers (or on stable next monday) by setting the `procMacro.processes` config to a higher number than one 1.

github.com/rust-lang/ru...

2 months ago 23 0 1 0
Advertisement
Post image

Oh so that's what you changed on my PR, this diff had me so confused lol

2 months ago 0 0 1 0

Gotta put rust-analyzer on this list as well

2 months ago 9 0 1 0

my "this isn't meant to be used for harassment" sign i put on my list of enemies is raising a lot of questions answered by the sign

2 months ago 90 8 4 0

Or well, I suppose turning the reference impl back into something template-ish for codegen is just far more annoying.

2 months ago 1 0 1 0

Curious why you used an LLM to duplicate this instead of having a codegen script with the codegen checked out in-tree over a macro then. The codegen approach would allow you to predictably make the same change across all places easily later. I guess because to be able to dupe the documentation?

2 months ago 1 0 1 0
error[E0277]: the trait bound `NoopEviction: HasCapacity` is not satisfied
    --> tests\cycle.rs:1306:5
     |
1306 |     #[salsa::tracked]
     |     ^^^^^^^^^^^^^^^^^ the trait `HasCapacity` is not implemented for `NoopEviction`
     |
help: the trait `HasCapacity` is implemented for `Lru`
    --> C:\Workspace\salsa\src\function\eviction\lru.rs:75:1
     |
  75 | impl HasCapacity for Lru {}
     | ^^^^^^^^^^^^^^^^^^^^^^^^
     = help: see issue #48214
     = note: this error originates in the macro `salsa::plumbing::setup_tracked_fn` which comes from the expansion of the attribute macro `salsa::tracked` (in Nightly builds, run with -Z macro-backtrace for more info)
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
     |
   7 + #![feature(trivial_bounds)]
     |

error[E0277]: the trait bound `NoopEviction: HasCapacity` is not satisfied --> tests\cycle.rs:1306:5 | 1306 | #[salsa::tracked] | ^^^^^^^^^^^^^^^^^ the trait `HasCapacity` is not implemented for `NoopEviction` | help: the trait `HasCapacity` is implemented for `Lru` --> C:\Workspace\salsa\src\function\eviction\lru.rs:75:1 | 75 | impl HasCapacity for Lru {} | ^^^^^^^^^^^^^^^^^^^^^^^^ = help: see issue #48214 = note: this error originates in the macro `salsa::plumbing::setup_tracked_fn` which comes from the expansion of the attribute macro `salsa::tracked` (in Nightly builds, run with -Z macro-backtrace for more info) help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | 7 + #![feature(trivial_bounds)] |

                fn set_lru_capacity(db: &mut dyn $Db, value: usize)
                where
                    for<'trivial_bounds> $Eviction: $zalsa::function::HasCapacity
                {
                    $Configuration::fn_ingredient_mut(db).set_capacity(value);
                }

fn set_lru_capacity(db: &mut dyn $Db, value: usize) where for<'trivial_bounds> $Eviction: $zalsa::function::HasCapacity { $Configuration::fn_ingredient_mut(db).set_capacity(value); }

`#![feature(trivial_bounds)]` or as I like to call it on stable: `for<'trivial_bounds> Type: Bound`

3 months ago 9 0 0 0

we'd still only be able to execute proc-macros in parallel if they are run within the same environment (working dir, env vars) which only happens within the same crate really. So the alternative we are likely looking at is to just spawn multiple servers and handle them like a process pool.

3 months ago 5 0 0 0

The annoying part, you can't trivially parallelize this on the proc-macro server because proc-macros execute in (and are in control 😵‍💫 of) the process environment, so technically running multiple at once can cause issues. But even ignoring that they can change the environment,

3 months ago 5 0 1 0
Advertisement

And some additional notes for parallel proc-macro expansion, today r-a spawns a single proc-macro server that does expansion one at a time, meaning whenever r-a wants to expand a proc-macro, it takes a global lock on the proc-macro server!

3 months ago 6 0 1 0
TokenStream in proc_macro - Rust The main type provided by this crate, representing an abstract stream of tokens, or, more specifically, a sequence of token trees. The type provides interfaces for iterating over those token trees and...

For context as to why we still cannot implement `expand_expr`, that feature effectively turns all proc-macro into eager macro expansions which would basically prevent rust-analyzer from doing a lot of incremental caching, so we just cannot implement this as designed doc.rust-lang.org/stable/proc_...

3 months ago 5 0 1 0