Skip to content

Error out when using static_assert on a non-boolean value #22907

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 1, 2015

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Feb 28, 2015

static_assert is documented as working on static with type bool, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes #22056

static_assert is documented as working on static with type `bool`, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes rust-lang#22056
@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@eddyb
Copy link
Member

eddyb commented Feb 28, 2015

r? @eddyb @bors r+ d11b48c rollup

@rust-highfive rust-highfive assigned eddyb and unassigned pcwalton Feb 28, 2015
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 28, 2015
 static_assert is documented as working on static with type `bool`, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes rust-lang#22056
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 1, 2015
 static_assert is documented as working on static with type `bool`, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes rust-lang#22056
@bors bors merged commit d11b48c into rust-lang:master Mar 1, 2015
@dotdash dotdash deleted the static_assert_bool branch March 1, 2015 19:21
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.

Non-primitive-types static assertions result in an LLVM failure
5 participants