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

Add specific feature gate error for const-unstable features #58196

Merged
merged 4 commits into from Feb 17, 2019

Conversation

Projects
None yet
6 participants
@varkor
Copy link
Member

varkor commented Feb 5, 2019

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 #57563. Fixes #57544. Fixes #54469.

r? @oli-obk

@varkor varkor changed the title Const fn feature gate error Add specific feature gate error for const-unstable features Feb 5, 2019

@oli-obk
Copy link
Contributor

oli-obk left a comment

r=me with a documentation nit

Show resolved Hide resolved src/librustc_mir/diagnostics.rs Outdated
@varkor

This comment has been minimized.

Copy link
Member Author

varkor commented Feb 5, 2019

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 5, 2019

📌 Commit 4ed4c99 has been approved by oli-obk

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Feb 5, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:2ccbb0e1:start=1549400790641426547,finish=1549400791511527207,duration=870100660
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:12:25] 
[01:12:25] running 119 tests
[01:12:50] .iiiii...i.....i..i...i..i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i. 100/119
[01:12:54] i......iii.i.....ii
[01:12:54] 
[01:12:54]  finished in 29.036
[01:12:54] travis_fold:end:test_debuginfo

---
[01:37:55] 
[01:37:55] failures:
[01:37:55] 
[01:37:55] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0723 (line 11531) stdout ----
[01:37:55] thread '/checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0723 (line 11531)' panicked at 'test compiled while it wasn't supposed to', src/librustdoc/test.rs:344:13
[01:37:55] 
[01:37:55] 
[01:37:55] failures:
[01:37:55]     /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0723 (line 11531)
---
[01:37:55] 
[01:37:55] 
[01:37:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:37:55] Build completed unsuccessfully in 0:36:45
[01:37:55] make: *** [check] Error 1
[01:37:55] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1649cbfa
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Feb  5 22:44:38 UTC 2019
---
travis_time:end:020e8a84:start=1549406679593073818,finish=1549406679642674369,duration=49600551
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:109671ec
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:165b1336
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@varkor varkor force-pushed the varkor:const-fn-feature-gate-error branch from 4ed4c99 to 8a7df4f Feb 6, 2019

@oli-obk

oli-obk approved these changes Feb 6, 2019

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Feb 7, 2019

@bors r=oli-obk

Please tell bors about the re-approval after a force-push.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 7, 2019

📌 Commit 8a7df4f has been approved by oli-obk

Centril added a commit to Centril/rust that referenced this pull request Feb 13, 2019

Rollup merge of rust-lang#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 rust-lang#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 rust-lang#57563. Fixes rust-lang#57544. Fixes rust-lang#54469.

r? @oli-obk

Centril added a commit to Centril/rust that referenced this pull request Feb 13, 2019

Rollup merge of rust-lang#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 rust-lang#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 rust-lang#57563. Fixes rust-lang#57544. Fixes rust-lang#54469.

r? @oli-obk

bors added a commit that referenced this pull request Feb 13, 2019

Auto merge of #58413 - Centril:rollup, r=Centril
Rollup of 13 pull requests

Successful merges:

 - #57693 (Doc rewording)
 - #57815 (Speed up the fast path for assert_eq! and assert_ne!)
 - #58034 (Stabilize the time_checked_add feature)
 - #58057 (Stabilize linker-plugin based LTO (aka cross-language LTO))
 - #58137 (Cleanup: rename node_id_to_type(_opt))
 - #58166 (allow shorthand syntax for deprecation reason)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58200 (fix str mutating through a ptr derived from &self)
 - #58273 (Rename rustc_errors dependency in rust 2018 crates)
 - #58289 (impl iter() for dyn Error)
 - #58387 (Disallow `auto` trait alias syntax)
 - #58404 (use Ubuntu keyserver for CloudABI ports)
 - #58405 (Remove some dead code from libcore)

Failed merges:

r? @ghost
@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Feb 13, 2019

Failed in rollup (#58413 (comment)), @bors r- ; to fix the issue, try --bless --compare-mode=nll.

@rust-lang rust-lang deleted a comment from bors Feb 13, 2019

@varkor varkor force-pushed the varkor:const-fn-feature-gate-error branch from 8a7df4f to 8ca4406 Feb 14, 2019

@varkor

This comment has been minimized.

Copy link
Member Author

varkor commented Feb 14, 2019

@bors r=oli-obk

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 14, 2019

📌 Commit 8ca4406 has been approved by oli-obk

Centril added a commit to Centril/rust that referenced this pull request Feb 14, 2019

Rollup merge of rust-lang#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 rust-lang#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 rust-lang#57563. Fixes rust-lang#57544. Fixes rust-lang#54469.

r? @oli-obk

bors added a commit that referenced this pull request Feb 14, 2019

Auto merge of #58470 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57981 (Fix #57730)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58353 (Check the Self-type of inherent associated constants)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58448 (rustdoc: mask `compiler_builtins` docs)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Feb 15, 2019

Auto merge of #58470 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57981 (Fix #57730)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58353 (Check the Self-type of inherent associated constants)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58448 (rustdoc: mask `compiler_builtins` docs)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Feb 15, 2019

Auto merge of #58470 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57981 (Fix #57730)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58353 (Check the Self-type of inherent associated constants)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58448 (rustdoc: mask `compiler_builtins` docs)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Feb 15, 2019

Auto merge of #58470 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57981 (Fix #57730)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58353 (Check the Self-type of inherent associated constants)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58448 (rustdoc: mask `compiler_builtins` docs)

Failed merges:

r? @ghost

kennytm added a commit to kennytm/rust that referenced this pull request Feb 15, 2019

Rollup merge of rust-lang#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 rust-lang#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 rust-lang#57563. Fixes rust-lang#57544. Fixes rust-lang#54469.

r? @oli-obk

bors added a commit that referenced this pull request Feb 15, 2019

Auto merge of #58495 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests

Successful merges:

 - #57880 (Always emit an error for a query cycle)
 - #57981 (Fix #57730)
 - #58074 (Stabilize slice_sort_by_cached_key)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58359 (librustc_mir: use ? in impl_snapshot_for! macro)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58440 (Whitelist the ARM v6 target-feature)
 - #58448 (rustdoc: mask `compiler_builtins` docs)
 - #58468 (split MaybeUninit into several features, expand docs a bit)
 - #58477 (Fix the syntax error in publish_toolstate.py)
 - #58479 (compile-pass test for #53606)
 - #58489 (Fix runtime error in generate-keyword-tests)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Feb 15, 2019

Auto merge of #58495 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests

Successful merges:

 - #57880 (Always emit an error for a query cycle)
 - #57981 (Fix #57730)
 - #58074 (Stabilize slice_sort_by_cached_key)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58359 (librustc_mir: use ? in impl_snapshot_for! macro)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58440 (Whitelist the ARM v6 target-feature)
 - #58448 (rustdoc: mask `compiler_builtins` docs)
 - #58468 (split MaybeUninit into several features, expand docs a bit)
 - #58477 (Fix the syntax error in publish_toolstate.py)
 - #58479 (compile-pass test for #53606)
 - #58489 (Fix runtime error in generate-keyword-tests)

Failed merges:

r? @ghost

kennytm added a commit to kennytm/rust that referenced this pull request Feb 16, 2019

Rollup merge of rust-lang#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 rust-lang#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 rust-lang#57563. Fixes rust-lang#57544. Fixes rust-lang#54469.

r? @oli-obk

bors added a commit that referenced this pull request Feb 16, 2019

Auto merge of #58495 - kennytm:rollup, r=kennytm
Rollup of 19 pull requests

Successful merges:

 - #57929 (Rustdoc remove old style files)
 - #57981 (Fix #57730)
 - #58074 (Stabilize slice_sort_by_cached_key)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58359 (librustc_mir: use ? in impl_snapshot_for! macro)
 - #58395 (Instant::checked_duration_since)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58440 (Whitelist the ARM v6 target-feature)
 - #58448 (rustdoc: mask `compiler_builtins` docs)
 - #58468 (split MaybeUninit into several features, expand docs a bit)
 - #58477 (Fix the syntax error in publish_toolstate.py)
 - #58479 (compile-pass test for #53606)
 - #58489 (Fix runtime error in generate-keyword-tests)
 - #58496 (Fix documentation for std::path::PathBuf::pop)
 - #58509 (Notify myself when Clippy toolstate changes)

bors added a commit that referenced this pull request Feb 17, 2019

Auto merge of #58495 - kennytm:rollup, r=kennytm
Rollup of 19 pull requests

Successful merges:

 - #57929 (Rustdoc remove old style files)
 - #57981 (Fix #57730)
 - #58074 (Stabilize slice_sort_by_cached_key)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58359 (librustc_mir: use ? in impl_snapshot_for! macro)
 - #58395 (Instant::checked_duration_since)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58440 (Whitelist the ARM v6 target-feature)
 - #58448 (rustdoc: mask `compiler_builtins` docs)
 - #58468 (split MaybeUninit into several features, expand docs a bit)
 - #58479 (compile-pass test for #53606)
 - #58489 (Fix runtime error in generate-keyword-tests)
 - #58496 (Fix documentation for std::path::PathBuf::pop)
 - #58509 (Notify myself when Clippy toolstate changes)
 - #58521 (Fix tracking issue for error iterators)

@bors bors merged commit 8ca4406 into rust-lang:master Feb 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment