Skip to content

Replace 0 as *const/mut T with ptr::null/null_mut() #21444

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 1 commit into from
Jan 22, 2015

Conversation

petrochenkov
Copy link
Contributor

Motivation:

  • ptr::null/null_mut() are used more often in the codebase, they are more idiomatic
  • 0 as *const/mut T isn't really a conversion and skews the conversion statistics
  • some people on #rust-internals were in favor of the changes

Drawbacks:

  • More use declarations (but no new inter-crate dependencies)

@rust-highfive
Copy link
Contributor

r? @brson

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

@brson
Copy link
Contributor

brson commented Jan 20, 2015

@bors: r+ 2c2480d rollup

@brson
Copy link
Contributor

brson commented Jan 20, 2015

Nice cleanup. Thanks. 🌸

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 21, 2015
Conflicts:
	src/libstd/sync/mpsc/select.rs
@bors bors merged commit 2c2480d into rust-lang:master Jan 22, 2015
@petrochenkov petrochenkov deleted the null branch May 9, 2015 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants