2022-09-23 09:22:36 -05:00
|
|
|
error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/min_const_fn.rs:37:25
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | const fn into_inner(self) -> T { self.0 }
|
2020-06-20 15:38:57 -05:00
|
|
|
| ^^^^ - value is dropped here
|
|
|
|
| |
|
2022-09-23 09:22:36 -05:00
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2020-09-29 16:58:00 -05:00
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
|
|
|
--> $DIR/min_const_fn.rs:39:22
|
|
|
|
|
|
|
|
|
LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
|
|
|
--> $DIR/min_const_fn.rs:39:36
|
|
|
|
|
|
|
|
|
LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
|
|
|
--> $DIR/min_const_fn.rs:39:45
|
|
|
|
|
|
|
|
|
LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
2022-09-23 09:22:36 -05:00
|
|
|
error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:46:28
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | const fn into_inner_lt(self) -> T { self.0 }
|
2020-06-20 15:38:57 -05:00
|
|
|
| ^^^^ - value is dropped here
|
|
|
|
| |
|
2022-09-23 09:22:36 -05:00
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2020-09-23 23:05:59 -05:00
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:48:25
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:48:42
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:48:51
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
2022-09-23 09:22:36 -05:00
|
|
|
error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:55:27
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | const fn into_inner_s(self) -> T { self.0 }
|
2020-06-20 15:38:57 -05:00
|
|
|
| ^^^^ - value is dropped here
|
|
|
|
| |
|
2022-09-23 09:22:36 -05:00
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2020-09-23 23:05:59 -05:00
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:57:24
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:57:38
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:57:47
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:64:25
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:64:39
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2020-09-29 19:31:04 -05:00
|
|
|
--> $DIR/min_const_fn.rs:64:48
|
2020-09-29 16:58:00 -05:00
|
|
|
|
|
|
|
|
LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
|
|
|
|
2020-09-17 12:32:07 -05:00
|
|
|
error[E0013]: constant functions cannot refer to statics
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:89:27
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | const fn foo25() -> u32 { BAR }
|
2018-08-22 08:56:37 -05:00
|
|
|
| ^^^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2020-09-17 12:32:07 -05:00
|
|
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2020-09-17 12:32:07 -05:00
|
|
|
error[E0013]: constant functions cannot refer to statics
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:90:37
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | const fn foo26() -> &'static u32 { &BAR }
|
2019-11-11 05:15:38 -06:00
|
|
|
| ^^^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2020-09-17 12:32:07 -05:00
|
|
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2021-10-03 01:53:02 -05:00
|
|
|
error: pointers cannot be cast to integers during const eval
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:91:42
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
|
|
|
LL | const fn foo30(x: *const u32) -> usize { x as usize }
|
|
|
|
| ^^^^^^^^^^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2021-07-10 04:33:42 -05:00
|
|
|
= note: at compile-time, pointers do not have an integer value
|
|
|
|
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2021-10-03 01:53:02 -05:00
|
|
|
error: pointers cannot be cast to integers during const eval
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:93:63
|
2018-12-07 11:26:46 -06:00
|
|
|
|
|
|
|
|
LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
|
|
|
|
| ^^^^^^^^^^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2021-07-10 04:33:42 -05:00
|
|
|
= note: at compile-time, pointers do not have an integer value
|
|
|
|
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
|
2018-12-07 11:26:46 -06:00
|
|
|
|
2021-10-03 01:53:02 -05:00
|
|
|
error: pointers cannot be cast to integers during const eval
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:95:42
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
|
|
|
LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
|
|
|
|
| ^^^^^^^^^^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2021-07-10 04:33:42 -05:00
|
|
|
= note: at compile-time, pointers do not have an integer value
|
|
|
|
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2021-10-03 01:53:02 -05:00
|
|
|
error: pointers cannot be cast to integers during const eval
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:97:63
|
2018-12-07 11:26:46 -06:00
|
|
|
|
|
|
|
|
LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
|
|
|
|
| ^^^^^^^^^^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2021-07-10 04:33:42 -05:00
|
|
|
= note: at compile-time, pointers do not have an integer value
|
|
|
|
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
|
2018-12-07 11:26:46 -06:00
|
|
|
|
2020-09-23 23:05:59 -05:00
|
|
|
error[E0658]: mutable references are not allowed in constant functions
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:100:14
|
2018-08-22 08:56:37 -05:00
|
|
|
|
|
|
|
|
LL | const fn inc(x: &mut i32) { *x += 1 }
|
|
|
|
| ^
|
2019-02-05 14:27:44 -06:00
|
|
|
|
|
2020-09-23 23:05:59 -05:00
|
|
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
|
|
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2022-09-23 09:22:36 -05:00
|
|
|
error[E0493]: destructor of `AlanTuring<impl std::fmt::Debug>` cannot be evaluated at compile-time
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:122:19
|
2020-09-29 20:52:26 -05:00
|
|
|
|
|
|
|
|
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
|
|
|
|
| ^^ - value is dropped here
|
|
|
|
| |
|
2022-09-23 09:22:36 -05:00
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
2020-09-29 20:52:26 -05:00
|
|
|
|
2022-09-23 09:22:36 -05:00
|
|
|
error[E0493]: destructor of `impl std::fmt::Debug` cannot be evaluated at compile-time
|
2022-02-09 12:53:40 -06:00
|
|
|
--> $DIR/min_const_fn.rs:124:18
|
2020-09-29 20:52:26 -05:00
|
|
|
|
|
|
|
|
LL | const fn no_apit(_x: impl std::fmt::Debug) {}
|
|
|
|
| ^^ - value is dropped here
|
|
|
|
| |
|
2022-09-23 09:22:36 -05:00
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
2020-09-29 20:52:26 -05:00
|
|
|
|
2022-02-09 12:53:40 -06:00
|
|
|
error: aborting due to 24 previous errors
|
2018-08-22 08:56:37 -05:00
|
|
|
|
2021-04-18 12:02:33 -05:00
|
|
|
Some errors have detailed explanations: E0013, E0493, E0658.
|
2020-09-17 12:32:07 -05:00
|
|
|
For more information about an error, try `rustc --explain E0013`.
|