mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Remove unnecessary -> () function return types
This commit is contained in:
parent
7a353f0e0c
commit
9c72e5e8ed
13 changed files with 26 additions and 26 deletions
|
@ -318,7 +318,7 @@ impl {name} {{
|
||||||
r#"
|
r#"
|
||||||
/// Other `into_` methods return a payload, but since the {tag_name} tag
|
/// Other `into_` methods return a payload, but since the {tag_name} tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub fn into_{tag_name}(self) -> () {{
|
pub fn into_{tag_name}(self) {{
|
||||||
()
|
()
|
||||||
}}"#,
|
}}"#,
|
||||||
)?;
|
)?;
|
||||||
|
@ -329,7 +329,7 @@ impl {name} {{
|
||||||
r#"
|
r#"
|
||||||
/// Other `as` methods return a payload, but since the {tag_name} tag
|
/// Other `as` methods return a payload, but since the {tag_name} tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub unsafe fn as_{tag_name}(&self) -> () {{
|
pub unsafe fn as_{tag_name}(&self) {{
|
||||||
()
|
()
|
||||||
}}"#,
|
}}"#,
|
||||||
)?;
|
)?;
|
||||||
|
@ -904,7 +904,7 @@ impl {name} {{
|
||||||
r#"
|
r#"
|
||||||
/// Other `into_` methods return a payload, but since the {null_tag} tag
|
/// Other `into_` methods return a payload, but since the {null_tag} tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub fn into_{null_tag}(self) -> () {{
|
pub fn into_{null_tag}(self) {{
|
||||||
()
|
()
|
||||||
}}"#,
|
}}"#,
|
||||||
)?;
|
)?;
|
||||||
|
@ -915,7 +915,7 @@ impl {name} {{
|
||||||
r#"
|
r#"
|
||||||
/// Other `as` methods return a payload, but since the {null_tag} tag
|
/// Other `as` methods return a payload, but since the {null_tag} tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub unsafe fn as_{null_tag}(&self) -> () {{
|
pub unsafe fn as_{null_tag}(&self) {{
|
||||||
()
|
()
|
||||||
}}"#,
|
}}"#,
|
||||||
)?;
|
)?;
|
||||||
|
|
|
@ -250,13 +250,13 @@ fn tag_union_aliased() {
|
||||||
|
|
||||||
/// Other `into_` methods return a payload, but since the Baz tag
|
/// Other `into_` methods return a payload, but since the Baz tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub fn into_Baz(self) -> () {
|
pub fn into_Baz(self) {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Other `as` methods return a payload, but since the Baz tag
|
/// Other `as` methods return a payload, but since the Baz tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub unsafe fn as_Baz(&self) -> () {
|
pub unsafe fn as_Baz(&self) {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,13 +586,13 @@ fn cons_list_of_strings() {
|
||||||
|
|
||||||
/// Other `into_` methods return a payload, but since the Nil tag
|
/// Other `into_` methods return a payload, but since the Nil tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub fn into_Nil(self) -> () {
|
pub fn into_Nil(self) {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Other `as` methods return a payload, but since the Nil tag
|
/// Other `as` methods return a payload, but since the Nil tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub unsafe fn as_Nil(&self) -> () {
|
pub unsafe fn as_Nil(&self) {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -708,13 +708,13 @@ fn cons_list_of_ints() {
|
||||||
|
|
||||||
/// Other `into_` methods return a payload, but since the Empty tag
|
/// Other `into_` methods return a payload, but since the Empty tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub fn into_Empty(self) -> () {
|
pub fn into_Empty(self) {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Other `as` methods return a payload, but since the Empty tag
|
/// Other `as` methods return a payload, but since the Empty tag
|
||||||
/// has no payload, this does nothing and is only here for completeness.
|
/// has no payload, this does nothing and is only here for completeness.
|
||||||
pub unsafe fn as_Empty(&self) -> () {
|
pub unsafe fn as_Empty(&self) {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ fn bench_group_wall_time(c: &mut Criterion) {
|
||||||
|
|
||||||
group.sample_size(nr_of_runs);
|
group.sample_size(nr_of_runs);
|
||||||
|
|
||||||
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<WallTime>>) -> ()> = vec![
|
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<WallTime>>)> = vec![
|
||||||
bench_nqueens, // queens 11
|
bench_nqueens, // queens 11
|
||||||
bench_cfold, // e = mkExpr 17 1
|
bench_cfold, // e = mkExpr 17 1
|
||||||
bench_deriv, // nest deriv 8 f
|
bench_deriv, // nest deriv 8 f
|
||||||
|
|
|
@ -56,11 +56,11 @@ macro_rules! run_jit_function {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let main: libloading::Symbol<unsafe extern "C" fn(*mut RocCallResult<$ty>) -> ()> =
|
let main: libloading::Symbol<unsafe extern "C" fn(*mut RocCallResult<$ty>)> = $lib
|
||||||
$lib.get($main_fn_name.as_bytes())
|
.get($main_fn_name.as_bytes())
|
||||||
.ok()
|
.ok()
|
||||||
.ok_or(format!("Unable to JIT compile `{}`", $main_fn_name))
|
.ok_or(format!("Unable to JIT compile `{}`", $main_fn_name))
|
||||||
.expect("errored");
|
.expect("errored");
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct Failures {
|
struct Failures {
|
||||||
|
|
|
@ -33,7 +33,7 @@ where
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn with_larger_debug_stack<F>(run_test: F)
|
pub fn with_larger_debug_stack<F>(run_test: F)
|
||||||
where
|
where
|
||||||
F: FnOnce() -> (),
|
F: FnOnce(),
|
||||||
F: Send,
|
F: Send,
|
||||||
F: 'static,
|
F: 'static,
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ where
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn with_larger_debug_stack<F>(run_test: F)
|
pub fn with_larger_debug_stack<F>(run_test: F)
|
||||||
where
|
where
|
||||||
F: FnOnce() -> (),
|
F: FnOnce(),
|
||||||
F: Send,
|
F: Send,
|
||||||
F: 'static,
|
F: 'static,
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ where
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn with_larger_debug_stack<F>(run_test: F)
|
pub fn with_larger_debug_stack<F>(run_test: F)
|
||||||
where
|
where
|
||||||
F: FnOnce() -> (),
|
F: FnOnce(),
|
||||||
F: Send,
|
F: Send,
|
||||||
F: 'static,
|
F: 'static,
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub fn mono_test(_args: TokenStream, item: TokenStream) -> TokenStream {
|
||||||
let result = quote! {
|
let result = quote! {
|
||||||
#[test]
|
#[test]
|
||||||
#(#attributes)*
|
#(#attributes)*
|
||||||
#visibility fn #name(#args) -> () {
|
#visibility fn #name(#args) {
|
||||||
compiles_to_ir(#name_str, #body);
|
compiles_to_ir(#name_str, #body);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern "C" {
|
||||||
// program
|
// program
|
||||||
|
|
||||||
#[link_name = "roc__programForHost_1_exposed_generic"]
|
#[link_name = "roc__programForHost_1_exposed_generic"]
|
||||||
fn roc_program() -> ();
|
fn roc_program();
|
||||||
|
|
||||||
#[link_name = "roc__programForHost_size"]
|
#[link_name = "roc__programForHost_size"]
|
||||||
fn roc_program_size() -> i64;
|
fn roc_program_size() -> i64;
|
||||||
|
|
|
@ -19,7 +19,7 @@ extern "C" {
|
||||||
fn roc_main_size() -> i64;
|
fn roc_main_size() -> i64;
|
||||||
|
|
||||||
#[link_name = "roc__mainForHost_1_Fx_caller"]
|
#[link_name = "roc__mainForHost_1_Fx_caller"]
|
||||||
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8) -> ();
|
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8);
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[link_name = "roc__mainForHost_1_Fx_size"]
|
#[link_name = "roc__mainForHost_1_Fx_size"]
|
||||||
|
|
|
@ -10,13 +10,13 @@ use std::os::raw::c_char;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#[link_name = "roc__mainForHost_1_exposed_generic"]
|
#[link_name = "roc__mainForHost_1_exposed_generic"]
|
||||||
fn roc_main(output: *mut u8) -> ();
|
fn roc_main(output: *mut u8);
|
||||||
|
|
||||||
#[link_name = "roc__mainForHost_size"]
|
#[link_name = "roc__mainForHost_size"]
|
||||||
fn roc_main_size() -> i64;
|
fn roc_main_size() -> i64;
|
||||||
|
|
||||||
#[link_name = "roc__mainForHost_1_Fx_caller"]
|
#[link_name = "roc__mainForHost_1_Fx_caller"]
|
||||||
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8) -> ();
|
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8);
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[link_name = "roc__mainForHost_1_Fx_size"]
|
#[link_name = "roc__mainForHost_1_Fx_size"]
|
||||||
|
|
|
@ -13,7 +13,7 @@ fn bench_group(c: &mut Criterion<Perf>, hw_event_str: &str) {
|
||||||
// calculate statistics based on a fixed(flat) 100 runs
|
// calculate statistics based on a fixed(flat) 100 runs
|
||||||
group.sampling_mode(SamplingMode::Flat);
|
group.sampling_mode(SamplingMode::Flat);
|
||||||
|
|
||||||
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<Perf>>) -> ()> = vec![
|
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<Perf>>)> = vec![
|
||||||
bench_nqueens,
|
bench_nqueens,
|
||||||
bench_cfold,
|
bench_cfold,
|
||||||
bench_deriv,
|
bench_deriv,
|
||||||
|
|
|
@ -82,7 +82,7 @@ where
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn with_larger_debug_stack<F>(run_test: F)
|
pub fn with_larger_debug_stack<F>(run_test: F)
|
||||||
where
|
where
|
||||||
F: FnOnce() -> (),
|
F: FnOnce(),
|
||||||
F: Send,
|
F: Send,
|
||||||
F: 'static,
|
F: 'static,
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue