rust/tests/ui/static/static-drop-scope.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
4.6 KiB
Plaintext
Raw Normal View History

error[E0493]: destructor of `WithDtor` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:7:60
2018-08-08 07:28:26 -05:00
|
LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
2020-06-20 15:38:57 -05:00
| ^^^^^^^^- value is dropped here
| |
| the destructor for this type cannot be evaluated in statics
2018-08-08 07:28:26 -05:00
error[E0716]: temporary value dropped while borrowed
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:7:60
2018-08-08 07:28:26 -05:00
|
LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
| ------^^^^^^^^-
| | | |
| | | temporary value is freed at the end of this statement
| | creates a temporary value which is freed while still in use
| using this value as a static requires that borrow lasts for `'static`
2018-08-08 07:28:26 -05:00
error[E0493]: destructor of `WithDtor` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:11:59
2018-08-08 07:28:26 -05:00
|
LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
2020-06-20 15:38:57 -05:00
| ^^^^^^^^- value is dropped here
| |
| the destructor for this type cannot be evaluated in constants
2018-08-08 07:28:26 -05:00
error[E0716]: temporary value dropped while borrowed
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:11:59
2018-08-08 07:28:26 -05:00
|
LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
| ------^^^^^^^^-
| | | |
| | | temporary value is freed at the end of this statement
| | creates a temporary value which is freed while still in use
| using this value as a constant requires that borrow lasts for `'static`
2018-08-08 07:28:26 -05:00
error[E0493]: destructor of `(WithDtor, i32)` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:15:28
2018-08-08 07:28:26 -05:00
|
LL | static EARLY_DROP_S: i32 = (WithDtor, 0).1;
2020-06-20 15:38:57 -05:00
| ^^^^^^^^^^^^^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in statics
2018-08-08 07:28:26 -05:00
error[E0493]: destructor of `(WithDtor, i32)` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:18:27
2018-08-08 07:28:26 -05:00
|
LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1;
2020-06-20 15:38:57 -05:00
| ^^^^^^^^^^^^^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constants
2018-08-08 07:28:26 -05:00
error[E0493]: destructor of `T` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:21:24
2018-08-08 07:28:26 -05:00
|
LL | const fn const_drop<T>(_: T) {}
2020-06-20 15:38:57 -05:00
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions
2018-08-08 07:28:26 -05:00
error[E0493]: destructor of `(T, ())` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:25:5
2018-08-08 07:28:26 -05:00
|
LL | (x, ()).1
| ^^^^^^^ the destructor for this type cannot be evaluated in constant functions
2020-06-20 15:38:57 -05:00
LL |
LL | }
| - value is dropped here
2018-08-08 07:28:26 -05:00
error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:29:34
|
LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
2020-06-20 15:38:57 -05:00
| ^^^^^^^^^^^^^^^^^^^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constants
error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
2021-05-07 11:56:16 -05:00
--> $DIR/static-drop-scope.rs:34:43
|
LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
2020-06-20 15:38:57 -05:00
| ^^^^^^^^^^^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constants
error: aborting due to 10 previous errors
2018-08-08 07:28:26 -05:00
2019-09-12 08:52:51 -05:00
Some errors have detailed explanations: E0493, E0716.
For more information about an error, try `rustc --explain E0493`.