forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forbid implementing
Freeze
even if the trait is stabilized
- Loading branch information
Showing
10 changed files
with
62 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
rustc_attrs, | ||
transparent_unions, | ||
auto_traits, | ||
freeze_impls, | ||
thread_local | ||
)] | ||
#![no_core] | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#![feature(freeze, negative_impls)] | ||
|
||
use std::marker::Freeze; | ||
|
||
struct Foo; | ||
|
||
unsafe impl Freeze for Foo {} | ||
//~^ explicit impls for the `Freeze` trait are not permitted | ||
|
||
struct Bar; | ||
|
||
impl !Freeze for Bar {} | ||
//~^ explicit impls for the `Freeze` trait are not permitted | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
error[E0658]: explicit impls for the `Freeze` trait are not permitted | ||
--> $DIR/feature-gate-freeze-impls.rs:7:1 | ||
| | ||
LL | unsafe impl Freeze for Foo {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Freeze` not allowed | ||
| | ||
= note: see issue #121675 <https://github.com/rust-lang/rust/issues/121675> for more information | ||
= help: add `#![feature(freeze_impls)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: explicit impls for the `Freeze` trait are not permitted | ||
--> $DIR/feature-gate-freeze-impls.rs:12:1 | ||
| | ||
LL | impl !Freeze for Bar {} | ||
| ^^^^^^^^^^^^^^^^^^^^ impl of `Freeze` not allowed | ||
| | ||
= note: see issue #121675 <https://github.com/rust-lang/rust/issues/121675> for more information | ||
= help: add `#![feature(freeze_impls)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |