diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-08 17:51:11 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-08 17:51:11 +0100 |
commit | 5f279d57f0cba600eae8c550654a00b4268812ac (patch) | |
tree | 29195bd210adb94fbf8d5780484c931d8ffd5d66 /crates/syntax/test_data/lexer/ok/0014_raw_ident.rs | |
parent | 94d9fc2a28ea5d97e3a9293b9dac05bdb00304cc (diff) | |
parent | 014774764a2a9bd029046e01c757c9892572c0b0 (diff) |
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 <[email protected]>
Diffstat (limited to 'crates/syntax/test_data/lexer/ok/0014_raw_ident.rs')
0 files changed, 0 insertions, 0 deletions