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.
Introduced Changes
Context (heh): #535
Removes
pub
tags from allCreationContext
andCycleContext
struct members since they are unnecessary and prevent detection of unused fields.Also adds a check to our source analyzer which makespub
fields in contexts a compilation error with the exception ofMainOutput
fields.I had wanted to make this a warning, but it appears that warnings from proc macros are only emitted on nightly.
There exists a proc-macro-warning crate, but that only supports deprecation warnings via a hack.
An alternative approach I considered is be to have the context macro strip the pub tag. This would allow detecting unused fields but also allows inconsistency and at least in my editor screws with the syntax highlighting.Fixes #
ToDo / Known Issues
Ideas for Next Iterations (Not This PR)
Find a way to emit warnings
How to Test
Making any context fieldpub
should result in a an error.