-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Normalize the type Self resolves to in an impl #58757
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -1700,7 +1700,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { | |||
// `Self` in impl (we know the concrete type). | |||
assert_eq!(opt_self_ty, None); | |||
self.prohibit_generics(&path.segments); | |||
tcx.at(span).type_of(def_id) | |||
self.normalize_ty(span, tcx.at(span).type_of(def_id)) |
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.
Add a comment so that we know we do this to normalize e.g. any unevaluated constants into their evaluated counterpart if possible.
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.
Would '// Try to evaluate any associated constants' be an accurate way of phrasing it?
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.
It's not really associated constants. Maybe
// Try to evaluate array length constants
?
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.
Thanks.
@bors r+ |
📌 Commit 55539ca863245481e23fdf2fd1ea5362da2bbfe4 has been approved by |
This is required at the very least in order to evaluate associated constants for arrays (see rust-lang#58212).
55539ca
to
9b4055b
Compare
@bors r+ |
📌 Commit 9b4055b has been approved by |
Normalize the type Self resolves to in an impl This is required at the very least in order to evaluate associated constants for arrays. Fixes rust-lang#57796 Fixes rust-lang#58212. r? @oli-obk cc @hellow554
Normalize the type Self resolves to in an impl This is required at the very least in order to evaluate associated constants for arrays. Fixes rust-lang#57796 Fixes rust-lang#58212. r? @oli-obk cc @hellow554
Normalize the type Self resolves to in an impl This is required at the very least in order to evaluate associated constants for arrays. Fixes rust-lang#57796 Fixes rust-lang#58212. r? @oli-obk cc @hellow554
Normalize the type Self resolves to in an impl This is required at the very least in order to evaluate associated constants for arrays. Fixes rust-lang#57796 Fixes rust-lang#58212. r? @oli-obk cc @hellow554
Normalize the type Self resolves to in an impl This is required at the very least in order to evaluate associated constants for arrays. Fixes rust-lang#57796 Fixes rust-lang#58212. r? @oli-obk cc @hellow554
Rollup of 14 pull requests Successful merges: - #58075 (Fix for issue #58050) - #58627 (rustdoc: move collapse and unindent docs passes earlier) - #58630 (Make `visit_clobber` panic-safe.) - #58678 (Deny `async fn` in 2015 edition) - #58680 (Fix an indexing error when using `x.py help`) - #58703 (Fix copy-pasted typo for read_string return value) - #58744 (Update dlmalloc to 0.1.3) - #58746 (std: docs: Disable running several Stdio doctests) - #58748 (update scoped_tls to 1.0) - #58749 (Reduce Repetitions of (n << amt) >> amt) - #58752 (Update string_cache_codegen to 0.4.2) - #58755 (Clarify `rotate_{left,right}` docs) - #58757 (Normalize the type Self resolves to in an impl) - #58761 (Add tracking issue for the unwind attribute) Failed merges: r? @ghost
This is required at the very least in order to evaluate associated
constants for arrays.
Fixes #57796
Fixes #58212.
r? @oli-obk
cc @hellow554