diff --git a/doc/manual/rl-next/deprecated-features.md b/doc/manual/rl-next/deprecated-features.md index 60ed2e07e..60fca16f4 100644 --- a/doc/manual/rl-next/deprecated-features.md +++ b/doc/manual/rl-next/deprecated-features.md @@ -16,3 +16,4 @@ You can opt in into the old behavior with `--extra-deprecated-features` or any e - `or-as-identifier` `or` as an identifier has always been weird since the `or` (almost-)keyword has been introduced. We are deprecating the backcompat hacks from the early days of Nix in favor of making `or` a full and proper keyword. - `tokens-no-whitespace` Function applications without space around the arguments like `0a`, `0.00.0` or `foo"1"2` are now forbidden. The same applies to list elements. The primary reason for this deprecation is to remove foot guns around surprising tokenization rules regarding number literals, but this will also free up some syntax for other purposes (e.g. `r""` strings) for reuse at some point in the future. - `shadow-internal-symbols` has been expanded to also forbid shadowing `null`, `true` and `false`. +- `ancient-let` deprecation has been turned into a full parser error instead of a warning. diff --git a/lix/libexpr/parser/parser-impl1.inc.cc b/lix/libexpr/parser/parser-impl1.inc.cc index 990e27adc..e35320ffc 100644 --- a/lix/libexpr/parser/parser-impl1.inc.cc +++ b/lix/libexpr/parser/parser-impl1.inc.cc @@ -913,18 +913,18 @@ template<> struct BuildAST { template<> struct BuildAST : change_head { static void success(const auto & in, BindingsStateRecSet & b, ExprState & s, State & ps) { - // Added 2024-09-18. Turn into an error at some point in the future. + // Added 2024-09-18 as a warning, turned into error 2026-01-29. // See the documentation on deprecated features for more details. if (!ps.featureSettings.isEnabled(Dep::AncientLet)) //FIXME: why aren't there any tests for this? - logWarning({ - .msg = HintFmt( - "%s is deprecated and will be removed in the future. Use %s to silence this warning.", - "let {", - "--extra-deprecated-features ancient-let" - ), - .pos = ps.positions[ps.at(in)] - }); + throw ParseError( + {.msg = HintFmt( + "%s is deprecated and will be removed in the future. Use %s to silence this warning.", + "let {", + "--extra-deprecated-features ancient-let" + ), + .pos = ps.positions[ps.at(in)]} + ); auto pos = ps.at(in); b.set.pos = pos; diff --git a/lix/libutil/deprecated-features/ancient-let.md b/lix/libutil/deprecated-features/ancient-let.md index c0952226f..68bb75716 100644 --- a/lix/libutil/deprecated-features/ancient-let.md +++ b/lix/libutil/deprecated-features/ancient-let.md @@ -6,6 +6,10 @@ timeline: release: 2.92.0 cls: [1787] message: Introduced as soft deprecation with a warning. + - date: 2026-01-29 + release: 2.95.0 + cls: [5039] + message: Upgraded the warning to a parse error. --- The ancient `let { body = …; … }` syntax is deprecated. diff --git a/tests/nixpkgs/eval.nix b/tests/nixpkgs/eval.nix index b94cf4e55..df5d5f456 100644 --- a/tests/nixpkgs/eval.nix +++ b/tests/nixpkgs/eval.nix @@ -17,6 +17,7 @@ let "rec-set-dynamic-attrs" "or-as-identifier" "tokens-no-whitespace" + "ancient-let" ]; in diff --git a/tests/nixpkgs/lib.nix b/tests/nixpkgs/lib.nix index d73f97586..45badef4d 100644 --- a/tests/nixpkgs/lib.nix +++ b/tests/nixpkgs/lib.nix @@ -26,6 +26,7 @@ let "rec-set-dynamic-attrs" "or-as-identifier" "tokens-no-whitespace" + "ancient-let" ]; env.NIX_CONFIG = "extra-deprecated-features = ${concatStringsSep " " deprecatedFeatures}";