Skip to content

Check the Self-type of inherent associated constants - #58353

Merged
bors merged 1 commit into
rust-lang:masterfrom
matthewjasper:typeck-pattern-constants
Feb 23, 2019
Merged

Check the Self-type of inherent associated constants#58353
bors merged 1 commit into
rust-lang:masterfrom
matthewjasper:typeck-pattern-constants

Conversation

@matthewjasper

Copy link
Copy Markdown
Contributor

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2019
Comment threadsrc/librustc_mir/hair/pattern/mod.rs Outdated
@matthewjasper
matthewjasperforce-pushed the typeck-pattern-constants branch 2 times, most recently from c468033 to a7ae7a2CompareFebruary 11, 2019 21:10
@matthewjaspermatthewjasper changed the title Handle user type annotations on range patternsCheck the Self-type of inherent associated constantsFeb 11, 2019
@matthewjasper

Copy link
Copy Markdown
ContributorAuthor

Removed the overlap with #58371

Comment threadsrc/librustc_typeck/check/mod.rs Outdated

@arielb1arielb1Feb 12, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

~~Is there some justification for why these checks are enough?~~Found it

If there is, could you write it in a comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even if these checks are enough, shouldn't they be run on the pair (substs, ty)? i.e.

let types = (substs, ty);// yes there are TypeFoldable impls for pairs and optionsif types.has_free_regions() || types.has_projections() || types.has_infer_types(){// ...}

@arielb1arielb1Feb 12, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nah I've seen a comment at https://github.com/rust-lang/rust/blob/a7ae7a21624952f5bfc6aaf88e53351385b89dd4/src/librustc_typeck/check/mod.rs#L2436-L2444

Maybe move the check there it to a separate function (needs_user_type_annotation), while still doing the types trick (where T: TypeFoldable<'tcx> on that function, and then call it)?

@arielb1

Copy link
Copy Markdown
Contributor

r=me with the needs_user_type_annotation function

@matthewjasper
matthewjasperforce-pushed the typeck-pattern-constants branch from a7ae7a2 to 283ffcfCompareFebruary 13, 2019 21:54
@arielb1

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Feb 14, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 283ffcf has been approved by arielb1

@borsbors 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 14, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 14, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 14, 2019
@bors

bors commented Feb 15, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 283ffcf with merge df4ed96c920c6fe2ae1b95fac48321e46808be0b...

@emilyalbini

Copy link
Copy Markdown
Member

@bors treeclosed=1000

@bors

bors commented Feb 15, 2019

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-travis

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 15, 2019
@rust-highfive

Copy link
Copy Markdown
Contributor

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@emilyalbini

Copy link
Copy Markdown
Member

@bors retry -- apparently we can't clone the repo anymore on macOS

@borsbors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 15, 2019
@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 15, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 20, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 20, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 23, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 23, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 23, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 23, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 23, 2019
…nts, r=arielb1
Check the Self-type of inherent associated constants
r? @arielb1
@CentrilCentril mentioned this pull request Feb 23, 2019
bors added a commit that referenced this pull request Feb 23, 2019
Rollup of 16 pull requests
Successful merges:
- #58100 (Transition librustdoc to Rust 2018)
- #58122 (RangeInclusive internal iteration performance improvement.)
- #58199 (Add better error message for partial move)
- #58227 (Updated RELEASES.md for 1.33.0)
- #58353 (Check the Self-type of inherent associated constants)
- #58453 (SGX target: fix panic = abort)
- #58476 (Remove `LazyTokenStream`.)
- #58526 (Special suggestion for illegal unicode curly quote pairs)
- #58595 (Turn duration consts into associated consts)
- #58609 (Allow Self::Module to be mutated.)
- #58628 (Optimise vec![false; N] to zero-alloc)
- #58643 (Don't generate minification variables if minification disabled)
- #58648 (Update tests to account for cross-platform testing and miri.)
- #58654 (Do not underflow after resetting unmatched braces count)
- #58658 (Add expected/provided byte alignments to validation error message)
- #58667 (Reduce Miri-related Code Repetition `like (n << amt) >> amt`)
Failed merges:
r? @ghost
@bors
bors merged commit 283ffcf into rust-lang:masterFeb 23, 2019
@matthewjasper
matthewjasper deleted the typeck-pattern-constants branch February 23, 2019 18:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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

@matthewjasper@arielb1@bors@emilyalbini@rust-highfive