]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk
authorkennytm <kennytm@gmail.com>
Fri, 15 Feb 2019 16:55:49 +0000 (00:55 +0800)
committerkennytm <kennytm@gmail.com>
Sat, 16 Feb 2019 06:11:30 +0000 (14:11 +0800)
commit49107c3398c88c7d46ada7285a953089b8e87864
treefaa56ccc07c8872df87e324578d004d0b64bd360
parentf05e6bf7089fa3d5f3b490eb8d9fc89bc044604d
parent8ca44069bbd8df4d88b08a0fb9fdb63895d60560
Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk

Add specific feature gate error for const-unstable features

Before:
```
error: `impl Trait` in const fn is unstable
 --> src/lib.rs:7:19
  |
7 | const fn foo() -> impl T {
  |                   ^^^^^^

error: aborting due to previous error
```

After:
```
error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
 --> src/lib.rs:7:19
  |
7 | const fn foo() -> impl T {
  |                   ^^^^^^
  = help: add #![feature(const_fn)] to the crate attributes to enable

error: aborting due to previous error
```

This improves the situation with https://github.com/rust-lang/rust/issues/57563. Fixes https://github.com/rust-lang/rust/issues/57544. Fixes https://github.com/rust-lang/rust/issues/54469.

r? @oli-obk
src/librustc_mir/transform/qualify_consts.rs