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) 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<()> { pub fn main() -> io::Result<()> {
use rustyline::error::ReadlineError; use rustyline::error::ReadlineError;
use rustyline::Editor; use rustyline::Editor;
@ -463,8 +459,9 @@ pub fn main() -> io::Result<()> {
Ok(output) => { Ok(output) => {
println!("{}", output); println!("{}", output);
} }
Err(fail) => { Err(_) => {
report_parse_error(fail); // This seems to be unreachable in practice.
unreachable!();
} }
} }
@ -498,13 +495,9 @@ pub fn main() -> io::Result<()> {
println!("{}", output); println!("{}", output);
pending_src.clear(); pending_src.clear();
} }
// Err(Fail { Err(_) => {
// reason: FailReason::Eof(_), // This seems to be unreachable in practice.
// .. unreachable!();
// }) => {}
Err(fail) => {
report_parse_error(fail);
pending_src.clear();
} }
} }
} }