-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Add forever unstable attribute to allow specifying arbitrary scalar ranges #54032
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
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d272e2f
Get rid of the `non_zero` lang item in favour of arbitrary range spec…
oli-obk 06a041c
Forbid the upper indices of `IndexVec` indices to allow for niche opt…
oli-obk 3828e9e
Use the same way to specifiy the `SCOPE_DATA_*` constants as used for…
oli-obk a2c924b
Satisfy tidy
oli-obk 833dc7e
Address attribute naming and use `Bound` enum
oli-obk 88ebb95
only allow restricting scalar layouts
oli-obk 24dca6a
Simplify Scope/ScopeData to have less chance of introducing UB or siz…
oli-obk d1b5231
Fix const eval of ZST index operations to make the static assertion work
oli-obk 1ec8670
Split `CrateNum` into an enum instead of having magic constants
oli-obk 8053f63
Rebase fallout
oli-obk 68298a5
Use assertion-like static assertions
oli-obk 5f42a0f
Change debug printing to print in the old concise style
oli-obk f3417c5
Properly access `std::mem::size_of`
oli-obk 79f2cc0
Silence dead code warning for the assertion statics
oli-obk a94c166
Add missing #![feature(min_const_fn)] to the newtype_index test.
eddyb 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,5 +1,5 @@ | ||
| // compile-pass | ||
|
|
||
| static ASSERT: () = [()][(std::mem::size_of::<u32>() != 4) as usize]; | ||
| static ASSERT: () = [()][!(std::mem::size_of::<u32>() == 4) as usize]; | ||
|
|
||
| fn main() {} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to use the
fmt.debug_structwrapper, to automate this.