diff options
| author | Urgau <urgau@numericable.fr> | 2024-10-01 10:25:18 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-10-04 09:09:20 +0200 |
| commit | a3ffa1eae507809628decc6250b28db6ab167b11 (patch) | |
| tree | 1557002d8c545a8b05e453b7355fddd76fcbe1b9 /compiler/rustc_attr/src/builtin.rs | |
| parent | 781f1840cd37348ce4d76fff2b04e1ada531864e (diff) | |
| download | rust-a3ffa1eae507809628decc6250b28db6ab167b11.tar.gz rust-a3ffa1eae507809628decc6250b28db6ab167b11.zip | |
Improve non-boolean literal error in cfg predicate
Diffstat (limited to 'compiler/rustc_attr/src/builtin.rs')
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index a3c6132d484..af73281c316 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -36,6 +36,7 @@ pub fn is_builtin_attr(attr: &Attribute) -> bool { pub(crate) enum UnsupportedLiteralReason { Generic, CfgString, + CfgBoolean, DeprecatedString, DeprecatedKvPair, } @@ -623,7 +624,7 @@ pub fn eval_condition( _ => { dcx.emit_err(session_diagnostics::UnsupportedLiteral { span: cfg.span(), - reason: UnsupportedLiteralReason::Generic, + reason: UnsupportedLiteralReason::CfgBoolean, is_bytestr: false, start_point_span: sess.source_map().start_point(cfg.span()), }); |
