Convert remainder of ShellError variants to named fields (#11276)

# Description

Removed variants that are no longer in use:
* `NoFile*`
* `UnexpectedAbbrComponent`

Converted:
* `OutsideSpannedLabeledError`
* `EvalBlockWithInput`
* `Break`
* `Continue`
* `Return`
* `NotAConstant`
* `NotAConstCommand`
* `NotAConstHelp`
* `InvalidGlobPattern`
* `ErrorExpandingGlob`

Fixes #10700 

# User-Facing Changes

None

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

N/A
This commit is contained in:
Eric Hodel
2023-12-09 16:46:21 -08:00
committed by GitHub
parent ca05553fc6
commit 3e5f81ae14
22 changed files with 328 additions and 298 deletions

View File

@ -305,11 +305,11 @@ impl ExternalCommand {
Some(s) => s.clone(),
None => "".to_string(),
};
return Err(ShellError::RemovedCommand(
command_name_lower,
return Err(ShellError::RemovedCommand {
removed: command_name_lower,
replacement,
self.name.span,
));
span: self.name.span,
});
}
let suggestion = suggest_command(&self.name.item, engine_state);