-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Trigger warnings for unused wasm-bindgen attributes #3073
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
Merged
alexcrichton
merged 6 commits into
wasm-bindgen:main
from
RReverser:unused-attr-warnings
Sep 8, 2022
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
84d6c85
Trigger warnings for unused wasm-bindgen attributes
RReverser 91334cc
Guide users who used the suggested (invalid) fix (#1)
lukaslihotzki d43124d
Deprecate strict-macro feature; update tests
RReverser a6d1d9e
Skip anonymous scope if there are no unused attrs
RReverser b8d612c
Fix unused-attr check for reserved attribute names
RReverser 73e82c1
Remove defunct deprecation warning
RReverser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
error: unused #[wasm_bindgen] attribute | ||
--> $DIR/unused-attributes.rs:7:20 | ||
error: unused variable: `method` | ||
--> ui-tests/unused-attributes.rs:9:20 | ||
| | ||
7 | #[wasm_bindgen(method)] | ||
| ^^^^^^ | ||
|
||
error: unused #[wasm_bindgen] attribute | ||
--> $DIR/unused-attributes.rs:8:20 | ||
9 | #[wasm_bindgen(method)] | ||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method` | ||
| | ||
note: the lint level is defined here | ||
--> ui-tests/unused-attributes.rs:1:9 | ||
| | ||
8 | #[wasm_bindgen(method)] | ||
| ^^^^^^ | ||
1 | #![deny(unused_variables)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: unused variable: `getter` | ||
--> ui-tests/unused-attributes.rs:18:16 | ||
| | ||
18 | #[wasm_bindgen(getter, typescript_custom_section)] | ||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_getter` | ||
|
||
error: unused variable: `readonly` | ||
--> ui-tests/unused-attributes.rs:21:16 | ||
| | ||
21 | #[wasm_bindgen(readonly)] | ||
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_readonly` | ||
|
||
error: unused variable: `getter_with_clone` | ||
--> ui-tests/unused-attributes.rs:24:16 | ||
| | ||
24 | #[wasm_bindgen(getter_with_clone, final)] | ||
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_getter_with_clone` | ||
|
||
error: unused variable: `final` | ||
--> ui-tests/unused-attributes.rs:24:35 | ||
| | ||
24 | #[wasm_bindgen(getter_with_clone, final)] | ||
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_final` | ||
|
||
error: unused variable: `typescript_type` | ||
--> ui-tests/unused-attributes.rs:26:28 | ||
| | ||
26 | #[wasm_bindgen(getter, typescript_type = "Thing[]")] | ||
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_typescript_type` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.