add eprintln statement before unreachable

This commit is contained in:
Loïc Riegel 2025-05-08 11:13:17 +02:00
parent debc913eeb
commit 0e33749627
12 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,7 @@ impl Command for Break {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'break' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -48,6 +48,7 @@ impl Command for Const {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'const' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -38,6 +38,7 @@ impl Command for Continue {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'continue' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -50,6 +50,7 @@ impl Command for For {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'for' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -100,6 +100,7 @@ impl Command for If {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'if' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -48,6 +48,7 @@ impl Command for Let {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'let' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -39,6 +39,7 @@ impl Command for Loop {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'loop' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -43,6 +43,7 @@ impl Command for Match {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'match' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -48,6 +48,7 @@ impl Command for Mut {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'mut' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -42,6 +42,7 @@ impl Command for Return {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'return' command: this code path should never be reached in IR mode");
unreachable!()
}

View File

@ -49,6 +49,7 @@ impl Command for Try {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'try' command: this code path should never be reached in IR mode");
unreachable!();
}

View File

@ -48,6 +48,7 @@ impl Command for While {
) -> Result<PipelineData, ShellError> {
// This is compiled specially by the IR compiler. The code here is never used when
// running in IR mode.
eprintln!("Tried to execute 'run' for the 'while' command: this code path should never be reached in IR mode");
unreachable!()
}