Skip to content

Commit dc8b893

Browse files
authored
Merge pull request #432 from rustcoreutils/updates
Updates
2 parents fcc84a0 + 78b9a1e commit dc8b893

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

calc/bc_util/parser.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,20 +263,20 @@ fn parse_stmt(
263263
in_loop: bool,
264264
statements: &mut Vec<StmtInstruction>,
265265
source_locations: &mut Vec<usize>,
266-
) -> Result<usize, PestError> {
266+
) -> Result<usize, Box<PestError>> {
267267
let stmt = first_child(stmt);
268268
let (line, _) = stmt.line_col();
269269
source_locations.push(line);
270270
let mut instruction_count = 1;
271271
match stmt.as_rule() {
272272
Rule::break_stmt => {
273273
if !in_loop {
274-
return Err(pest::error::Error::new_from_span(
274+
return Err(Box::new(pest::error::Error::new_from_span(
275275
pest::error::ErrorVariant::CustomError {
276276
message: "break outside of loop".to_string(),
277277
},
278278
stmt.as_span(),
279-
));
279+
)));
280280
}
281281
statements.push(StmtInstruction::Break);
282282
}
@@ -286,12 +286,12 @@ fn parse_stmt(
286286
Rule::return_stmt => {
287287
// return ( "(" expr? ")" )?
288288
if !in_function {
289-
return Err(pest::error::Error::new_from_span(
289+
return Err(Box::new(pest::error::Error::new_from_span(
290290
pest::error::ErrorVariant::CustomError {
291291
message: "return outside of function".to_string(),
292292
},
293293
stmt.as_span(),
294-
));
294+
)));
295295
}
296296
let mut inner = stmt.into_inner();
297297
if let Some(expr) = inner.next() {
@@ -381,7 +381,7 @@ fn parse_stmt(
381381
Ok(instruction_count)
382382
}
383383

384-
fn parse_function(func: Pair<Rule>, file: Rc<str>) -> Result<Function, PestError> {
384+
fn parse_function(func: Pair<Rule>, file: Rc<str>) -> Result<Function, Box<PestError>> {
385385
let mut function = func.into_inner();
386386

387387
// define letter ( parameter_list ) auto_define_list statement_list end
@@ -586,7 +586,7 @@ pub fn parse_program(text: &str, file_path: Option<&str>) -> Result<Program, Par
586586
if let Err(e) =
587587
parse_stmt(stmt, false, false, &mut instructions, &mut source_locations)
588588
{
589-
errors.push(e);
589+
errors.push(*e);
590590
}
591591
}
592592
}
@@ -595,7 +595,7 @@ pub fn parse_program(text: &str, file_path: Option<&str>) -> Result<Program, Par
595595
name: f.name,
596596
function: f,
597597
}),
598-
Err(e) => errors.push(e),
598+
Err(e) => errors.push(*e),
599599
},
600600
Rule::EOI => {}
601601
_ => unreachable!(),

screen/stty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ fn stty_show_long(ti: Termios) -> io::Result<()> {
190190
}
191191

192192
// display compact, parse-able form stty values
193+
#[allow(clippy::unnecessary_cast)] // tcflag_t is u64 on macOS, u32 on Linux
193194
fn stty_show_compact(ti: Termios) -> io::Result<()> {
194195
// encode settings as pairs of (String,u64)
195196
let mut tiv = vec![

0 commit comments

Comments
 (0)