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

#44493 add structure for inferred_outlives_of #44857

Merged
merged 8 commits into from
Oct 17, 2017

Conversation

toidiu
Copy link
Contributor

@toidiu toidiu commented Sep 26, 2017

#44493

  • add placeholder for the final implementation of inferred_outlives_of
  • add some placeholder tests

@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 @pnkfelix (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.

@arielb1 arielb1 added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 26, 2017
@toidiu toidiu force-pushed the ak-44493-empty-predicate branch from 52bb9c4 to 5525973 Compare September 28, 2017 23:33
@bors
Copy link
Contributor

bors commented Sep 29, 2017

☔ The latest upstream changes (presumably #44866) made this pull request unmergeable. Please resolve the merge conflicts.

@toidiu
Copy link
Contributor Author

toidiu commented Sep 29, 2017

@nikomatsakis I am getting a cryptic error that I dont know how to address.
error: failed to read /checkout/src/tools/rls/test_data/unicødë/Cargo.toml

nvm got some help on irc. rebase was kicking my butt and i had dirty commits

@toidiu toidiu force-pushed the ak-44493-empty-predicate branch 4 times, most recently from abfd706 to bb50cd4 Compare September 29, 2017 23:39
@bors
Copy link
Contributor

bors commented Sep 30, 2017

☔ The latest upstream changes (presumably #44936) made this pull request unmergeable. Please resolve the merge conflicts.

@toidiu toidiu force-pushed the ak-44493-empty-predicate branch from 9306527 to 150d87b Compare October 2, 2017 03:07
@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

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.

See if those changes work?

@@ -315,6 +319,11 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>)
variance::test::test_variance(tcx));
})?;

tcx.sess.track_errors(|| {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be moved up, I think, to occur right after "type collecting"

#[rustc_outlives]
struct Direct<'a, T> {
// inferred: `T: 'a`
field: &'a T //~ ERROR generic reference may outlive the data it points to
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the problem is that we are running the test too late in the compiler, and hence we get other unrelated errors being reported.

@toidiu toidiu force-pushed the ak-44493-empty-predicate branch 2 times, most recently from 6ef0c56 to 1a4cb46 Compare October 8, 2017 18:45
@toidiu
Copy link
Contributor Author

toidiu commented Oct 8, 2017

@nikomatsakis I fixed my error and am getting a failure from other files. Please advise.

failures:
[compile-fail] compile-fail/dep-graph-assoc-type-trans.rs
[compile-fail] compile-fail/dep-graph-caller-callee.rs
[compile-fail] compile-fail/dep-graph-struct-signature.rs
[compile-fail] compile-fail/dep-graph-trait-impl-two-traits-same-method.rs
[compile-fail] compile-fail/dep-graph-trait-impl-two-traits.rs
[compile-fail] compile-fail/dep-graph-trait-impl.rs
[compile-fail] compile-fail/dep-graph-type-alias.rs
[compile-fail] compile-fail/dep-graph-variance-alias.rs
[compile-fail] compile-fail/dep_graph_crosscontaminate_tables.rs
[compile-fail] compile-fail/incr_comp_with_macro_export.rs

@@ -119,6 +119,9 @@ define_maps! { <'tcx>
/// (inferred) variance.
[] fn variances_of: ItemVariances(DefId) -> Rc<Vec<ty::Variance>>,

/// Maps from def-id of a type to its (inferred) outlives.
[] fn inferred_outlives_of: PredicatesOfItem(DefId) -> Vec<ty::Predicate<'tcx>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think your problem is that you are re-using this PredicatesOfItem dep-node. We need to make an InferredOutlivesOf dep-node. This process is not well documented -- it has been actively changing in the last few days! But roughly speaking you need to add a DepNode variant here and then add a line to this big macro here, essentially copying the model of PredicatesOfItem.

@nikomatsakis
Copy link
Contributor

@toidiu seems like it doesn't quite build yet, I guess you need to write inferred_outlives_of not outlives_of:

DepKind::InferredOutlivesOf => { force!(inferred_outlives_of, def_id!()); }

@toidiu toidiu closed this Oct 11, 2017
@toidiu toidiu reopened this Oct 11, 2017
@toidiu toidiu mentioned this pull request Oct 15, 2017
8 tasks
@bors
Copy link
Contributor

bors commented Oct 16, 2017

☔ The latest upstream changes (presumably #45297) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

@toidiu argh, can you rebase?

toidiu added 6 commits October 16, 2017 14:26
@toidiu toidiu force-pushed the ak-44493-empty-predicate branch from 0e7f5ce to 98c6e0a Compare October 16, 2017 18:26
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 16, 2017

📌 Commit 98c6e0a has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Oct 16, 2017

⌛ Testing commit 98c6e0a with merge 5618aba...

bors added a commit that referenced this pull request Oct 16, 2017
#44493 add structure for inferred_outlives_of

#44493

- add placeholder for the final implementation of inferred_outlives_of
- add some placeholder tests
@bors
Copy link
Contributor

bors commented Oct 17, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 5618aba to master...

@bors bors merged commit 98c6e0a into rust-lang:master Oct 17, 2017
@toidiu toidiu deleted the ak-44493-empty-predicate branch March 22, 2018 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants