Go to file
bors[bot] 5f279d57f0
Merge #8426
8426: Track recursion limit when expanding custom derive r=jonas-schievink a=jonas-schievink

You can write a custom derive that expands to itself:

```rust
#[proc_macro_derive(Derive)]
pub fn derive(item: TokenStream) -> TokenStream {
    let mut out: TokenStream = "#[derive(Derive)]".parse().unwrap();

    out.extend(item);
    out
}
```

rustc reports a recursion limit error, but rust-analyzer used to spin in name resolution and eventually fail with "name resolution is stuck". This makes it fail fast by respecting the recursion depth of the invocation.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-08 16:51:11 +00:00
.cargo
.github
.vscode
assets
bench_data
crates Track recursion limit when expanding custom derive 2021-04-08 18:49:30 +02:00
docs Remove extra bracket in architecture docs 2021-04-08 17:51:19 +03:00
editors/code Sacrifice for the semicolon god 2021-04-06 15:50:02 +03:00
lib
xtask
.gitattributes
.gitignore
bors.toml
Cargo.lock Bump lsp-types and syn 2021-04-08 10:57:47 -04:00
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
PRIVACY.md Update Zulip link and macro privacy statement 2021-04-06 21:42:27 +03:00
README.md Update Zulip link and macro privacy statement 2021-04-06 21:42:27 +03:00
rustfmt.toml

rust-analyzer logo

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

Work on rust-analyzer is sponsored by

Ferrous Systems

Quick Start

https://rust-analyzer.github.io/manual.html#installation

Documentation

If you want to contribute to rust-analyzer or are just curious about how things work under the hood, check the ./docs/dev folder.

If you want to use rust-analyzer's language server with your editor of choice, check the manual folder. It also contains some tips & tricks to help you be more productive when using rust-analyzer.

Communication

For usage and troubleshooting requests, please use "IDEs and Editors" category of the Rust forum:

https://users.rust-lang.org/c/ide/14

For questions about development and implementation, join rust-analyzer working group on Zulip:

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer

License

Rust analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.