-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Use impl restrictions in std, core
#157170
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1195,7 +1195,7 @@ pub(crate) fn attempt_print_to_stderr(args: fmt::Arguments<'_>) { | |
|
|
||
| /// Trait to determine if a descriptor/handle refers to a terminal/tty. | ||
| #[stable(feature = "is_terminal", since = "1.70.0")] | ||
| pub trait IsTerminal: crate::sealed::Sealed { | ||
| pub impl(crate) trait IsTerminal { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we want to block this PR on rustdoc support?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not opposed to blocking it on such. I deliberately left any "this trait is sealed" comments for that reason. Once there's rustdoc support, all of those can be removed as well.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to wait for rustdoc as long as it's clear that the trait is sealed in the docs. We might have a rustdoc implementation soon enough1. I could also see a middleground and have both the Let's nominate it for T-libs to decide. Footnotes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could temporarily add doc comments to each relevant trait. |
||
| /// Returns `true` if the descriptor/handle refers to a terminal/tty. | ||
| /// | ||
| /// On platforms where Rust does not know how to detect a terminal yet, this will return | ||
|
|
@@ -1250,9 +1250,6 @@ pub trait IsTerminal: crate::sealed::Sealed { | |
|
|
||
| macro_rules! impl_is_terminal { | ||
| ($($t:ty),*$(,)?) => {$( | ||
| #[unstable(feature = "sealed", issue = "none")] | ||
| impl crate::sealed::Sealed for $t {} | ||
|
|
||
| #[stable(feature = "is_terminal", since = "1.70.0")] | ||
| impl IsTerminal for $t { | ||
| #[inline] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
is there a reason this was left as sealed instead of
impl(self)and if so is it worth a comment or aTODO/FIXME?View changes since the review
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.
The name change sums it up — the
VALUEitem is private and never intended to be exposed publicly, so we need to continue using the previous hack. The alternative is to use aconst Defaultbound and removeVALUEaltogether, but iirc that was decided against in my PR implementing the variance helpers.