Skip to content

Commit

Permalink
Add missing dyn for cloudabi, redox, unix and wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Jul 10, 2018
1 parent 560d807 commit b29a6fb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libstd/sys/cloudabi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ unsafe impl Send for Thread {}
unsafe impl Sync for Thread {}

impl Thread {
pub unsafe fn new<'a>(stack: usize, p: Box<FnBox() + 'a>) -> io::Result<Thread> {
pub unsafe fn new<'a>(stack: usize, p: Box<dyn FnBox() + 'a>) -> io::Result<Thread> {
let p = box p;
let mut native: libc::pthread_t = mem::zeroed();
let mut attr: libc::pthread_attr_t = mem::zeroed();
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ unsafe impl Send for Thread {}
unsafe impl Sync for Thread {}

impl Thread {
pub unsafe fn new<'a>(_stack: usize, p: Box<FnBox() + 'a>) -> io::Result<Thread> {
pub unsafe fn new<'a>(_stack: usize, p: Box<dyn FnBox() + 'a>) -> io::Result<Thread> {
let p = box p;

let id = cvt(syscall::clone(syscall::CLONE_VM | syscall::CLONE_FS | syscall::CLONE_FILES))?;
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/sys/unix/process/process_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct Command {
uid: Option<uid_t>,
gid: Option<gid_t>,
saw_nul: bool,
closures: Vec<Box<FnMut() -> io::Result<()> + Send + Sync>>,
closures: Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>>,
stdin: Option<Stdio>,
stdout: Option<Stdio>,
stderr: Option<Stdio>,
Expand Down Expand Up @@ -155,12 +155,12 @@ impl Command {
self.gid
}

pub fn get_closures(&mut self) -> &mut Vec<Box<FnMut() -> io::Result<()> + Send + Sync>> {
pub fn get_closures(&mut self) -> &mut Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>> {
&mut self.closures
}

pub fn before_exec(&mut self,
f: Box<FnMut() -> io::Result<()> + Send + Sync>) {
f: Box<dyn FnMut() -> io::Result<()> + Send + Sync>) {
self.closures.push(f);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ unsafe fn pthread_attr_setstacksize(_attr: *mut libc::pthread_attr_t,
}

impl Thread {
pub unsafe fn new<'a>(stack: usize, p: Box<FnBox() + 'a>)
pub unsafe fn new<'a>(stack: usize, p: Box<dyn FnBox() + 'a>)
-> io::Result<Thread> {
let p = box p;
let mut native: libc::pthread_t = mem::zeroed();
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/wasm/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Thread(Void);
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;

impl Thread {
pub unsafe fn new<'a>(_stack: usize, _p: Box<FnBox() + 'a>)
pub unsafe fn new<'a>(_stack: usize, _p: Box<dyn FnBox() + 'a>)
-> io::Result<Thread>
{
unsupported()
Expand Down

0 comments on commit b29a6fb

Please sign in to comment.