Skip to content

Add #[must_use] to as_type conversions #89778

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

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

jkugelman
Copy link
Contributor

Clippy missed these:

alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;

Parent issue: #89692

r? @joshtriplett

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2021
@jkugelman
Copy link
Contributor Author

Actually jeez, I just grepped by hand and there are another 69 as_xxx methods Clippy missed. Oh well, that's for another time.

@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 11, 2021
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 11, 2021

📌 Commit 06e625f has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2021
…ons, r=joshtriplett

Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;
```

Parent issue: rust-lang#89692

r? `@joshtriplett`
@the8472 the8472 added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 11, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 12, 2021
…ons, r=joshtriplett

Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;
```

Parent issue: rust-lang#89692

r? ``@joshtriplett``
the8472 added a commit to the8472/rust that referenced this pull request Oct 12, 2021
…ons, r=joshtriplett

Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;
```

Parent issue: rust-lang#89692

r? ```@joshtriplett```
This was referenced Oct 12, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 12, 2021
Rollup of 7 pull requests

Successful merges:

 - rust-lang#89778 (Add #[must_use] to as_type conversions)
 - rust-lang#89784 (Remove built-in query cache_hit tracking)
 - rust-lang#89796 (Add #[must_use] to non-mutating verb methods)
 - rust-lang#89797 (Add #[must_use] to is_condition tests)
 - rust-lang#89799 (fix minor spelling error in Poll::ready docs)
 - rust-lang#89800 (Update books)
 - rust-lang#89809 (Remap ssa RealPredicate to llvm RealPredicate)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b55a3c5 into rust-lang:master Oct 12, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 12, 2021
@jkugelman jkugelman deleted the must-use-as_type-conversions branch October 12, 2021 21:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants