Bump token expansion limit

We hit this for redis crate, reported at

Reported at
https://www.reddit.com/r/rust/comments/ikfsf8/rustanalyzer_doesnt_work_with_the_redis_crate/
This commit is contained in:
Aleksey Kladov 2020-09-01 14:55:41 +02:00
parent 5b21c7b0e5
commit 7f54ded71b

View file

@ -223,7 +223,7 @@ fn macro_expand_with_arg(
let ExpandResult(tt, err) = macro_rules.0.expand(db, lazy_id, &macro_arg.0);
// Set a hard limit for the expanded tt
let count = tt.count();
if count > 65536 {
if count > 262144 {
return (None, Some(format!("Total tokens count exceed limit : count = {}", count)));
}
(Some(Arc::new(tt)), err.map(|e| format!("{:?}", e)))