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

nikomatsakis
Copy link
Contributor

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 better-object-defaults-warn branch 2 times, most recently from aabe806 to 325f468 Compare June 17, 2015 16:33
@nikomatsakis
Copy link
Contributor Author

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

@jroesch
Copy link
Member

jroesch commented Jun 17, 2015

cc me

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

RFC is merged.

@bors
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 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 24, 2015
@nikomatsakis
Copy link
Contributor Author

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

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

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.
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 added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jul 3, 2015
@nikomatsakis
Copy link
Contributor Author

marks as beta-accepted

@nikomatsakis
Copy link
Contributor Author

@bors r+ p=1

@bors
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
…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
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
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 8, 2015
@nikomatsakis nikomatsakis deleted the better-object-defaults-warn branch March 30, 2016 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants