You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As commented in #1127 here: #1127 (comment) there are two confusing error messages when compiling with --test without "use std":
$ cat ./test_compile_error_example.rs
fn inc_int(x: int) -> int { x + 1 }
#[test]
fn test_inc_int() {
assert (inc_int(3) == 4);
}
$ rustc --test ./test_compile_error_example.rs
./test_compile_error_example.rs:1:0: 1:0 error: unresolved name
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
./test_compile_error_example.rs:1:0: 1:0 error: use of undeclared module `std::test`
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
./test_compile_error_example.rs:1:0: 1:0 error: unresolved name: std::test::test_main
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
./test_compile_error_example.rs:1:0: 1:0 error: unresolved name
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
./test_compile_error_example.rs:1:0: 1:0 error: use of undeclared module `std::test`
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
./test_compile_error_example.rs:1:0: 1:0 error: use of undeclared type name `std::test::test_desc`
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
error: aborting due to 6 previous errors
The first and fourth error message are quite ambiguous. Both say this:
./test_compile_error_example.rs:1:0: 1:0 error: unresolved name
./test_compile_error_example.rs:1 fn inc_int(x: int) -> int { x + 1 }
^
Which name is unresolved? All identifiers in the given text are either declared ("inc_int" and "x") or should be in scope ("int" and "x").
This issue would be fixed by including the name in the error message which is unresolvable.
Note that even this fix may still yield confusing error messages due to other issues, such as #1448 or #1127, but this issue is distinct and should be separately addressed.
The text was updated successfully, but these errors were encountered:
Error in question no longer occurs with this input; can still provoke with a bad path but it's not as serious since it's not synthetic. In any case, not fixing for 0.6 so de-milestoning.
RFC describing the support for existential and universal quantifiers in
Kani.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
---------
Signed-off-by: Felipe R. Monteiro <[email protected]>
As commented in #1127 here: #1127 (comment) there are two confusing error messages when compiling with --test without "use std":
The first and fourth error message are quite ambiguous. Both say this:
Which name is unresolved? All identifiers in the given text are either declared ("inc_int" and "x") or should be in scope ("int" and "x").
This issue would be fixed by including the name in the error message which is unresolvable.
Note that even this fix may still yield confusing error messages due to other issues, such as #1448 or #1127, but this issue is distinct and should be separately addressed.
The text was updated successfully, but these errors were encountered: