diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-11-28 17:53:20 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-12-01 16:26:51 +0100 |
| commit | 63816da5ed1abfe0c3b134dbf6710725d4416ee4 (patch) | |
| tree | e2f6dcac9500b910af850d24c2c87fc6aa09e76f /compiler/rustc_passes/src | |
| parent | 7df0052df8234be4c9075cec3c2d6414a28c87b1 (diff) | |
| download | rust-63816da5ed1abfe0c3b134dbf6710725d4416ee4.tar.gz rust-63816da5ed1abfe0c3b134dbf6710725d4416ee4.zip | |
Improve some attributes error spans
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 9c0234953bb..c9e02d56f4b 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -319,7 +319,7 @@ impl CheckAttrVisitor<'tcx> { self.tcx .sess .struct_span_err( - meta.span(), + meta.name_value_literal_span().unwrap_or_else(|| meta.span()), &format!( "{:?} character isn't allowed in `#[doc(alias = \"...\")]`", c, @@ -332,7 +332,7 @@ impl CheckAttrVisitor<'tcx> { self.tcx .sess .struct_span_err( - meta.span(), + meta.name_value_literal_span().unwrap_or_else(|| meta.span()), "`#[doc(alias = \"...\")]` cannot start or end with ' '", ) .emit(); |
