-
-
Notifications
You must be signed in to change notification settings - Fork 15.6k
lint ineffective #[unstable] annotations on re-exports #161178
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
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
79d5626
lint ineffective #[unstable] annotations on re-exports
amirHdev 7b7695d
handle std fallout from unstable re-export lint
amirHdev 7249fbc
allow clippy on unstable re-export suppressions
amirHdev e22c3c2
add dedicated lint for ineffective unstable re-exports
amirHdev fbec8a6
refine unstable reexport lint
amirHdev b91102a
generalize re-export stability checks
amirHdev 73e6922
fix s390x re-export stability metadata
amirHdev a246018
fix incompatible reexport stability diagnostics
amirHdev baaac65
only lint ineffective unstable re-exports
amirHdev 8a0d8f7
avoid depending on Reexport's module path
amirHdev be9d5a8
fix tidy formatting
amirHdev d8059af
handle unstable modules in ineffective reexport lint
amirHdev 1017887
avoid stability lookup without reexports
amirHdev f5557b0
fix bootstrap doctest for ineffective unstable reexports
amirHdev 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
Some comments aren't visible on the classic Files Changed page.
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
7 changes: 7 additions & 0 deletions
7
tests/ui/feature-gates/feature-gate-ineffective_unstable_reexports.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,7 @@ | ||
| //@ check-pass | ||
| //@ normalize-stderr: "(\n)\n$" -> "$1" | ||
| // This lint is only available with `staged_api`. | ||
| #![allow(ineffective_unstable_reexports)] | ||
| //~^ WARNING unknown lint: `ineffective_unstable_reexports` | ||
|
|
||
| fn main() {} |
10 changes: 10 additions & 0 deletions
10
tests/ui/feature-gates/feature-gate-ineffective_unstable_reexports.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,10 @@ | ||
| warning: unknown lint: `ineffective_unstable_reexports` | ||
| --> $DIR/feature-gate-ineffective_unstable_reexports.rs:4:10 | ||
| | | ||
| LL | #![allow(ineffective_unstable_reexports)] | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| = note: the `ineffective_unstable_reexports` lint is unstable | ||
| = note: `#[warn(unknown_lints)]` on by default | ||
|
|
||
| warning: 1 warning emitted |
4 changes: 4 additions & 0 deletions
4
tests/ui/stability-attribute/auxiliary/non-staged-reexport-source.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,4 @@ | ||
| #![crate_type = "lib"] | ||
| #![crate_name = "non_staged_reexport_source"] | ||
|
|
||
| pub fn stable() {} |
10 changes: 10 additions & 0 deletions
10
tests/ui/stability-attribute/auxiliary/stable-glob-source.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"] | ||
| #![crate_name = "stable_glob_source"] | ||
| #![feature(staged_api)] | ||
| #![stable(feature = "stable_glob_source", since = "1.0.0")] | ||
|
|
||
| #[stable(feature = "stable_glob_source", since = "1.0.0")] | ||
| pub fn stable_a() {} | ||
|
|
||
| #[stable(feature = "stable_glob_source", since = "1.0.0")] | ||
| pub fn stable_b() {} |
13 changes: 13 additions & 0 deletions
13
tests/ui/stability-attribute/auxiliary/unstable-glob-source.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,13 @@ | ||
| #![crate_type = "lib"] | ||
| #![feature(staged_api)] | ||
| #![stable(feature = "unstable_glob_source_crate", since = "1.0.0")] | ||
|
|
||
| #[unstable(feature = "unstable_glob_source", issue = "none")] | ||
| pub fn unstable_a() {} | ||
|
|
||
| #[unstable( | ||
| feature = "unstable_glob_source", | ||
| reason = "different reason", | ||
| issue = "none" | ||
| )] | ||
| pub fn unstable_b() {} |
20 changes: 20 additions & 0 deletions
20
tests/ui/stability-attribute/ineffective-unstable-reexports-glob.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,20 @@ | ||
| //@ aux-build:stable-glob-source.rs | ||
| //@ aux-build:unstable-glob-source.rs | ||
| //@ normalize-stderr: "(\n)\n$" -> "$1" | ||
|
|
||
| #![crate_type = "lib"] | ||
| #![feature(staged_api)] | ||
| #![deny(ineffective_unstable_reexports)] | ||
| #![stable(feature = "reexport_test", since = "1.0.0")] | ||
|
|
||
| extern crate stable_glob_source; | ||
| extern crate unstable_glob_source; | ||
|
|
||
| // The unstable annotation is ineffective because every target is stable. | ||
| #[unstable(feature = "stable_glob_reexport", issue = "none")] | ||
| pub use stable_glob_source::*; | ||
| //~^ ERROR `#[unstable]` does not make this re-exported path unstable | ||
|
|
||
| // The annotation remains meaningful because these targets are unstable. | ||
| #[unstable(feature = "unstable_glob_source", issue = "none")] | ||
| pub use unstable_glob_source::*; |
Oops, something went wrong.
Oops, something went wrong.
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.