-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error on private items with stability attributes #83397
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
2 changes: 1 addition & 1 deletion
2
src/test/ui/stability-attribute/missing-stability-attr-at-top-level.rs
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,4 +1,4 @@ | ||
#![feature(staged_api)] | ||
//~^ ERROR module has missing stability attribute | ||
//~^ ERROR module is missing a stability attribute | ||
|
||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
src/test/ui/stability-attribute/missing-stability-attr-at-top-level.stderr
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
2 changes: 1 addition & 1 deletion
2
src/test/ui/stability-attribute/stability-attribute-sanity-3.stderr
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
29 changes: 29 additions & 0 deletions
29
src/test/ui/stability-attribute/stability-without-publicity.rs
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,29 @@ | ||
#![feature(staged_api)] | ||
#![stable(feature = "rust1", since = "1.0.0")] | ||
#![crate_type = "lib"] | ||
|
||
#[stable(feature = "rust1", since = "1.0.0")] | ||
mod mod_stable {} | ||
//~^ ERROR module is private but has a stability attribute | ||
|
||
#[unstable(feature = "foo", issue = "none")] | ||
mod mod_unstable {} | ||
//~^ ERROR module is private but has a stability attribute | ||
|
||
#[stable(feature = "rust1", since = "1.0.0")] | ||
fn fn_stable() {} | ||
//~^ ERROR function is private but has a stability attribute | ||
|
||
#[unstable(feature = "foo", issue = "none")] | ||
fn fn_unstable() {} | ||
//~^ ERROR function is private but has a stability attribute | ||
|
||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[rustc_const_stable(feature = "rust1", since = "1.0.0")] | ||
const fn const_fn_stable() {} | ||
//~^ ERROR function is private but has a stability attribute | ||
|
||
#[unstable(feature = "foo", issue = "none")] | ||
#[rustc_const_unstable(feature = "foo", issue = "none")] | ||
const fn const_fn_unstable() {} | ||
//~^ ERROR function is private but has a stability attribute |
56 changes: 56 additions & 0 deletions
56
src/test/ui/stability-attribute/stability-without-publicity.stderr
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,56 @@ | ||
error: module is private but has a stability attribute | ||
--> $DIR/stability-without-publicity.rs:6:1 | ||
| | ||
LL | mod mod_stable {} | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: if it is meant to be private, remove the stability attribute | ||
= help: or, if it is meant to be public, make it public | ||
|
||
error: module is private but has a stability attribute | ||
--> $DIR/stability-without-publicity.rs:10:1 | ||
| | ||
LL | mod mod_unstable {} | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: if it is meant to be private, remove the stability attribute | ||
= help: or, if it is meant to be public, make it public | ||
|
||
error: function is private but has a stability attribute | ||
--> $DIR/stability-without-publicity.rs:14:1 | ||
| | ||
LL | fn fn_stable() {} | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: if it is meant to be private, remove the stability attribute | ||
= help: or, if it is meant to be public, make it public | ||
|
||
error: function is private but has a stability attribute | ||
--> $DIR/stability-without-publicity.rs:18:1 | ||
| | ||
LL | fn fn_unstable() {} | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: if it is meant to be private, remove the stability attribute | ||
= help: or, if it is meant to be public, make it public | ||
|
||
error: function is private but has a stability attribute | ||
--> $DIR/stability-without-publicity.rs:23:1 | ||
| | ||
LL | const fn const_fn_stable() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: if it is meant to be private, remove the stability attribute | ||
= help: or, if it is meant to be public, make it public | ||
|
||
error: function is private but has a stability attribute | ||
--> $DIR/stability-without-publicity.rs:28:1 | ||
| | ||
LL | const fn const_fn_unstable() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: if it is meant to be private, remove the stability attribute | ||
= help: or, if it is meant to be public, make it public | ||
|
||
error: aborting due to 6 previous errors | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this is currently buggy: #64762