]> git.lizzy.rs Git - rust.git/commitdiff
Bug fixes
authorNick Cameron <ncameron@mozilla.com>
Tue, 24 Mar 2015 00:50:14 +0000 (13:50 +1300)
committerNick Cameron <ncameron@mozilla.com>
Tue, 24 Mar 2015 21:37:03 +0000 (10:37 +1300)
src/librustc_typeck/check/coercion.rs
src/libstd/sys/windows/os.rs
src/libstd/thread/local.rs
src/libterm/win.rs

index 8ad11e19b347b93503fb1f2f6aa46ae8904095ba..ae1dbbb1b00ad2ca0dc0d619344fc5aaea99e8e5 100644 (file)
@@ -381,29 +381,6 @@ fn unsize_ty(&self,
                             None
                         }
                     }
-                    (&ty::ty_trait(ref data_a), &ty::ty_trait(ref data_b)) => {
-                        // For now, we only support upcasts from
-                        // `Foo+Send` to `Foo` (really, any time there are
-                        // fewer builtin bounds then before). These are
-                        // convenient because they don't require any sort
-                        // of change to the vtable at runtime.
-                        if data_a.bounds.builtin_bounds != data_b.bounds.builtin_bounds &&
-                            data_a.bounds.builtin_bounds.is_superset(&data_b.bounds.builtin_bounds)
-                        {
-                            let bounds_a1 = ty::ExistentialBounds {
-                                region_bound: data_a.bounds.region_bound,
-                                builtin_bounds: data_b.bounds.builtin_bounds,
-                                projection_bounds: data_a.bounds.projection_bounds.clone(),
-                            };
-                            let ty_a1 = ty::mk_trait(tcx, data_a.principal.clone(), bounds_a1);
-                            match self.fcx.infcx().try(|_| self.subtype(ty_a1, ty_b)) {
-                                Ok(_) => Some((ty_b, ty::UnsizeUpcast(ty_b))),
-                                Err(_) => None,
-                            }
-                        } else {
-                            None
-                        }
-                    }
                     (_, &ty::ty_trait(ref data)) => {
                         Some((ty_b, ty::UnsizeVtable(ty::TyTrait {
                                                          principal: data.principal.clone(),
index 83d0637173444c56cb4dbb46a7dfc1f715b712a4..167db1e8ac2d790b056c05af6bd78b8bdb8cdb86 100644 (file)
@@ -109,7 +109,7 @@ fn next(&mut self) -> Option<(OsString, OsString)> {
             if *self.cur == 0 { return None }
             let p = &*self.cur;
             let mut len = 0;
-            while *(p as *const _).offset(len) != 0 {
+            while *(p as *const u16).offset(len) != 0 {
                 len += 1;
             }
             let p = p as *const u16;
index 1bf1b09681c4a360b03232187b31610730f7200a..a2b824bb016ffa401255a488249e480e0d56eaf8 100644 (file)
@@ -176,6 +176,7 @@ macro_rules! __thread_local_inner {
             }
         };
 
+        #[allow(trivial_casts)]
         #[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
         const _INIT: ::std::thread::__local::__impl::KeyInner<$t> = {
             ::std::thread::__local::__impl::KeyInner {
index e29e0e27394db93a3103fc149c9baf424cbf930f..001313db6769f133b8f8166b16c61428ead730a4 100644 (file)
@@ -126,7 +126,7 @@ pub fn new(out: T) -> Option<Box<Terminal<T>+Send+'static>> {
         }
         Some(box WinConsole { buf: out,
                               def_foreground: fg, def_background: bg,
-                              foreground: fg, background: bg } as Box<Terminal<T>+Send>)
+                              foreground: fg, background: bg })
     }
 }