-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #44212 - eddyb:drop-const, r=nikomatsakis
Allow Drop types in const's too, with #![feature(drop_types_in_const)]. Implements the remaining amendment, see #33156. cc @SergioBenitez r? @nikomatsakis
- Loading branch information
Showing
6 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error[E0493]: constants are not allowed to have destructors | ||
--> $DIR/E0493.rs:27:17 | ||
--> $DIR/E0493.rs:29:17 | ||
| | ||
16 | fn drop(&mut self) {} | ||
18 | fn drop(&mut self) {} | ||
| --------------------- destructor defined here | ||
... | ||
27 | const F : Foo = Foo { a : 0 }; | ||
| ^^^^^^^^^^^^^ constants cannot have destructors | ||
29 | const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constants cannot have destructors | ||
|
||
error: aborting due to previous error | ||
|