Skip to content

Remove is_null - #55345

Merged
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:no-null
Oct 25, 2018
Merged

Remove is_null#55345
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:no-null

Conversation

@RalfJung

Copy link
Copy Markdown
Member

It was confusingly named (is_zero would have been better, as someone pointed out somewhere but I forgot who or where), and it didn't even reliably test for "is this value 0 at run-time" because out-of-bounds pointers can be 0.

It's not used in rustc, and miri only really needs is_null_ptr and to_bytes() == 0, so let's just kill this method.

r? @oli-obk

It was confusingly named (`is_zero` would have been better), and it didn't even
reliably test for "is this value 0 at run-time" because out-of-bounds pointers
*can* be 0.
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2018
@RalfJung

Copy link
Copy Markdown
MemberAuthor

In fact miri can stop using it right now, as demonstrated by this PR: rust-lang/miri#495

@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Oct 25, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit cbe6b22 has been approved by oli-obk

@borsbors 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 25, 2018
emilyalbini added a commit to emilyalbini/rust that referenced this pull request Oct 25, 2018
Remove is_null
It was confusingly named (`is_zero` would have been better, as someone pointed out somewhere but I forgot who or where), and it didn't even reliably test for "is this value 0 at run-time" because out-of-bounds pointers *can* be 0.
It's not used in rustc, and miri only really needs `is_null_ptr` and `to_bytes() == 0`, so let's just kill this method.
r? @oli-obk
bors added a commit that referenced this pull request Oct 25, 2018
Rollup of 22 pull requests
Successful merges:
- #53507 (Add doc for impl From for Waker)
- #53931 (Gradually expanding libstd's keyword documentation)
- #54965 (update tcp stream documentation)
- #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
- #55138 (in which unused-parens suggestions heed what the user actually wrote)
- #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
- #55200 (Documents `From` implementations for `Stdio`)
- #55245 (submodules: update clippy from 5afdf8b to b1d0343)
- #55247 (Clarified code example in char primitive doc)
- #55251 (Fix a typo in the documentation of RangeInclusive)
- #55253 (only issue "variant of the expected type" suggestion for enums)
- #55254 (Correct trailing ellipsis in name_from_pat)
- #55269 (fix typos in various places)
- #55282 (Remove redundant clone)
- #55285 (Do some copy editing on the release notes)
- #55291 (Update stdsimd submodule)
- #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs)
- #55306 (Regression test for #54478.)
- #55328 (Fix doc for new copysign functions)
- #55340 (Operands no longer appear in places)
- #55345 (Remove is_null)
- #55348 (Update RELEASES.md after destabilization of non_modrs_mods)
Failed merges:
r? @ghost
@bors
bors merged commit cbe6b22 into rust-lang:masterOct 25, 2018
@RalfJung
RalfJung deleted the no-null branch November 9, 2018 15:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@RalfJung@oli-obk@bors@rust-highfive