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

Fix checking for missing stability annotations #43270

Merged
merged 1 commit into from
Jul 20, 2017

Conversation

petrochenkov
Copy link
Contributor

This was a regression from #37676 causing "unmarked API" ICEs like #43027.

r? @alexcrichton

Remove couple of unnecessary `#![feature(staged_api)]`.
@@ -313,8 +313,9 @@ struct MissingStabilityAnnotations<'a, 'tcx: 'a> {
impl<'a, 'tcx: 'a> MissingStabilityAnnotations<'a, 'tcx> {
fn check_missing_stability(&self, id: NodeId, span: Span) {
let def_id = self.tcx.hir.local_def_id(id);
let stab = self.tcx.stability.borrow().stab_map.get(&def_id).cloned();
Copy link
Member

Choose a reason for hiding this comment

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

While I doubt this has any serious implications, the cloned here seems unnecessary since AFAICT we never use anything but (one of) the None variants inside. Could we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It clones a reference to Stability, not Stability itself. cloned is necessary to avoid borrow checking error with a short living temporary.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, so just to clarify this goes from &&T to &T? Unfortunate that it causes borrow checking problems. Perhaps map_or could help?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, so just to clarify this goes from &&T to &T?

Yes.

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2017
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 17, 2017

📌 Commit 465ada6 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jul 18, 2017

⌛ Testing commit 465ada6 with merge c0197fc9ba050444dde555c7dc1ab6421ebcfb81...

@bors
Copy link
Contributor

bors commented Jul 18, 2017

💔 Test failed - status-travis

@est31
Copy link
Member

est31 commented Jul 18, 2017

@bors retry

@bors
Copy link
Contributor

bors commented Jul 19, 2017

⌛ Testing commit 465ada6 with merge 4dd8fc7022179c93bd79f9666927d27f6e29898c...

@bors
Copy link
Contributor

bors commented Jul 19, 2017

💔 Test failed - status-appveyor

@alexcrichton
Copy link
Member

alexcrichton commented Jul 19, 2017 via email

@bors
Copy link
Contributor

bors commented Jul 20, 2017

⌛ Testing commit 465ada6 with merge 1edbc3d...

bors added a commit that referenced this pull request Jul 20, 2017
Fix checking for missing stability annotations

This was a regression from #37676 causing "unmarked API" ICEs like #43027.

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Jul 20, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 1edbc3d to master...

@bors bors merged commit 465ada6 into rust-lang:master Jul 20, 2017
@petrochenkov petrochenkov deleted the fixstab branch August 26, 2017 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants