mirror of
https://github.com/rust-lang/rust.git
synced 2026-07-26 17:42:22 -04:00
ea7bee7515
Currently the method computes the span from the path's span and the args' span. That used to be fine but then `unsafe(..)`/`safe(..)` were added without it being changed. So it doesn't account for those optional keywords and parentheses. The only way to handle those reliably is with a dedicated span for the entire `AttrItem`. Consequences: - `NormalAttr` grows from 72 bytes to 80. (It's the only AST node that contains an `AttrItem`.) Not ideal, but non-doc-comment attributes aren't that common (not compared to expressions, for example). Also, `NormalAttr` is always boxed and jemalloc will round up 72 byte allocations to 80 bytes anyway. - In `lint-unsafe-code.rs` various spans now point to `unsafe(foo)` rather than just `foo`. (It makes sense to include the `unsafe` keyword in the complaint about unsafety.)