]> git.lizzy.rs Git - rust.git/commitdiff
Use existing tcx instead
authorChristian Poveda <christianpoveda@protonmail.com>
Fri, 11 Oct 2019 09:20:18 +0000 (04:20 -0500)
committerChristian Poveda <christianpoveda@protonmail.com>
Fri, 11 Oct 2019 09:20:18 +0000 (04:20 -0500)
src/shims/env.rs

index 6f32783d7a7679872aa85dc6a6ff6523b83271a7..8c1645cde738e3ba38c5119ba17469deab3274c8 100644 (file)
@@ -127,7 +127,7 @@ fn getcwd(
         let tcx = &{ this.tcx.tcx };
 
         let buf = this.force_ptr(this.read_scalar(buf_op)?.not_undef()?)?;
-        let size = this.read_scalar(size_op)?.to_usize(&*this.tcx)?;
+        let size = this.read_scalar(size_op)?.to_usize(&*tcx)?;
         // If we cannot get the current directory, we return null
         match env::current_dir() {
             Ok(cwd) => {
@@ -152,7 +152,7 @@ fn getcwd(
             }
             Err(e) => this.consume_io_error(e)?,
         }
-        Ok(Scalar::ptr_null(&*this.tcx))
+        Ok(Scalar::ptr_null(&*tcx))
     }
 
     fn chdir(&mut self, path_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, i32> {