Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Commit

Permalink
Rust 1.45 Clippy fixes
Browse files Browse the repository at this point in the history
- Get rid of unit return types in `Fn` types

- Don't use an empty range (`0..1`) instead of an illegal one (`0..0`)
  • Loading branch information
etaoins committed Jul 16, 2020
1 parent b9ef897 commit 8d72937
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion compiler/codegen/mod_gen.rs
Expand Up @@ -188,7 +188,7 @@ impl<'am, 'sl, 'interner> ModCtx<'am, 'sl, 'interner> {
initialise: F,
) -> LLVMValueRef
where
F: FnOnce(LLVMValueRef) -> (),
F: FnOnce(LLVMValueRef),
{
unsafe {
let function = LLVMGetNamedFunction(self.module, name.as_ptr() as *const _);
Expand Down
2 changes: 1 addition & 1 deletion compiler/lib.rs
Expand Up @@ -85,7 +85,7 @@ pub fn program_to_evaluable(

return Err(vec![Diagnostic::error()
.with_message("no main! function defined in entry module")
.with_labels(vec![Label::primary(source_file.file_id(), 0..0)
.with_labels(vec![Label::primary(source_file.file_id(), 0..1)
.with_message("main! function expected in this file")])]);
};

Expand Down
6 changes: 3 additions & 3 deletions compiler/mir/eval_hir.rs
Expand Up @@ -225,7 +225,7 @@ impl EvalHirCtx {
value: Value,
insert_local: &mut F,
) where
F: FnMut(hir::LocalId, Value) -> (),
F: FnMut(hir::LocalId, Value),
{
if let Some(local_id) = scalar.local_id() {
insert_local(*local_id, value);
Expand All @@ -239,7 +239,7 @@ impl EvalHirCtx {
value: Value,
insert_local: &mut F,
) where
F: FnMut(hir::LocalId, Value) -> (),
F: FnMut(hir::LocalId, Value),
{
let mut iter = value.into_unsized_list_iter();

Expand All @@ -259,7 +259,7 @@ impl EvalHirCtx {
value: Value,
insert_local: &mut F,
) where
F: FnMut(hir::LocalId, Value) -> (),
F: FnMut(hir::LocalId, Value),
{
use crate::hir::destruc::Destruc;

Expand Down
4 changes: 2 additions & 2 deletions compiler/tests/integration.rs
Expand Up @@ -340,7 +340,7 @@ async fn result_for_single_test(
"unexpected status {} returned from integration test",
output.status,
))
.with_labels(vec![Label::primary(source_file.file_id(), 0..0)
.with_labels(vec![Label::primary(source_file.file_id(), 0..1)
.with_message("integration test file")])]);
}
}
Expand All @@ -352,7 +352,7 @@ async fn result_for_single_test(
"unexpected status {} returned from integration test",
output.status,
))
.with_labels(vec![Label::primary(source_file.file_id(), 0..0)
.with_labels(vec![Label::primary(source_file.file_id(), 0..1)
.with_message("integration test file")])]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/typeck/destruc.rs
Expand Up @@ -57,7 +57,7 @@ pub fn type_for_decl_destruc(

fn visit_scalar_locals<F>(scalar: &destruc::Scalar<hir::Lowered>, visitor: &mut F)
where
F: FnMut(hir::LocalId, &hir::DeclTy) -> (),
F: FnMut(hir::LocalId, &hir::DeclTy),
{
if let Some(local_id) = scalar.local_id() {
visitor(*local_id, scalar.ty());
Expand All @@ -72,7 +72,7 @@ pub fn visit_locals<F>(
visitor: &mut F,
) -> Option<hir::LocalId>
where
F: FnMut(hir::LocalId, &hir::DeclTy) -> (),
F: FnMut(hir::LocalId, &hir::DeclTy),
{
match destruc {
destruc::Destruc::Scalar(_, ref scalar) => {
Expand Down
2 changes: 1 addition & 1 deletion runtime/persistent/vector.rs
Expand Up @@ -626,7 +626,7 @@ mod test {

fn assert_nodes_deallocated<T>(block: T)
where
T: FnOnce() -> (),
T: FnOnce(),
{
assert_eq!(
0,
Expand Down

0 comments on commit 8d72937

Please sign in to comment.