2019-10-29 08:15:51 +00:00
|
|
|
[package]
|
2022-04-29 14:29:24 +00:00
|
|
|
name = "hir-expand"
|
2020-08-13 14:26:29 +00:00
|
|
|
version = "0.0.0"
|
2024-07-30 12:11:16 +00:00
|
|
|
repository = "https://github.com/rust-lang/rust-analyzer"
|
2024-07-30 12:10:08 +00:00
|
|
|
description = "Macro expansion for rust-analyzer."
|
2023-01-16 15:41:47 +00:00
|
|
|
|
|
|
|
authors.workspace = true
|
|
|
|
edition.workspace = true
|
|
|
|
license.workspace = true
|
2023-01-16 15:33:01 +00:00
|
|
|
rust-version.workspace = true
|
2019-10-29 08:15:51 +00:00
|
|
|
|
2019-11-17 15:35:05 +00:00
|
|
|
[lib]
|
|
|
|
doctest = false
|
|
|
|
|
2019-10-29 08:15:51 +00:00
|
|
|
[dependencies]
|
fix: avoid pathological macro expansions
Today, rust-analyzer (and rustc, and bat, and IntelliJ) fail badly on
some kinds of maliciously constructed code, like a deep sequence of
nested parenthesis.
"Who writes 100k nested parenthesis" you'd ask?
Well, in a language with macros, a run-away macro expansion might do
that (see the added tests)! Such expansion can be broad, rather than
deep, so it bypasses recursion check at the macro-expansion layer, but
triggers deep recursion in parser.
In the ideal world, the parser would just handle deeply nested structs
gracefully. We'll get there some day, but at the moment, let's try to be
simple, and just avoid expanding macros with unbalanced parenthesis in
the first place.
closes #9358
2021-08-09 13:06:49 +00:00
|
|
|
cov-mark = "2.0.0-pre.1"
|
2023-11-15 11:00:32 +00:00
|
|
|
tracing.workspace = true
|
2023-11-15 11:07:36 +00:00
|
|
|
either.workspace = true
|
2023-12-18 13:53:11 +00:00
|
|
|
rustc-hash.workspace = true
|
2023-06-19 10:44:09 +00:00
|
|
|
la-arena.workspace = true
|
2023-11-15 10:53:56 +00:00
|
|
|
itertools.workspace = true
|
2023-06-18 16:44:09 +00:00
|
|
|
hashbrown.workspace = true
|
2023-02-14 16:01:01 +00:00
|
|
|
smallvec.workspace = true
|
2023-05-02 14:12:22 +00:00
|
|
|
triomphe.workspace = true
|
2019-10-29 11:55:39 +00:00
|
|
|
|
2023-01-17 09:52:26 +00:00
|
|
|
# local deps
|
|
|
|
stdx.workspace = true
|
|
|
|
intern.workspace = true
|
|
|
|
base-db.workspace = true
|
|
|
|
cfg.workspace = true
|
|
|
|
syntax.workspace = true
|
|
|
|
tt.workspace = true
|
|
|
|
mbe.workspace = true
|
|
|
|
limit.workspace = true
|
2023-12-18 12:30:41 +00:00
|
|
|
span.workspace = true
|
2024-01-30 15:57:40 +00:00
|
|
|
parser.workspace = true
|
2024-08-05 08:43:01 +00:00
|
|
|
syntax-bridge.workspace = true
|
2022-02-07 19:30:28 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2022-07-19 11:00:45 +00:00
|
|
|
expect-test = "1.4.0"
|
2023-12-29 14:22:29 +00:00
|
|
|
|
2024-04-20 15:44:27 +00:00
|
|
|
[features]
|
|
|
|
in-rust-tree = ["syntax/in-rust-tree"]
|
|
|
|
|
2023-12-29 14:22:29 +00:00
|
|
|
[lints]
|
2024-03-04 10:10:06 +00:00
|
|
|
workspace = true
|