mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Drop some apparently-unreachable code
This commit is contained in:
parent
63c7b90113
commit
4c02a38a99
1 changed files with 6 additions and 13 deletions
|
@ -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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue