Skip to content

Commit

Permalink
Rollup merge of rust-lang#57311 - dlrobertson:fix_valist_copy, r=KodrAus
Browse files Browse the repository at this point in the history
VaList::copy should not require a mutable ref

`VaList::copy` does not need to take a mutable reference. The `va_copy`
intrinsic takes a immutable reference.
  • Loading branch information
kennytm committed Jan 5, 2019
2 parents 952af5e + 917985e commit dfc1037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl<'a> VaList<'a> {
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "27745")]
pub unsafe fn copy<F, R>(&mut self, f: F) -> R
pub unsafe fn copy<F, R>(&self, f: F) -> R
where F: for<'copy> FnOnce(VaList<'copy>) -> R {
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
not(target_arch = "x86_64")),
Expand Down

0 comments on commit dfc1037

Please sign in to comment.