5

Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` a...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/111074
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Relax implicit T: Sized bounds on BufReader<T>, BufWriter<T> and LineWriter<T> #111074

The head ref may contain hidden characters: "\u{1F31F}unsizes_your_buf_reader\u{1F31F}"

Dismiss

Conversation

Member

TL;DR:

-pub struct BufReader<R> { /* ... */ }
+pub struct BufReader<R: ?Sized> { /* ... */ }

-pub struct BufWriter<W: Write> { /* ... */ }
+pub struct BufWriter<W: ?Sized + Write> { /* ... */ }

-pub struct LineWriter<W: Write> { /* ... */ }
+pub struct LineWriter<W: ?Sized + Write> { /* ... */ }

This allows using &mut BufReader<dyn Read>, for example.

This is an insta-stable change.

est31 reacted with heart emoji

WaffleLapkin

added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label

May 1, 2023

Collaborator

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

rustbot

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label

May 1, 2023

This comment has been hidden.

This comment has been minimized.

Mark-Simulacrum

added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label).

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

May 6, 2023

dtolnay

added the needs-fcp This change is insta-stable, so needs a completed FCP to proceed. label

May 30, 2023

Member

@rfcbot fcp merge

rfcbot

commented

May 30, 2023

edited by m-ou-se

Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

rfcbot

added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.

and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.

labels

May 30, 2023

bellThis is now entering its final comment period, as per the review above. bell

WaffleLapkin reacted with hooray emoji

Amanieu

removed the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label

Jun 6, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

fbstj

fbstj left review comments
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

None yet

8 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK