Skip to content
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

Rollup of 13 pull requests #58413

Closed
wants to merge 38 commits into from
Closed

Rollup of 13 pull requests #58413

wants to merge 38 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Feb 13, 2019

Successful merges:

Failed merges:

r? @ghost

dotdash and others added 30 commits January 21, 2019 19:36
Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.

By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.

We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.
Examples:

```rust
let next_error_type_a = err
    .iter_chain()
    .filter_map(Error::downcast_ref::<ErrorTypeA>)
    .next();
```

```rust
let source_root_error = err.iter_chain().last();
```

Credit for the ErrorIter goes to Tim Diekmann
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
The Ubuntu keyserver is more reliable than the MIT PGP server, which is
prone to going down. This commit also explicitly uses port 80 on the
keyserver for reasons outlined in rust-lang#57844.
These macros are not required to glue the `core_arch` crate anymore.
Speed up the fast path for assert_eq! and assert_ne!

Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.

By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.

We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.
…=alexcrichton

Stabilize the time_checked_add feature

Closes rust-lang#55940

Stabilizes `checked_add` and `checked_sub` on `Instant` and `SystemTime`.
…alexcrichton

Stabilize linker-plugin based LTO (aka cross-language LTO)

This PR stabilizes [linker plugin based LTO](rust-lang#49879), also known as "cross-language LTO" because it allows for doing inlining and other optimizations across language boundaries in mixed Rust/C/C++ projects.

As described in the tracking issue, it works by making `rustc` emit LLVM bitcode instead of machine code, the same as `clang` does. A linker with the proper plugin (like LLD) can then run (Thin)LTO across all modules.

The feature has been implemented over a number of pull requests and there are various [codegen](https://github.com/rust-lang/rust/blob/master/src/test/codegen/no-dllimport-w-cross-lang-lto.rs) and [run](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-clang)-[make](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs) [tests](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto) that make sure that it keeps working.

It also works for building big projects like [Firefox](https://treeherder.mozilla.org/#/jobs?repo=try&revision=2ce2d5ddcea6fbff790503eac406954e469b2f5d).

The PR makes the feature available under the `-C linker-plugin-lto` flag. As discussed in the tracking issue it is not cross-language specific and also not LLD specific. `-C linker-plugin-lto` is descriptive of what it does. If someone has a better name, let me know `:)`
…stebank

Cleanup: rename node_id_to_type(_opt)

Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here.

In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).
…rochenkov

allow shorthand syntax for deprecation reason

Fixes rust-lang#48271.

Created based on discussion in rust-lang#56896.
… 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
fix str mutating through a ptr derived from &self

Found by Miri: In `get_unchecked_mut` (also used by the checked variants internally) uses `str::as_ptr` to create a mutable reference, but `as_ptr` takes `&self`.  This means the mutable references we return here got created from a shared reference, which violates the shared-references-are-read-only discipline!

For this by using a newly introduced `as_mut_ptr` instead.
…wjasper

Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc rust-lang#58099

r? @Centril
impl iter() for dyn Error

Examples:

```rust
let next_error_type_a = err
    .iter()
    .filter_map(Error::downcast_ref::<ErrorTypeA>)
    .next();
```

```rust
let source_root_error = err.iter().last();
```

Credit for the ErrorIter goes to reddit user /u/tdiekmann (Tim Diekmann)
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
…ichton

use Ubuntu keyserver for CloudABI ports

The Ubuntu keyserver is more reliable than the MIT PGP server, which is
prone to going down. This commit also explicitly uses port 80 on the
keyserver for reasons outlined in rust-lang#57844.
…crichton

Remove some dead code from libcore

These macros are not required to glue the `core_arch` crate anymore.
@Centril
Copy link
Contributor Author

Centril commented Feb 13, 2019

@bors r+ p=13

@bors
Copy link
Contributor

bors commented Feb 13, 2019

📌 Commit 3883319 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 13, 2019
@bors
Copy link
Contributor

bors commented Feb 13, 2019

⌛ Testing commit 3883319 with merge 2837b99...

bors added a commit that referenced this pull request Feb 13, 2019
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
@bors
Copy link
Contributor

bors commented Feb 13, 2019

💔 Test failed - checks-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 13, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-nopt 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.
[01:20:51] 
[01:20:51] ---- [ui (nll)] ui/consts/min_const_fn/min_const_fn_dyn.rs stdout ----
[01:20:51] diff of stderr:
[01:20:51] 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 3    |
[01:20:51] 3    |
[01:20:51] 4 LL |     x.0.field;
[01:20:51] 5    |     ^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 6 
[01:20:51] 6 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 9    |
[01:20:51] 9    |
[01:20:51] 10 LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
[01:20:51] 11    |                                                                  ^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 12 
[01:20:51] 12 
[01:20:51] 13 warning[E0716]: temporary value dropped while borrowed
[01:20:51] 
[01:20:51] 24 
[01:20:51] 25 error: aborting due to 2 previous errors
[01:20:51] 26 
[01:20:51] 26 
[01:20:51] - For more information about this error, try `rustc --explain E0716`.
[01:20:51] + Some errors occurred: E0716, E0723.
[01:20:51] + For more information about an error, try `rustc --explain E0716`.
[01:20:51] 28 
[01:20:51] 
[01:20:51] 
[01:20:51] The actual stderr differed from the expected stderr.
[01:20:51] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/min_const_fn_dyn.nll/min_const_fn_dyn.nll.stderr
[01:20:51] To update references, rerun the tests and pass the `--bless` flag
[01:20:51] To only update this specific test, also pass `--test-args consts/min_const_fn/min_const_fn_dyn.rs`
[01:20:51] error: 1 errors occurred comparing output.
[01:20:51] status: exit code: 1
[01:20:51] status: exit code: 1
[01:20:51] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/min_const_fn_dyn.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/min_const_fn_dyn.nll/auxiliary" "-A" "unused"
[01:20:51] ------------------------------------------
[01:20:51] 
[01:20:51] ------------------------------------------
[01:20:51] stderr:
[01:20:51] stderr:
[01:20:51] ------------------------------------------
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs","byte_start":167,"byte_end":176,"line_start":9,"line_end":9,"column_start":5,"column_end":14,"is_primary":true,"text":[{"text":"    x.0.field;","highlight_start":5,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs:9:5\n   |\nLL |     x.0.field;\n   |     ^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs","byte_start":288,"byte_end":290,"line_start":12,"line_end":12,"column_start":66,"column_end":68,"is_primary":true,"text":[{"text":"const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }","highlight_start":66,"highlight_end":68}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs:12:66\n   |\nLL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }\n   |                                                                  ^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"temporary value dropped while borrowed","code":{"code":"E0716","explanation":"\nThis error indicates that a temporary value is being dropped\nwhile a borrow is still in active use.\n\nErroneous code example:\n\n```compile_fail,E0716\n# #![feature(nll)]\nfn foo() -> i32 { 22 }\nfn bar(x: &i32) -> &i32 { x }\nlet p = bar(&foo());\n         // ------ creates a temporary\nlet q = *p;\n```\n\nHere, the expression `&foo()` is borrowing the expression\n`foo()`. As `foo()` is call to a function, and not the name of\na variable, this creates a **temporary** -- that temporary stores\nthe return value from `foo()` so that it can be borrowed.\nSo you might imagine that `let p = bar(&foo())` is equivalent\nto this:\n\n```compile_fail,E0597\n# fn foo() -> i32 { 22 }\n# fn bar(x: &i32) -> &i32 { x }\nlet p = {\n  let tmp = foo(); // the temporary\n  bar(&tmp)\n}; // <-- tmp is freed as we exit this block\nlet q = p;\n```\n\nWhenever a temporary is created, it is automatically dropped (freed)\naccording to fixed rules. Ordinarily, the temporary is dropped\nat the end of the enclosing statement -- in this case, after the `let`.\nThis is illustrated in the example above by showing that `tmp` would\nbe freed as we exit the block.\n\nTo fix this problem, you need to create a local variable\nto store the value in rather than relying on a temporary.\nFor example, you might change the original program to\nthe following:\n\n```\nfn foo() -> i32 { 22 }\nfn bar(x: &i32) -> &i32 { x }\nlet value = foo(); // dropped at the end of the enclosing block\nlet p = bar(&value);\nlet q = *p;\n```\n\nBy introducing the explicit `let value`, we allocate storage\nthat will last until the end of the enclosing block (when `value`\ngoes out of scope). When we borrow `&value`, we are borrowing a\nlocal variable that already exists, and hence no temporary is created.\n\nTemporaries are not always dropped at the end of the enclosing\nstatement. In simple cases where the `&` expression is immediately\nstored into a variable, the compiler will automatically extend\nthe lifetime of the temporary until the end of the enclosing\nblock. Therefore, an alternative way to fix the original\nprogram is to write `let tmp = &foo()` and not `let tmp = foo()`:\n\n```\nfn foo() -> i32 { 22 }\nfn bar(x: &i32) -> &i32 { x }\nlet value = &foo();\nlet p = bar(value);\nlet q = *p;\n```\n\nHere, we are still borrowing `foo()`, but as the borrow is assigned\ndirectly into a variable, the temporary will not be dropped until\nthe end of the enclosing block. Similar rules apply when temporaries\nare stored into aggregate structures like a tuple or struct:\n\n```\n// Here, two temporaries are created, but\n// as they are stored directly into `value`,\n// they are not dropped until the end of the\n// enclosing block.\nfn foo() -> i32 { 22 }\nlet value = (&foo(), &foo());\n```\n"},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs","byte_start":289,"byte_end":290,"line_start":12,"line_end":12,"column_start":67,"column_end":68,"is_primary":true,"text":[{"text":"const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }","highlight_start":67,"highlight_end":68}],"label":"creates a temporary which is freed while still in use","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs","byte_start":294,"byte_end":295,"line_start":12,"line_end":12,"column_start":72,"column_end":73,"is_primary":false,"text":[{"text":"const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }","highlight_start":72,"highlight_end":73}],"label":"temporary value is freed at the end of this statement","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs","byte_start":288,"byte_end":290,"line_start":12,"line_end":12,"column_start":66,"column_end":68,"is_primary":false,"text":[{"text":"const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }","highlight_start":66,"highlight_end":68}],"label":"cast requires that borrow lasts for `'static`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this error has been downgraded to a warning for backwards compatibility with previous releases","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"this represents potential undefined behavior in your code and this warning will become a hard error in the future","code":null,"level":"warning","spans":[],"children":[],"rendered":null}],"rendered":"warning[E0716]: temporary value dropped while borrowed\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs:12:67\n   |\nLL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }\n   |                                                                  -^    - temporary value is freed at the end of this statement\n   |                                                                  ||\n   |                                                                  |creates a temporary which is freed while still in use\n   |                                                                  cast requires that borrow lasts for `'static`\n   |\n   = warning: this error has been downgraded to a warning for backwards compatibility with previous releases\n   = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future\n\n"}
[01:20:51] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:20:51] {"message":"Some errors occurred: E0716, E0723.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0716, E0723.\n"}
[01:20:51] 
[01:20:51] ------------------------------------------
[01:20:51] 
[01:20:51] thread '[ui (nll)] ui/consts/min_const_fn/min_const_fn_dyn.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:20:51] thread '[ui (nll)] ui/consts/min_const_fn/min_const_fn_dyn.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:20:51] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:20:51] 
[01:20:51] ---- [ui (nll)] ui/consts/min_const_fn/min_const_fn.rs stdout ----
[01:20:51] diff of stderr:
[01:20:51] 
[01:20:51] 4 LL |     const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
[01:20:51] 5    |                         ^^^^ constant functions cannot evaluate destructors
[01:20:51] - error: mutable references in const fn are unstable
[01:20:51] + error[E0723]: mutable references in const fn are unstable (see issue #57563)
[01:20:51] 8   --> $DIR/min_const_fn.rs:39:36
[01:20:51] 9    |
[01:20:51] 9    |
[01:20:51] 10 LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
[01:20:51] 11    |                                    ^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 12 
[01:20:51] 12 
[01:20:51] 13 error[E0493]: destructors cannot be evaluated at compile-time
[01:20:51] 
[01:20:51] 
[01:20:51] 16 LL |     const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
[01:20:51] 17    |                            ^^^^ constant functions cannot evaluate destructors
[01:20:51] - error: mutable references in const fn are unstable
[01:20:51] + error[E0723]: mutable references in const fn are unstable (see issue #57563)
[01:20:51] 20   --> $DIR/min_const_fn.rs:46:42
[01:20:51] 21    |
[01:20:51] 21    |
[01:20:51] 22 LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
[01:20:51] 23    |                                          ^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 24 
[01:20:51] 24 
[01:20:51] 25 error[E0493]: destructors cannot be evaluated at compile-time
[01:20:51] 
[01:20:51] 
[01:20:51] 28 LL |     const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
[01:20:51] 29    |                           ^^^^ constant functions cannot evaluate destructors
[01:20:51] - error: mutable references in const fn are unstable
[01:20:51] + error[E0723]: mutable references in const fn are unstable (see issue #57563)
[01:20:51] 32   --> $DIR/min_const_fn.rs:53:38
[01:20:51] 33    |
[01:20:51] 33    |
[01:20:51] 34 LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
[01:20:51] 35    |                                      ^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 36 
[01:20:51] 36 
[01:20:51] - error: mutable references in const fn are unstable
[01:20:51] + error[E0723]: mutable references in const fn are unstable (see issue #57563)
[01:20:51] 38   --> $DIR/min_const_fn.rs:58:39
[01:20:51] 39    |
[01:20:51] 40 LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
[01:20:51] 41    |                                       ^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 42 
[01:20:51] 42 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 45    |
[01:20:51] 45    |
[01:20:51] 46 LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
[01:20:51] 47    |                ^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 48 
[01:20:51] 48 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 51    |
[01:20:51] 51    |
[01:20:51] 52 LL | const fn foo11_2<T: Send>(t: T) -> T { t }
[01:20:51] 53    |                  ^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 54 
[01:20:51] 54 
[01:20:51] - error: only int, `bool` and `char` operations are stable in const fn
[01:20:51] + error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
[01:20:51] 57    |
[01:20:51] 57    |
[01:20:51] 58 LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
[01:20:51] 59    |                                 ^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 60 
[01:20:51] 60 
[01:20:51] - error: only int, `bool` and `char` operations are stable in const fn
[01:20:51] + error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
[01:20:51] 63    |
[01:20:51] 63    |
[01:20:51] 64 LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
[01:20:51] 65    |                                   ^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 66 
[01:20:51] 66 
[01:20:51] - error: only int and `bool` operations are stable in const fn
[01:20:51] + error[E0723]: only int and `bool` operations are stable in const fn (see issue #57563)
[01:20:51] 69    |
[01:20:51] 69    |
[01:20:51] 70 LL | const fn foo19_3(f: f32) -> f32 { -f }
[01:20:51] 71    |                                   ^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 72 
[01:20:51] 72 
[01:20:51] - error: only int, `bool` and `char` operations are stable in const fn
[01:20:51] + error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
[01:20:51] 75    |
[01:20:51] 75    |
[01:20:51] 76 LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
[01:20:51] 77    |                                           ^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 78 
[01:20:51] 78 
[01:20:51] - error: cannot access `static` items in const fn
[01:20:51] + error[E0723]: cannot access `static` items in const fn (see issue #57563)
[01:20:51] 81    |
[01:20:51] 81    |
[01:20:51] 82 LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
[01:20:51] 83    |                           ^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 84 
[01:20:51] 84 
[01:20:51] - error: cannot access `static` items in const fn
[01:20:51] + error[E0723]: cannot access `static` items in const fn (see issue #57563)
[01:20:51] 87    |
[01:20:51] 87    |
[01:20:51] 88 LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
[01:20:51] 89    |                                    ^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 90 
[01:20:51] 90 
[01:20:51] - error: casting pointers to ints is unstable in const fn
[01:20:51] + error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
[01:20:51] 93    |
[01:20:51] 93    |
[01:20:51] 94 LL | const fn foo30(x: *const u32) -> usize { x as usize }
[01:20:51] 95    |                                          ^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 96 
[01:20:51] 96 
[01:20:51] - error: casting pointers to ints is unstable in const fn
[01:20:51] + error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
[01:20:51] 99    |
[01:20:51] 99    |
[01:20:51] 100 LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
[01:20:51] 101    |                                                               ^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 102 
[01:20:51] 102 
[01:20:51] - error: casting pointers to ints is unstable in const fn
[01:20:51] + error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
[01:20:51] 105    |
[01:20:51] 105    |
[01:20:51] 106 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
[01:20:51] 107    |                                          ^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 108 
[01:20:51] 108 
[01:20:51] - error: casting pointers to ints is unstable in const fn
[01:20:51] + error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
[01:20:51] 111    |
[01:20:51] 111    |
[01:20:51] 112 LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
[01:20:51] 113    |                                                               ^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 114 
[01:20:51] 114 
[01:20:51] - error: `if`, `match`, `&&` and `||` are not stable in const fn
[01:20:51] + error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
[01:20:51] 117    |
[01:20:51] 117    |
[01:20:51] 118 LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
[01:20:51] 119    |                                      ^^^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 120 
[01:20:51] 120 
[01:20:51] - error: `if`, `match`, `&&` and `||` are not stable in const fn
[01:20:51] + error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
[01:20:51] 123    |
[01:20:51] 123    |
[01:20:51] 124 LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
[01:20:51] 125    |                             ^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 126 
[01:20:51] 126 
[01:20:51] - error: `if`, `match`, `&&` and `||` are not stable in const fn
[01:20:51] + error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
[01:20:51] 129    |
[01:20:51] 129    |
[01:20:51] 130 LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
[01:20:51] 131    |                                            ^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 132 
[01:20:51] 132 
[01:20:51] - error: `if`, `match`, `&&` and `||` are not stable in const fn
[01:20:51] + error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
[01:20:51] 135    |
[01:20:51] 135    |
[01:20:51] 136 LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
[01:20:51] 137    |                                            ^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 138 
[01:20:51] 138 
[01:20:51] - error: mutable references in const fn are unstable
[01:20:51] + error[E0723]: mutable references in const fn are unstable (see issue #57563)
[01:20:51] 140   --> $DIR/min_const_fn.rs:108:14
[01:20:51] 141    |
[01:20:51] 142 LL | const fn inc(x: &mut i32) { *x += 1 }
[01:20:51] 143    |              ^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 144 
[01:20:51] 144 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 147    |
[01:20:51] 147    |
[01:20:51] 148 LL | impl<T: std::fmt::Debug> Foo<T> {
[01:20:51] 149    |      ^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 150 
[01:20:51] 150 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 153    |
[01:20:51] 153    |
[01:20:51] 154 LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
[01:20:51] 155    |      ^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 156 
[01:20:51] 156 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 159    |
[01:20:51] 159    |
[01:20:51] 160 LL | impl<T: Sync + Sized> Foo<T> {
[01:20:51] 161    |      ^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 162 
[01:20:51] 162 
[01:20:51] - error: `impl Trait` in const fn is unstable
[01:20:51] + error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
[01:20:51] 165    |
[01:20:51] 165    |
[01:20:51] 166 LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
[01:20:51] 167    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 168 
[01:20:51] 168 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 171    |
[01:20:51] 171    |
[01:20:51] 172 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
[01:20:51] 173    |                                  ^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 174 
[01:20:51] 174 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 177    |
[01:20:51] 177    |
[01:20:51] 178 LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
[01:20:51] 179    |                      ^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 180 
[01:20:51] 180 
[01:20:51] - error: `impl Trait` in const fn is unstable
[01:20:51] + error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
[01:20:51] 183    |
[01:20:51] 183    |
[01:20:51] 184 LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable
[01:20:51] 185    |                       ^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 186 
[01:20:51] 186 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 189    |
[01:20:51] 189    |
[01:20:51] 190 LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
[01:20:51] 191    |                       ^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 192 
[01:20:51] 192 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 195    |
[01:20:51] 195    |
[01:20:51] 196 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
[01:20:51] 197    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 198 
[01:20:51] 198 
[01:20:51] 199 warning[E0515]: cannot return reference to temporary value
[01:20:51] 200   --> $DIR/min_const_fn.rs:136:63
[01:20:51] 
[01:20:51] 208    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
[01:20:51] 209    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
[01:20:51] 210 
[01:20:51] - error: trait bounds other than `Sized` on const fn parameters are unstable
[01:20:51] + error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
[01:20:51] 213    |
[01:20:51] 213    |
[01:20:51] 214 LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }
[01:20:51] 215    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 216 
[01:20:51] 216 
[01:20:51] - error: function pointers in const fn are unstable
[01:20:51] + error[E0723]: function pointers in const fn are unstable (see issue #57563)
[01:20:51] 219    |
[01:20:51] 219    |
[01:20:51] 220 LL | const fn no_fn_ptrs(_x: fn()) {}
[01:20:51] 221    |                     ^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 222 
[01:20:51] 222 
[01:20:51] - error: function pointers in const fn are unstable
[01:20:51] + error[E0723]: function pointers in const fn are unstable (see issue #57563)
[01:20:51] 225    |
[01:20:51] 225    |
[01:20:51] 226 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
[01:20:51] 227    |                           ^^^^
[01:20:51] +    |
[01:20:51] +    = help: add #![feature(const_fn)] to the crate attributes to enable
[01:20:51] 228 
---
[01:20:51] 233 
[01:20:51] 
[01:20:51] 
[01:20:51] The actual stderr differed from the expected stderr.
[01:20:51] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/min_const_fn.nll/min_const_fn.nll.stderr
[01:20:51] To update references, rerun the tests and pass the `--bless` flag
[01:20:51] To only update this specific test, also pass `--test-args consts/min_const_fn/min_const_fn.rs`
[01:20:51] error: 1 errors occurred comparing output.
[01:20:51] status: exit code: 1
[01:20:51] status: exit code: 1
[01:20:51] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/min_const_fn.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/min_const_fn.nll/auxiliary" "-A" "unused"
[01:20:51] ------------------------------------------
[01:20:51] 
[01:20:51] ------------------------------------------
[01:20:51] stderr:
[01:20:51] stderr:
[01:20:51] ------------------------------------------
[01:20:51] {"message":"destructors cannot be evaluated at compile-time","code":{"code":"E0493","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":1264,"byte_end":1268,"line_start":37,"line_end":37,"column_start":25,"column_end":29,"is_primary":true,"text":[{"text":"    const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated","highlight_start":25,"highlight_end":29}],"label":"constant functions cannot evaluate destructors","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0493]: destructors cannot be evaluated at compile-time\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:37:25\n   |\nLL |     const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated\n   |                         ^^^^ constant functions cannot evaluate destructors\n\n"}
[01:20:51] {"message":"mutable references in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":1399,"byte_end":1405,"line_start":39,"line_end":39,"column_start":36,"column_end":42,"is_primary":true,"text":[{"text":"    const fn get_mut(&mut self) -> &mut T { &mut self.0 }","highlight_start":36,"highlight_end":42}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: mutable references in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:39:36\n   |\nLL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }\n   |                                    ^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"destructors cannot be evaluated at compile-time","code":{"code":"E0493","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":1570,"byte_end":1574,"line_start":44,"line_end":44,"column_start":28,"column_end":32,"is_primary":true,"text":[{"text":"    const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated","highlight_start":28,"highlight_end":32}],"label":"constant functions cannot evaluate destructors","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0493]: destructors cannot be evaluated at compile-time\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:44:28\n   |\nLL |     const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated\n   |                            ^^^^ constant functions cannot evaluate destructors\n\n"}
[01:20:51] {"message":"mutable references in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":1717,"byte_end":1723,"line_start":46,"line_end":46,"column_start":42,"column_end":48,"is_primary":true,"text":[{"text":"    const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }","highlight_start":42,"highlight_end":48}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: mutable references in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:46:42\n   |\nLL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }\n   |                                          ^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"destructors cannot be evaluated at compile-time","code":{"code":"E0493","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":1889,"byte_end":1893,"line_start":51,"line_end":51,"column_start":27,"column_end":31,"is_primary":true,"text":[{"text":"    const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors","highlight_start":27,"highlight_end":31}],"label":"constant functions cannot evaluate destructors","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0493]: destructors cannot be evaluated at compile-time\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:51:27\n   |\nLL |     const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors\n   |                           ^^^^ constant functions cannot evaluate destructors\n\n"}
[01:20:51] {"message":"mutable references in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":2014,"byte_end":2020,"line_start":53,"line_end":53,"column_start":38,"column_end":44,"is_primary":true,"text":[{"text":"    const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }","highlight_start":38,"highlight_end":44}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: mutable references in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:53:38\n   |\nLL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }\n   |                                      ^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"mutable references in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":2200,"byte_end":2206,"line_start":58,"line_end":58,"column_start":39,"column_end":45,"is_primary":true,"text":[{"text":"    const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }","highlight_start":39,"highlight_end":45}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: mutable references in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:58:39\n   |\nLL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }\n   |                                       ^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":2926,"byte_end":2927,"line_start":76,"line_end":76,"column_start":16,"column_end":17,"is_primary":true,"text":[{"text":"const fn foo11<T: std::fmt::Display>(t: T) -> T { t }","highlight_start":16,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:76:16\n   |\nLL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }\n   |                ^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3061,"byte_end":3062,"line_start":78,"line_end":78,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":"const fn foo11_2<T: Send>(t: T) -> T { t }","highlight_start":18,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:78:18\n   |\nLL | const fn foo11_2<T: Send>(t: T) -> T { t }\n   |                  ^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"only int, `bool` and `char` operations are stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3198,"byte_end":3205,"line_start":80,"line_end":80,"column_start":33,"column_end":40,"is_primary":true,"text":[{"text":"const fn foo19(f: f32) -> f32 { f * 2.0 }","highlight_start":33,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:80:33\n   |\nLL | const fn foo19(f: f32) -> f32 { f * 2.0 }\n   |                                 ^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"only int, `bool` and `char` operations are stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3315,"byte_end":3322,"line_start":82,"line_end":82,"column_start":35,"column_end":42,"is_primary":true,"text":[{"text":"const fn foo19_2(f: f32) -> f32 { 2.0 - f }","highlight_start":35,"highlight_end":42}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:82:35\n   |\nLL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }\n   |                                   ^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"only int and `bool` operations are stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3432,"byte_end":3434,"line_start":84,"line_end":84,"column_start":35,"column_end":37,"is_primary":true,"text":[{"text":"const fn foo19_3(f: f32) -> f32 { -f }","highlight_start":35,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: only int and `bool` operations are stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:84:35\n   |\nLL | const fn foo19_3(f: f32) -> f32 { -f }\n   |                                   ^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"only int, `bool` and `char` operations are stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3544,"byte_end":3549,"line_start":86,"line_end":86,"column_start":43,"column_end":48,"is_primary":true,"text":[{"text":"const fn foo19_4(f: f32, g: f32) -> f32 { f / g }","highlight_start":43,"highlight_end":48}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:86:43\n   |\nLL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }\n   |                                           ^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"cannot access `static` items in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3674,"byte_end":3677,"line_start":90,"line_end":90,"column_start":27,"column_end":30,"is_primary":true,"text":[{"text":"const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn","highlight_start":27,"highlight_end":30}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: cannot access `static` items in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:90:27\n   |\nLL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn\n   |                           ^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"cannot access `static` items in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3766,"byte_end":3770,"line_start":91,"line_end":91,"column_start":36,"column_end":40,"is_primary":true,"text":[{"text":"const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items","highlight_start":36,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: cannot access `static` items in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:91:36\n   |\nLL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items\n   |                                    ^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"casting pointers to ints is unstable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3853,"byte_end":3863,"line_start":92,"line_end":92,"column_start":42,"column_end":52,"is_primary":true,"text":[{"text":"const fn foo30(x: *const u32) -> usize { x as usize }","highlight_start":42,"highlight_end":52}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:92:42\n   |\nLL | const fn foo30(x: *const u32) -> usize { x as usize }\n   |                                          ^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"casting pointers to ints is unstable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":3976,"byte_end":3986,"line_start":94,"line_end":94,"column_start":63,"column_end":73,"is_primary":true,"text":[{"text":"const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }","highlight_start":63,"highlight_end":73}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:94:63\n   |\nLL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }\n   |                                                               ^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"casting pointers to ints is unstable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4080,"byte_end":4090,"line_start":96,"line_end":96,"column_start":42,"column_end":52,"is_primary":true,"text":[{"text":"const fn foo30_2(x: *mut u32) -> usize { x as usize }","highlight_start":42,"highlight_end":52}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:96:42\n   |\nLL | const fn foo30_2(x: *mut u32) -> usize { x as usize }\n   |                                          ^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"casting pointers to ints is unstable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4203,"byte_end":4213,"line_start":98,"line_end":98,"column_start":63,"column_end":73,"is_primary":true,"text":[{"text":"const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }","highlight_start":63,"highlight_end":73}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:98:63\n   |\nLL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }\n   |                                                               ^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"`if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4303,"byte_end":4325,"line_start":100,"line_end":100,"column_start":38,"column_end":60,"is_primary":true,"text":[{"text":"const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }","highlight_start":38,"highlight_end":60}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:100:38\n   |\nLL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }\n   |                                      ^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"`if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4423,"byte_end":4434,"line_start":102,"line_end":102,"column_start":29,"column_end":40,"is_primary":true,"text":[{"text":"const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn","highlight_start":29,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:102:29\n   |\nLL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn\n   |                             ^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:20:51] make: *** [check] Error 1
[01:20:51] {"message":"`if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4560,"byte_end":4566,"line_start":104,"line_end":104,"column_start":44,"column_end":50,"is_primary":true,"text":[{"text":"const fn foo36(a: bool, b: bool) -> bool { a && b }","highlight_start":44,"highlight_end":50}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:104:44\n   |\nLL | const fn foo36(a: bool, b: bool) -> bool { a && b }\n   |                                            ^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"`if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4679,"byte_end":4685,"line_start":106,"line_end":106,"column_start":44,"column_end":50,"is_primary":true,"text":[{"text":"const fn foo37(a: bool, b: bool) -> bool { a || b }","highlight_start":44,"highlight_end":50}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:106:44\n   |\nLL | const fn foo37(a: bool, b: bool) -> bool { a || b }\n   |                                            ^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"mutable references in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4768,"byte_end":4769,"line_start":108,"line_end":108,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":"const fn inc(x: &mut i32) { *x += 1 }","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: mutable references in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:108:14\n   |\nLL | const fn inc(x: &mut i32) { *x += 1 }\n   |              ^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":4868,"byte_end":4869,"line_start":113,"line_end":113,"column_start":6,"column_end":7,"is_primary":true,"text":[{"text":"impl<T: std::fmt::Debug> Foo<T> {","highlight_start":6,"highlight_end":7}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:113:6\n   |\nLL | impl<T: std::fmt::Debug> Foo<T> {\n   |      ^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5011,"byte_end":5012,"line_start":118,"line_end":118,"column_start":6,"column_end":7,"is_primary":true,"text":[{"text":"impl<T: std::fmt::Debug + Sized> Foo<T> {","highlight_start":6,"highlight_end":7}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:118:6\n   |\nLL | impl<T: std::fmt::Debug + Sized> Foo<T> {\n   |      ^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5163,"byte_end":5164,"line_start":123,"line_end":123,"column_start":6,"column_end":7,"is_primary":true,"text":[{"text":"impl<T: Sync + Sized> Foo<T> {","highlight_start":6,"highlight_end":7}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:123:6\n   |\nLL | impl<T: Sync + Sized> Foo<T> {\n   |      ^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"`impl Trait` in const fn is unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5347,"byte_end":5379,"line_start":129,"line_end":129,"column_start":24,"column_end":56,"is_primary":true,"text":[{"text":"const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }","highlight_start":24,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:129:24\n   |\nLL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }\n   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5479,"byte_end":5499,"line_start":131,"line_end":131,"column_start":34,"column_end":54,"is_primary":true,"text":[{"text":"const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}","highlight_start":34,"highlight_end":54}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:131:34\n   |\nLL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}\n   |                                  ^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5569,"byte_end":5589,"line_start":133,"line_end":133,"column_start":22,"column_end":42,"is_primary":true,"text":[{"text":"const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`","highlight_start":22,"highlight_end":42}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:133:22\n   |\nLL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`\n   |                      ^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"`impl Trait` in const fn is unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5658,"byte_end":5678,"line_start":134,"line_end":134,"column_start":23,"column_end":43,"is_primary":true,"text":[{"text":"const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable","highlight_start":23,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:134:23\n   |\nLL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable\n   |                       ^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5751,"byte_end":5753,"line_start":135,"line_end":135,"column_start":23,"column_end":25,"is_primary":true,"text":[{"text":"const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`","highlight_start":23,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:135:23\n   |\nLL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`\n   |                       ^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5853,"byte_end":5881,"line_start":136,"line_end":136,"column_start":32,"column_end":60,"is_primary":true,"text":[{"text":"const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }","highlight_start":32,"highlight_end":60}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:136:32\n   |\nLL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }\n   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"cannot return reference to temporary value","code":{"code":"E0515","explanation":"\nCannot return value that references local variable\n\nLocal variables, function parameters and temporaries are all dropped before the\nend of the function body. So a reference to them cannot be returned.\n\n```compile_fail,E0515\n#![feature(nll)]\nfn get_dangling_reference() -> &'static i32 {\n    let x = 0;\n    &x\n}\n```\n\n```compile_fail,E0515\n#![feature(nll)]\nuse std::slice::Iter;\nfn get_dangling_iterator<'a>() -> Iter<'a, i32> {\n    let v = vec![1, 2, 3];\n    v.iter()\n}\n```\n\nConsider returning an owned value instead:\n\n```\nuse std::vec::IntoIter;\n\nfn get_integer() -> i32 {\n    let x = 0;\n    x\n}\n\nfn get_owned_iterator() -> IntoIter<i32> {\n    let v = vec![1, 2, 3];\n    v.into_iter()\n}\n```\n"},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5884,"byte_end":5887,"line_start":136,"line_end":136,"column_start":63,"column_end":66,"is_primary":true,"text":[{"text":"const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }","highlight_start":63,"highlight_end":66}],"label":"returns a reference to data owned by the current function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":5885,"byte_end":5887,"line_start":136,"line_end":136,"column_start":64,"column_end":66,"is_primary":false,"text":[{"text":"const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }","highlight_start":64,"highlight_end":66}],"label":"temporary value created here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this error has been downgraded to a warning for backwards compatibility with previous releases","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"this represents potential undefined behavior in your code and this warning will become a hard error in the future","code":null,"level":"warning","spans":[],"children":[],"rendered":null}],"rendered":"warning[E0515]: cannot return reference to temporary value\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:136:63\n   |\nLL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }\n   |                                                               ^--\n   |                                                               ||\n   |                                                               |temporary value created here\n   |                                                               returns a reference to data owned by the current function\n   |\n   = warning: this error has been downgraded to a warning for backwards compatibility with previous releases\n   = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future\n\n"}
[01:20:51] {"message":"trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":6010,"byte_end":6039,"line_start":141,"line_end":141,"column_start":41,"column_end":70,"is_primary":true,"text":[{"text":"const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }","highlight_start":41,"highlight_end":70}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:141:41\n   |\nLL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }\n   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"function pointers in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":6108,"byte_end":6110,"line_start":144,"line_end":144,"column_start":21,"column_end":23,"is_primary":true,"text":[{"text":"const fn no_fn_ptrs(_x: fn()) {}","highlight_start":21,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: function pointers in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:144:21\n   |\nLL | const fn no_fn_ptrs(_x: fn()) {}\n   |                     ^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"function pointers in const fn are unstable (see issue #57563)","code":{"code":"E0723","explanation":"\nAn feature unstable in `const` contexts was used.\n\nErroneous code example:\n\n```compile_fail,E0723\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T { // error: `impl Trait` in const fn is unstable\n    ()\n}\n```\n\nTo enable this feature on a nightly version of rustc, add the `const_fn`\nfeature flag:\n\n```\n#![feature(const_fn)]\n\ntrait T {}\n\nimpl T for () {}\n\nconst fn foo() -> impl T {\n    ()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs","byte_start":6201,"byte_end":6205,"line_start":146,"line_end":146,"column_start":27,"column_end":31,"is_primary":true,"text":[{"text":"const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }","highlight_start":27,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_fn)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0723]: function pointers in const fn are unstable (see issue #57563)\n  --> /checkout/src/test/ui/consts/min_const_fn/min_const_fn.rs:146:27\n   |\nLL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }\n   |                           ^^^^\n   |\n   = help: add #![feature(const_fn)] to the crate attributes to enable\n\n"}
[01:20:51] {"message":"aborting due to 36 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 36 previous errors\n\n"}
[01:20:51] {"message":"Some errors occurred: E0493, E0515, E0723.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0493, E0515, E0723.\n"}
[01:20:51] 
[01:20:51] ------------------------------------------
[01:20:51] 
[01:20:51] thread '[ui (nll)] ui/consts/min_const_fn/min_const_fn.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
---
[01:20:51] test result: FAILED. 5293 passed; 2 failed; 88 ignored; 0 measured; 0 filtered out
[01:20:51] 
[01:20:51] 
[01:20:51] 
[01:20:51] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
[01:20:51] 
[01:20:51] 
[01:20:51] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:20:51] Build completed unsuccessfully in 0:07:47
[01:20:51] Build completed unsuccessfully in 0:07:47
[01:20:51] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:12d35088
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Feb 13 03:26:01 UTC 2019
---
travis_time:end:0613fd80:start=1550028362855647495,finish=1550028362866293108,duration=10645613
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0d3802c4
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:1952c766
travis_time:start:1952c766
$ 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:05c38011
$ 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)

@Centril Centril closed this Feb 13, 2019
@Centril Centril deleted the rollup branch February 13, 2019 03:32
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.