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

Projects
None yet
5 participants
@aoikonomopoulos
Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 26, 2019

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))

This comment has been minimized.

@oli-obk

oli-obk Feb 26, 2019

Contributor

Add a comment so that we know we do this to normalize e.g. any unevaluated constants into their evaluated counterpart if possible.

This comment has been minimized.

@aoikonomopoulos

aoikonomopoulos Feb 26, 2019

Author Contributor

Would '// Try to evaluate any associated constants' be an accurate way of phrasing it?

This comment has been minimized.

@oli-obk

oli-obk Feb 26, 2019

Contributor

It's not really associated constants. Maybe

// Try to evaluate array length constants

?

This comment has been minimized.

@aoikonomopoulos

aoikonomopoulos Feb 26, 2019

Author Contributor

Thanks.

@eddyb

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

bors commented Feb 26, 2019

📌 Commit 55539ca has been approved by eddyb

Normalize the type Self resolves to in an impl
This is required at the very least in order to evaluate associated
constants for arrays (see #58212).

@aoikonomopoulos aoikonomopoulos force-pushed the aoikonomopoulos:issue-58212 branch from 55539ca to 9b4055b Feb 26, 2019

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Feb 26, 2019

@bors r+

@bors

This comment has been minimized.

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

Rollup merge of rust-lang#58757 - aoikonomopoulos:issue-58212, r=oli-obk
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

Auto merge of #58763 - Centril:rollup, r=Centril
Rollup of 18 pull requests

Successful merges:

 - #57882 (overhaul unused doc comments lint)
 - #58075 (Fix for issue  #58050)
 - #58627 (rustdoc: move collapse and unindent docs passes earlier)
 - #58629 (rust-lldb: fix crash when printing empty string)
 - #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)
 - #58743 (Add tests for several E-needstest issues)
 - #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)
 - #58750 (Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const)
 - #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)
 - #58762 (Mention `unwind(aborts)` in diagnostics for `#[unwind]`)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019

Rollup merge of rust-lang#58757 - aoikonomopoulos:issue-58212, r=oli-obk
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

Auto merge of #58764 - Centril:rollup, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #57882 (overhaul unused doc comments lint)
 - #58075 (Fix for issue  #58050)
 - #58627 (rustdoc: move collapse and unindent docs passes earlier)
 - #58629 (rust-lldb: fix crash when printing empty string)
 - #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)
 - #58750 (Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const)
 - #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)
 - #58762 (Mention `unwind(aborts)` in diagnostics for `#[unwind]`)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019

Rollup merge of rust-lang#58757 - aoikonomopoulos:issue-58212, r=oli-obk
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

Auto merge of #58766 - Centril:rollup, r=Centril
Rollup of 16 pull requests

Successful merges:

 - #57882 (overhaul unused doc comments lint)
 - #58075 (Fix for issue  #58050)
 - #58627 (rustdoc: move collapse and unindent docs passes earlier)
 - #58629 (rust-lldb: fix crash when printing empty string)
 - #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)
 - #58750 (Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const)
 - #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)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019

Rollup merge of rust-lang#58757 - aoikonomopoulos:issue-58212, r=oli-obk
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

Auto merge of #58770 - Centril:rollup, r=Centril
Rollup of 15 pull requests

Successful merges:

 - #57882 (overhaul unused doc comments lint)
 - #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

Centril added a commit to Centril/rust that referenced this pull request Feb 27, 2019

Rollup merge of rust-lang#58757 - aoikonomopoulos:issue-58212, r=oli-obk
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

Auto merge of #58777 - Centril:rollup, r=Centril
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 added a commit that referenced this pull request Feb 27, 2019

Auto merge of #58777 - Centril:rollup, r=Centril
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 added a commit that referenced this pull request Feb 27, 2019

Auto merge of #58777 - Centril:rollup, r=Centril
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 added a commit that referenced this pull request Feb 27, 2019

Auto merge of #58777 - Centril:rollup, r=Centril
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
You can’t perform that action at this time.