]> git.lizzy.rs Git - rust.git/commit
Auto merge of #34443 - eddyb:sized-matters, r=arielb1
authorbors <bors@rust-lang.org>
Sat, 2 Jul 2016 16:36:52 +0000 (09:36 -0700)
committerGitHub <noreply@github.com>
Sat, 2 Jul 2016 16:36:52 +0000 (09:36 -0700)
commite85adffd6402acce79887e1b911ff33841c6133a
treefd0240798a92e6f437bf539fe03b646b8094ed0f
parent7a262d303489fcbd8410b4e4cecc563b06799e16
parentfe7207f6afed3b4727d5228d573803c165a80477
Auto merge of #34443 - eddyb:sized-matters, r=arielb1

Disallow constants and statics from having unsized types.

This is a `[breaking-change]` which fixes #34390 by banning unsized `const` and `static`, e.g.:
```rust
const A: [i32] = *(&[0, 1, 2] as &[i32]);
static B: str = *"foo";
```

This was not intentionally allowed, and other than for `static` since some versions ago, it ICE'd.
If you've been taking advantage of this with `static`, you should be able to just use references instead.
src/librustc/traits/error_reporting.rs
src/librustc/traits/mod.rs
src/librustc_typeck/check/mod.rs