Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix refined error spans. #15

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions janetrs_macros/tests/01-paths.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ error: expected to be a `janetrs::Janet`
--> tests/01-paths:12:31
|
12 | pub fn function2(_args: &mut [tips::Janet]) -> types::Janet {
| ^^^^^^^^^^^
| ^^^^

error: expected to be a `janetrs::Janet`
--> tests/01-paths:17:31
|
17 | pub fn function3(_args: &mut [types::Janet]) {}
| ^^^^^^^^^^^^
| ^^^^^
2 changes: 1 addition & 1 deletion janetrs_macros/tests/02-not-function.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error: expected fn item
--> tests/02-not-function:4:1
|
4 | struct A(i32);
| ^^^^^^^^^^^^^^
| ^^^^^^
2 changes: 1 addition & 1 deletion janetrs_macros/tests/03-not-mut.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error: expected argument to be a mutable reference and found a immutable referen
--> tests/03-not-mut:7:24
|
7 | pub fn function(_args: &[Janet]) -> Janet {
| ^^^^^^^^
| ^
2 changes: 1 addition & 1 deletion janetrs_macros/tests/05-wrong-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error: expected exactly one argument of type `&mut [janetrs::Janet]`
--> tests/05-wrong-args:7:17
|
7 | pub fn function(_args: &mut [Janet], _wrong: Janet) -> Janet {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^
2 changes: 1 addition & 1 deletion janetrs_macros/tests/08-wrong-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ error: repeated argument kind: There must be only one argument of each kind, tha
--> tests/08-wrong-args:30:12
|
30 | #[janet_fn(check_mut_ref, check_mut_ref)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^

error: expected a maximum of two arguments to the janet_fn proc-macro
--> tests/08-wrong-args:35:42
Expand Down
4 changes: 2 additions & 2 deletions janetrs_macros/tests/09-version-wrong.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ error: invalid string literal: invalid digit found in string
| ^^^^^

error: expected at max two arguments to the janet_version proc-macro
--> tests/09-version-wrong:28:17
--> tests/09-version-wrong:28:27
|
28 | #[janet_version("1", "2", "3")]
| ^^^^^^^^^^^^^
| ^^^