-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Allow trait methods to be called on concrete types in a const context #68847
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
62ff11f
Add `is_const_impl_raw` query
ecstatic-morse 3e0b060
Const-check functions in a `const` impl
ecstatic-morse 5e422ef
Remove "not yet implemented" warning
ecstatic-morse 7a019b1
Check for trait methods on concrete types in const checking
ecstatic-morse 323ff19
Add tests for calling trait methods on concrete types
ecstatic-morse d6d6d25
Split const trait method test and impl `ops::Add`
ecstatic-morse 70f7879
Ensure const impl cannot coexist with non-const impl
ecstatic-morse 0a5abca
Use early return when forbidding unstable attrs
ecstatic-morse 8e7609b
Propagate `rustc_const_unstable` to children
ecstatic-morse 4992eb2
Test `rustc_const_unstable` on trait fns
ecstatic-morse c8f0abb
Add ignored test for associated types in const impl
ecstatic-morse 9a36824
Remove outdated FIXME
ecstatic-morse 160e630
Add passing test for `Add` on generic struct
ecstatic-morse cb81712
Make `fn_queries` helpers module-private
ecstatic-morse 5f06ce2
Prevent const trait methods from being marked stable
ecstatic-morse 19801b1
Update tests
ecstatic-morse 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 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 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 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 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 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
Oops, something went wrong.
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.
As long as
self.param_env
istcx.param_env(some_def_id)
without calling.with_reveal_all()
or w/e, it should be fine.