Skip to content
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

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

aoikonomopoulos
Copy link
Contributor

@aoikonomopoulos aoikonomopoulos commented Feb 26, 2019

This is required at the very least in order to evaluate associated
constants for arrays.

Fixes #57796
Fixes #58212.

r? @oli-obk
cc @hellow554

@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 26, 2019
@@ -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))
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@eddyb
Copy link
Member

eddyb commented Feb 26, 2019

normalize_ty only does something in the rustc_check::check::FnCtxt implementation, so this is a reasonable bugfix (even if it should become irrelevant in the future).

@bors r+

@bors
Copy link
Contributor

bors commented Feb 26, 2019

📌 Commit 55539ca863245481e23fdf2fd1ea5362da2bbfe4 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2019
This is required at the very least in order to evaluate associated
constants for arrays (see rust-lang#58212).
@oli-obk
Copy link
Contributor

oli-obk commented Feb 26, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Feb 26, 2019

📌 Commit 9b4055b has been approved by oli-obk

Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019
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
Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019
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
Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019
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
Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019
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
Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019
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
bors added a commit that referenced this pull request Feb 27, 2019
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
@bors bors merged commit 9b4055b into rust-lang:master Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants