Drop some apparently-unreachable code

This commit is contained in:
Richard Feldman 2022-10-25 08:30:31 -04:00
parent 63c7b90113
commit 4c02a38a99
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B

View File

@ -421,10 +421,6 @@ fn eval_and_format<'a>(src: &str) -> Result<String, SyntaxError<'a>> {
gen_and_eval_llvm(src, Triple::host(), OptLevel::Normal).map(format_output)
}
fn report_parse_error(fail: SyntaxError) {
println!("TODO Gracefully report parse error in repl: {:?}", fail);
}
pub fn main() -> io::Result<()> {
use rustyline::error::ReadlineError;
use rustyline::Editor;
@ -463,8 +459,9 @@ pub fn main() -> io::Result<()> {
Ok(output) => {
println!("{}", output);
}
Err(fail) => {
report_parse_error(fail);
Err(_) => {
// This seems to be unreachable in practice.
unreachable!();
}
}
@ -498,13 +495,9 @@ pub fn main() -> io::Result<()> {
println!("{}", output);
pending_src.clear();
}
// Err(Fail {
// reason: FailReason::Eof(_),
// ..
// }) => {}
Err(fail) => {
report_parse_error(fail);
pending_src.clear();
Err(_) => {
// This seems to be unreachable in practice.
unreachable!();
}
}
}