Skip to content

rustc: Completely forbid borrows of unsafe statics #13083

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

Merged
merged 1 commit into from
Mar 25, 2014

Conversation

flaper87
Copy link
Contributor

It was possible to borrow unsafe static items in static initializers.
This patch implements a small Visitor that walks static initializer's
expressions and checks borrows aliasability.

Fixes #13005

cc @nikomatsakis r?

Summary:
It was possible to borrow unsafe static items in static initializers.
This patch implements a small `Visitor` that walks static initializer's
expressions and checks borrows aliasability.

Fixes rust-lang#13005

Test Plan: make check

Differential Revision: http://phabricator.octayn.net/D2
bors added a commit that referenced this pull request Mar 25, 2014
…, r=nikomatsakis

It was possible to borrow unsafe static items in static initializers.
This patch implements a small `Visitor` that walks static initializer's
expressions and checks borrows aliasability.

Fixes #13005

cc @nikomatsakis r?
@bors bors closed this Mar 25, 2014
@bors bors merged commit 9021a3f into rust-lang:master Mar 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Borrows of unsafe immubtable static items is permitted on constructors
3 participants