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

Implement better object defaults (RFC #1156) #26370

Merged
merged 6 commits into from Jul 4, 2015

Conversation

Projects
None yet
5 participants
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jun 17, 2015

This is an implementation of RFC rust-lang/rfcs#1156. It includes the code to implement the new rules, but that code is currently disabled. It also includes code to issue warnings when the change will cause breakage. These warnings try hard to be targeted but are also somewhat approximate. They could, with some effort, be made more targeted by adjusting the code in ty_relate that propagates the "will change" flag to consider the specific operation. Might be worth doing.

r? @pnkfelix (I think you understand region inference best)

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:better-object-defaults-warn branch 2 times, most recently from aabe806 to 325f468 Jun 17, 2015

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jun 17, 2015

I went ahead and made the warning more targeted. It was bugging me.

@jroesch

This comment has been minimized.

Copy link
Member

jroesch commented Jun 17, 2015

cc me

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:better-object-defaults-warn branch from ee09ce4 to b4bbc66 Jun 19, 2015

@nikomatsakis nikomatsakis changed the title [NEEDS RFC] Implement better object defaults (RFC #1156) Implement better object defaults (RFC #1156) Jun 19, 2015

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jun 19, 2015

RFC is merged.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 20, 2015

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

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:better-object-defaults-warn branch from b4bbc66 to 9b55ed3 Jun 24, 2015

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jul 1, 2015

@pnkfelix ping (I'll rebase on Fri at the latest...)

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Jul 2, 2015

@nikomatsakis okay it all looks good to me, sorry it took me so long to get around to it.

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:better-object-defaults-warn branch from fc1731a to 0ab544a Jul 3, 2015

nikomatsakis added some commits Jun 17, 2015

Add a boolean flag to ExistentialBounds tracking whether the
region-bound is expected to change in Rust 1.3, but don't use it for
anything in this commit. Note that this is not a "significant" part of
the type (it's not part of the formal model) so we have to normalize
this away or trans starts to get confused because two equal types wind
up with distinct LLVM types.
After inferring regions, scan for any bounds that are due to a lifetime
bound that is likely to change. In that case, it will change to 'static,
so then scan down the graph to see whether there are any hard
constraints that would prevent 'static from being a valid value
here. Report a warning.

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:better-object-defaults-warn branch from 0ab544a to db5f3bc Jul 3, 2015

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jul 3, 2015

marks as beta-accepted

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jul 3, 2015

@bors r+ p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 3, 2015

📌 Commit db5f3bc has been approved by nikomatsakis

bors added a commit that referenced this pull request Jul 4, 2015

Auto merge of #26370 - nikomatsakis:better-object-defaults-warn, r=ni…
…komatsakis

This is an implementation of RFC rust-lang/rfcs#1156. It includes the code to implement the new rules, but that code is currently disabled. It also includes code to issue warnings when the change will cause breakage. These warnings try hard to be targeted but are also somewhat approximate. They could, with some effort, be made *more* targeted by adjusting the code in ty_relate that propagates the "will change" flag to consider the specific operation. Might be worth doing.

r? @pnkfelix (I think you understand region inference best)
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 4, 2015

⌛️ Testing commit db5f3bc with merge 50c952b...

@bors bors merged commit db5f3bc into rust-lang:master Jul 4, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.