forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#118123 - RalfJung:internal-lib-features, r=compiler-errors Add support for making lib features internal We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug. This extends that idea to lib features as well. It is an alternative to rust-lang#115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal. Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes rust-lang#115597.
- Loading branch information
Showing
8 changed files
with
59 additions
and
8 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
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,11 @@ | ||
#![forbid(internal_features)] | ||
// A lang feature and a lib feature. | ||
#![feature(intrinsics, panic_internals)] | ||
//~^ ERROR: internal | ||
//~| ERROR: internal | ||
|
||
extern "rust-intrinsic" { | ||
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize); | ||
} | ||
|
||
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: the feature `intrinsics` is internal to the compiler or standard library | ||
--> $DIR/internal_features.rs:3:12 | ||
| | ||
LL | #![feature(intrinsics, panic_internals)] | ||
| ^^^^^^^^^^ | ||
| | ||
= note: using it is strongly discouraged | ||
note: the lint level is defined here | ||
--> $DIR/internal_features.rs:1:11 | ||
| | ||
LL | #![forbid(internal_features)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: the feature `panic_internals` is internal to the compiler or standard library | ||
--> $DIR/internal_features.rs:3:24 | ||
| | ||
LL | #![feature(intrinsics, panic_internals)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: using it is strongly discouraged | ||
|
||
error: aborting due to 2 previous errors | ||
|