Ad
  • Custom User Avatar
  • Default User Avatar

    Thanks for your very quick reply, you're absolutely right. Works now :-)

  • Custom User Avatar

    This error is caused by your code, your code doesn't respect the original signature which is fn find_all(sum_dig: u8, digs: u8) -> Option<(usize, u64, u64)>. The testing function in attempt tests contains explicit types, so it cannot pass.

  • Default User Avatar

    Hi! I'm facing a problem in the Rust version.

    Initial tests pass 100% OK, but when submitting for full test suite, the following appears:

    Thank you


    Time: 1060ms Errors: 1Exit Code: 101
    STDERR:
    error[E0308]: mismatched types
    --> src/lib.rs:81:59
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n.try_into().unwrap(), k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:81:62
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n, k.try_into().unwrap()), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:87:59
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n.try_into().unwrap(), k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:87:62
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n, k.try_into().unwrap()), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:93:59
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n.try_into().unwrap(), k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:93:62
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n, k.try_into().unwrap()), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    For more information about this error, try rustc --explain E0308.
    error: could not compile challenge due to 6 previous errors

    NOTE: Line numbers in error messages can be incorrect due to concatenation.

  • Custom User Avatar

    Same problem here.

  • Default User Avatar
  • Custom User Avatar

    which language?

  • Default User Avatar

    when I test my solution everything is fine, but when I attempt, an error appears outside my code:

    In file included from main.cpp:7:
    ./tests.cpp:22:40: error: use of undeclared identifier 'h'
    for (; lowest < 10; lowest++) r += h(n - lowest, digits - 1, lowest);
    ^
    1 error generated.