Skip to content
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

std: Remove deprecated ptr functions #23503

Merged
merged 1 commit into from
Mar 24, 2015
Merged

Conversation

alexcrichton
Copy link
Member

The method with which backwards compatibility was retained ended up leading to
documentation that rustdoc didn't handle well and largely ended up confusing.

@rust-highfive
Copy link
Collaborator

r? @brson

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

#[stable(feature = "rust1", since = "1.0.0")]
pub fn copy_memory<T>(dst: *mut T, src: *const T, count: usize);

/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
/// bytes of memory starting at `dst` to `c`.
#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe set_all is a better name? Closer to memset.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR isn't changing the names, though. It's just bringing the intrinsics in line with the already-stable names to improve the rustdoc output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(FWIW, I do like this suggestion. But it's probably too late to change at this point.)

@@ -44,6 +44,10 @@

use marker::Sized;

#[cfg(stage0)] pub use self::copy_memory as copy;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// SNAP comment please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally very much prefer to not use // SNAP as in the past it has ended up causing lots of pain when registering a new snapshot. It simultaneously forces the snapshot-maker to do the work necessary to remove it (which can be quite large and isn't always necessary) and also causes extra pain if a // SNAP annotation was added after the new snapshot was made.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have some way of marking that lines should be removed with the new snapshot? The amount of permanently-#[cfg(stage0)]d code is probably going to keep increasing, and the snapshot maker has to go through this each time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string stage0 is enough, I regularly clean out via git grep stage0 whenever a new snapshot is registered. We have very little permanent #[cfg(stage0)]

@bors
Copy link
Contributor

bors commented Mar 21, 2015

☔ The latest upstream changes (presumably #23470) made this pull request unmergeable. Please resolve the merge conflicts.

The method with which backwards compatibility was retained ended up leading to
documentation that rustdoc didn't handle well and largely ended up confusing.
@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned brson Mar 23, 2015
@aturon
Copy link
Member

aturon commented Mar 23, 2015

@bors: r+ e24fe5b

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 23, 2015
The method with which backwards compatibility was retained ended up leading to
documentation that rustdoc didn't handle well and largely ended up confusing.
@bors bors merged commit e24fe5b into rust-lang:master Mar 24, 2015
@alexcrichton alexcrichton deleted the fix-ptr-docs branch March 27, 2015 20:36
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.

7 participants