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

Point at associated type for some obligations #65288

Merged
merged 7 commits into from
Oct 27, 2019

Conversation

estebank
Copy link
Contributor

Partially address #57663.

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 10, 2019
@rust-highfive

This comment has been minimized.

@cramertj
Copy link
Member

I don't think I'm the best reviewer for this, but I'm not sure who is.

@estebank
Copy link
Contributor Author

Maybe @nikomatsakis?

@rust-highfive

This comment has been minimized.

@Centril
Copy link
Contributor

Centril commented Oct 11, 2019

@bors try

@bors
Copy link
Contributor

bors commented Oct 11, 2019

⌛ Trying commit cbd994b with merge afb10f4...

bors added a commit that referenced this pull request Oct 11, 2019
Point at associated type for some obligations

Partially address #57663.
@bors
Copy link
Contributor

bors commented Oct 11, 2019

☀️ Try build successful - checks-azure
Build commit: afb10f4 (afb10f4c27d428d90c167e912bb259891cd14f5c)

@Centril
Copy link
Contributor

Centril commented Oct 11, 2019

@rust-timer build afb10f4

@rust-timer
Copy link
Collaborator

Queued afb10f4 with parent 000d90b, future comparison URL.

@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit afb10f4, comparison URL.

@Centril
Copy link
Contributor

Centril commented Oct 12, 2019

Perf looks clean

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

This looks nice @estebank! I have some minor suggestions around refactoring.

src/librustc/ty/wf.rs Outdated Show resolved Hide resolved
src/librustc/ty/wf.rs Outdated Show resolved Hide resolved
@estebank
Copy link
Contributor Author

@nikomatsakis let me know if there are any outstanding changes you'd like me to do.

let obligations = self.nominal_obligations(trait_ref.def_id, trait_ref.substs);

let cause = self.cause(traits::MiscObligation);
let param_env = self.param_env;

let item = &self.item;
let extend_cause_with_original_assoc_item_obligation = |
Copy link
Contributor

Choose a reason for hiding this comment

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

Heh. Personally I'd have preferred to see this be a separate method, but I can accept this =) I do like the comments!

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2019

📌 Commit 3a4cacd has been approved by nikomatsakis

@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 Oct 25, 2019
@bors
Copy link
Contributor

bors commented Oct 26, 2019

⌛ Testing commit 3a4cacd with merge e39dd255a4db06727866034e3a5288ddbf2b8fc4...

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, 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.
2019-10-26T04:05:26.6882267Z Chocolatey installed 0/1 packages. 1 packages failed.
2019-10-26T04:05:26.6882373Z  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-10-26T04:05:26.6886488Z 
2019-10-26T04:05:26.6890979Z Failures
2019-10-26T04:05:26.6897973Z  - msys2 (exited 1) - msys2 not installed. An error occurred during installation:
2019-10-26T04:05:26.6898130Z  The remote server returned an error: (503) Server Unavailable. Service Unavailable
2019-10-26T04:05:27.2648320Z 
2019-10-26T04:05:27.2727921Z ##[error]Bash exited with code '1'.
2019-10-26T04:05:27.2941242Z ##[section]Starting: Upload CPU usage statistics
2019-10-26T04:05:27.3050467Z ==============================================================================
2019-10-26T04:05:27.3050558Z Task         : Bash
2019-10-26T04:05:27.3050647Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-10-26T04:05:27.5921823Z ========================== Starting Command Output ===========================
2019-10-26T04:05:27.5928678Z [command]"C:\Program Files\Git\bin\bash.exe" --noprofile --norc /d/a/_temp/14d1e8ad-af68-4cae-99bd-2df7273327fa.sh
2019-10-26T04:05:27.6371201Z /d/a/_temp/14d1e8ad-af68-4cae-99bd-2df7273327fa.sh: line 1: aws: command not found
2019-10-26T04:05:27.6403752Z 
2019-10-26T04:05:27.6425409Z ##[error]Bash exited with code '127'.
2019-10-26T04:05:27.6504119Z ##[section]Starting: Checkout
2019-10-26T04:05:27.6605334Z ==============================================================================
2019-10-26T04:05:27.6605441Z Task         : Get sources
2019-10-26T04:05:27.6605711Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@bors
Copy link
Contributor

bors commented Oct 26, 2019

💔 Test failed - checks-azure

@bors bors 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 Oct 26, 2019
@JohnTitor
Copy link
Member

It's a network error.
@bors retry

@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 Oct 26, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 26, 2019
…omatsakis

Point at associated type for some obligations

Partially address rust-lang#57663.
bors added a commit that referenced this pull request Oct 27, 2019
Point at associated type for some obligations

Partially address #57663.
@bors
Copy link
Contributor

bors commented Oct 27, 2019

⌛ Testing commit 3a4cacd with merge cf148a7...

@bors
Copy link
Contributor

bors commented Oct 27, 2019

☀️ Test successful - checks-azure
Approved by: nikomatsakis
Pushing cf148a7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 27, 2019
@bors bors merged commit 3a4cacd into rust-lang:master Oct 27, 2019
@@ -47,8 +50,9 @@ pub fn trait_obligations<'a, 'tcx>(
body_id: hir::HirId,
trait_ref: &ty::TraitRef<'tcx>,
span: Span,
item: Option<&'tcx hir::Item>,
Copy link
Member

Choose a reason for hiding this comment

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

I don't think passing around references to the HIR fits ty::wf, this can just be an Option<DefId> and should probably be named something more suggestive.

let obligations = self.nominal_obligations(trait_ref.def_id, trait_ref.substs);

let cause = self.cause(traits::MiscObligation);
let param_env = self.param_env;

let item = &self.item;
Copy link
Member

Choose a reason for hiding this comment

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

No need to borrow a Copy field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

9 participants