-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
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. |
52bb9c4
to
5525973
Compare
☔ The latest upstream changes (presumably #44866) made this pull request unmergeable. Please resolve the merge conflicts. |
@nikomatsakis I am getting a cryptic error that I dont know how to address. nvm got some help on irc. rebase was kicking my butt and i had dirty commits |
abfd706
to
bb50cd4
Compare
☔ The latest upstream changes (presumably #44936) made this pull request unmergeable. Please resolve the merge conflicts. |
9306527
to
150d87b
Compare
There was a problem hiding this 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?
src/librustc_typeck/lib.rs
Outdated
@@ -315,6 +319,11 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) | |||
variance::test::test_variance(tcx)); | |||
})?; | |||
|
|||
tcx.sess.track_errors(|| { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
6ef0c56
to
1a4cb46
Compare
@nikomatsakis I fixed my error and am getting a failure from other files. Please advise.
|
src/librustc/ty/maps/mod.rs
Outdated
@@ -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>>, |
There was a problem hiding this comment.
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
.
@toidiu seems like it doesn't quite build yet, I guess you need to write DepKind::InferredOutlivesOf => { force!(inferred_outlives_of, def_id!()); } |
☔ The latest upstream changes (presumably #45297) made this pull request unmergeable. Please resolve the merge conflicts. |
@toidiu argh, can you rebase? |
…lives. setup some files for upcoming tests
…function of librustc_typeck
dont duplicate error codes choose unlikely error code specify error pattern in test
0e7f5ce
to
98c6e0a
Compare
@bors r+ |
📌 Commit 98c6e0a has been approved by |
☀️ Test successful - status-appveyor, status-travis |
#44493