mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:25:38 +02:00
remove the $nothing
variable (#10567)
related to - https://github.com/nushell/nushell/pull/10478 # Description this PR is the followup removal to https://github.com/nushell/nushell/pull/10478. # User-Facing Changes `$nothing` is now an undefined variable, unless define by the user. ```nushell > $nothing Error: nu::parser::variable_not_found × Variable not found. ╭─[entry #1:1:1] 1 │ $nothing · ────┬─── · ╰── variable not found. ╰──── ``` # Tests + Formatting # After Submitting mention that in release notes
This commit is contained in:
@ -6,8 +6,8 @@ use nu_protocol::{
|
||||
Expression, Math, Operator, PathMember, PipelineElement, Redirection,
|
||||
},
|
||||
engine::{EngineState, Stack},
|
||||
report_error_new, IntoInterruptiblePipelineData, IntoPipelineData, PipelineData, Range, Record,
|
||||
ShellError, Span, Spanned, Unit, Value, VarId, ENV_VARIABLE_ID,
|
||||
IntoInterruptiblePipelineData, IntoPipelineData, PipelineData, Range, Record, ShellError, Span,
|
||||
Spanned, Unit, Value, VarId, ENV_VARIABLE_ID,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
@ -1128,20 +1128,6 @@ pub fn eval_variable(
|
||||
span: Span,
|
||||
) -> Result<Value, ShellError> {
|
||||
match var_id {
|
||||
// $nothing
|
||||
nu_protocol::NOTHING_VARIABLE_ID => {
|
||||
report_error_new(
|
||||
engine_state,
|
||||
&ShellError::GenericError(
|
||||
"Deprecated variable".into(),
|
||||
"`$nothing` is deprecated and will be removed in 0.87.".into(),
|
||||
Some(span),
|
||||
Some("Use `null` instead".into()),
|
||||
vec![],
|
||||
),
|
||||
);
|
||||
Ok(Value::nothing(span))
|
||||
}
|
||||
// $nu
|
||||
nu_protocol::NU_VARIABLE_ID => {
|
||||
if let Some(val) = engine_state.get_constant(var_id) {
|
||||
|
Reference in New Issue
Block a user