-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Support unstable moves via stable in unstable items #95956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+304
−33
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e7fe545
Support unstable moves via stable in unstable items
yaahc d68cb1f
revert changes to unicode stability
yaahc 67fe842
update comment
yaahc a13f300
clarify comment
yaahc b55453d
add opt in attribute for stable-in-unstable items
yaahc 0715616
add rt flag to allowed internal unstable for RustcEncodable/Decodable
yaahc 87eafe8
wip test
yaahc e4e6b1e
fixes post rebase
yaahc 7d328fe
fix stderr output file after rebase
yaahc 3e2c5b5
remove broken test
yaahc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 +1,5 @@ | ||
#[test] | ||
pub fn version() { | ||
let (major, _minor, _update) = core::unicode::UNICODE_VERSION; | ||
let (major, _minor, _update) = core::char::UNICODE_VERSION; | ||
assert!(major >= 10); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,6 +1,7 @@ | ||
// run-pass | ||
|
||
#![feature(const_eval_select)] | ||
#![feature(core_intrinsics)] | ||
|
||
use std::intrinsics::const_eval_select; | ||
|
||
|
This file contains hidden or 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
src/test/ui/stability-attribute/accidental-stable-in-unstable.rs
This file contains hidden or 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,10 @@ | ||
#![crate_type = "lib"] | ||
extern crate core; | ||
|
||
// Known accidental stabilizations with no known users, slated for un-stabilization | ||
// fully stable @ core::char::UNICODE_VERSION | ||
use core::unicode::UNICODE_VERSION; //~ ERROR use of unstable library feature 'unicode_internals' | ||
|
||
// Known accidental stabilizations with known users | ||
// fully stable @ core::mem::transmute | ||
use core::intrinsics::transmute; // depended upon by rand_core |
11 changes: 11 additions & 0 deletions
11
src/test/ui/stability-attribute/accidental-stable-in-unstable.stderr
This file contains hidden or 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 @@ | ||
error[E0658]: use of unstable library feature 'unicode_internals' | ||
--> $DIR/accidental-stable-in-unstable.rs:6:5 | ||
| | ||
LL | use core::unicode::UNICODE_VERSION; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add `#![feature(unicode_internals)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains hidden or 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,9 @@ | ||
// Test for new `#[rustc_allowed_through_unstable_modules]` attribute | ||
// | ||
// aux-build:allowed-through-unstable-core.rs | ||
#![crate_type = "lib"] | ||
|
||
extern crate allowed_through_unstable_core; | ||
|
||
use allowed_through_unstable_core::unstable_module::OldStableTraitAllowedThoughUnstable; | ||
use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowedThroughUnstable; //~ ERROR use of unstable library feature 'unstable_test_feature' |
12 changes: 12 additions & 0 deletions
12
src/test/ui/stability-attribute/allowed-through-unstable.stderr
This file contains hidden or 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,12 @@ | ||
error[E0658]: use of unstable library feature 'unstable_test_feature' | ||
--> $DIR/allowed-through-unstable.rs:9:5 | ||
| | ||
LL | use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowedThroughUnstable; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | ||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
14 changes: 14 additions & 0 deletions
14
src/test/ui/stability-attribute/auxiliary/allowed-through-unstable-core.rs
This file contains hidden or 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,14 @@ | ||
#![crate_type = "lib"] | ||
#![feature(staged_api)] | ||
#![feature(rustc_attrs)] | ||
#![stable(feature = "stable_test_feature", since = "1.2.0")] | ||
|
||
#[unstable(feature = "unstable_test_feature", issue = "1")] | ||
pub mod unstable_module { | ||
#[stable(feature = "stable_test_feature", since = "1.2.0")] | ||
#[rustc_allowed_through_unstable_modules] | ||
pub trait OldStableTraitAllowedThoughUnstable {} | ||
|
||
#[stable(feature = "stable_test_feature", since = "1.2.0")] | ||
pub trait NewStableTraitNotAllowedThroughUnstable {} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/stability-attribute/auxiliary/stable-in-unstable-core.rs
This file contains hidden or 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,8 @@ | ||
#![feature(staged_api)] | ||
#![stable(feature = "stable_test_feature", since = "1.2.0")] | ||
|
||
#[unstable(feature = "unstable_test_feature", issue = "1")] | ||
pub mod new_unstable_module { | ||
#[stable(feature = "stable_test_feature", since = "1.2.0")] | ||
pub trait OldTrait {} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/stability-attribute/auxiliary/stable-in-unstable-std.rs
This file contains hidden or 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 @@ | ||
#![feature(staged_api)] | ||
#![feature(unstable_test_feature)] | ||
#![stable(feature = "stable_test_feature", since = "1.2.0")] | ||
|
||
extern crate stable_in_unstable_core; | ||
|
||
#[stable(feature = "stable_test_feature", since = "1.2.0")] | ||
pub mod old_stable_module { | ||
#[stable(feature = "stable_test_feature", since = "1.2.0")] | ||
pub use stable_in_unstable_core::new_unstable_module::OldTrait; | ||
} |
This file contains hidden or 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,46 @@ | ||
// This test is meant to test that we can have a stable item in an unstable module, and that | ||
// calling that item through the unstable module is unstable, but that re-exporting it from another | ||
// crate in a stable module is fine. | ||
// | ||
// This is necessary to support moving items from `std` into `core` or `alloc` unstably while still | ||
// exporting the original stable interface in `std`, such as moving `Error` into `core`. | ||
// | ||
// aux-build:stable-in-unstable-core.rs | ||
// aux-build:stable-in-unstable-std.rs | ||
#![crate_type = "lib"] | ||
|
||
extern crate stable_in_unstable_core; | ||
extern crate stable_in_unstable_std; | ||
|
||
mod isolated1 { | ||
use stable_in_unstable_core::new_unstable_module; //~ ERROR use of unstable library feature 'unstable_test_feature' | ||
use stable_in_unstable_core::new_unstable_module::OldTrait; //~ ERROR use of unstable library feature 'unstable_test_feature' | ||
} | ||
|
||
mod isolated2 { | ||
use stable_in_unstable_std::old_stable_module::OldTrait; | ||
|
||
struct LocalType; | ||
|
||
impl OldTrait for LocalType {} | ||
} | ||
|
||
mod isolated3 { | ||
use stable_in_unstable_core::new_unstable_module::OldTrait; //~ ERROR use of unstable library feature 'unstable_test_feature' | ||
|
||
struct LocalType; | ||
|
||
impl OldTrait for LocalType {} | ||
} | ||
|
||
mod isolated4 { | ||
struct LocalType; | ||
|
||
impl stable_in_unstable_core::new_unstable_module::OldTrait for LocalType {} //~ ERROR use of unstable library feature 'unstable_test_feature' | ||
} | ||
|
||
mod isolated5 { | ||
struct LocalType; | ||
|
||
impl stable_in_unstable_std::old_stable_module::OldTrait for LocalType {} | ||
} |
This file contains hidden or 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,39 @@ | ||
error[E0658]: use of unstable library feature 'unstable_test_feature' | ||
--> $DIR/stable-in-unstable.rs:16:9 | ||
| | ||
LL | use stable_in_unstable_core::new_unstable_module; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | ||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable | ||
|
||
error[E0658]: use of unstable library feature 'unstable_test_feature' | ||
--> $DIR/stable-in-unstable.rs:17:9 | ||
| | ||
LL | use stable_in_unstable_core::new_unstable_module::OldTrait; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | ||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable | ||
|
||
error[E0658]: use of unstable library feature 'unstable_test_feature' | ||
--> $DIR/stable-in-unstable.rs:29:9 | ||
| | ||
LL | use stable_in_unstable_core::new_unstable_module::OldTrait; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | ||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable | ||
|
||
error[E0658]: use of unstable library feature 'unstable_test_feature' | ||
--> $DIR/stable-in-unstable.rs:39:10 | ||
| | ||
LL | impl stable_in_unstable_core::new_unstable_module::OldTrait for LocalType {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | ||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.