Consider operator's span when computing binop expr span

This commit is contained in:
Michael Goulet
2025-07-31 02:12:32 +00:00
parent e5e79f8bd4
commit 51cd9b564f
4 changed files with 20 additions and 17 deletions

View File

@@ -106,7 +106,7 @@ pub fn parse_meta<'a>(psess: &'a ParseSess, attr: &Attribute) -> PResult<'a, Met
res
} else {
// Example cases:
// - `#[foo = 1+1]`: results in `ast::ExprKind::BinOp`.
// - `#[foo = 1+1]`: results in `ast::ExprKind::Binary`.
// - `#[foo = include_str!("nonexistent-file.rs")]`:
// results in `ast::ExprKind::Err`. In that case we delay
// the error because an earlier error will have already