about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2015-03-24 13:50:14 +1300
committerNick Cameron <ncameron@mozilla.com>2015-03-25 10:37:03 +1300
commit7e3ee02006ec53ff176fc3490ba01eb2a9c823b8 (patch)
treef2eb7fc20a87d794676517f672ea94506dbeff09
parente7122a5a09d06aedd1d27d14c3ac38c40b0a7425 (diff)
downloadrust-7e3ee02006ec53ff176fc3490ba01eb2a9c823b8.tar.gz
rust-7e3ee02006ec53ff176fc3490ba01eb2a9c823b8.zip
Bug fixes
-rw-r--r--src/librustc_typeck/check/coercion.rs23
-rw-r--r--src/libstd/sys/windows/os.rs2
-rw-r--r--src/libstd/thread/local.rs1
-rw-r--r--src/libterm/win.rs2
4 files changed, 3 insertions, 25 deletions
diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs
index 8ad11e19b34..ae1dbbb1b00 100644
--- a/src/librustc_typeck/check/coercion.rs
+++ b/src/librustc_typeck/check/coercion.rs
@@ -381,29 +381,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
                             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(),
diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs
index 83d06371734..167db1e8ac2 100644
--- a/src/libstd/sys/windows/os.rs
+++ b/src/libstd/sys/windows/os.rs
@@ -109,7 +109,7 @@ impl Iterator for Env {
             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;
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 1bf1b09681c..a2b824bb016 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -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 {
diff --git a/src/libterm/win.rs b/src/libterm/win.rs
index e29e0e27394..001313db676 100644
--- a/src/libterm/win.rs
+++ b/src/libterm/win.rs
@@ -126,7 +126,7 @@ impl<T: Write+Send+'static> WinConsole<T> {
         }
         Some(box WinConsole { buf: out,
                               def_foreground: fg, def_background: bg,
-                              foreground: fg, background: bg } as Box<Terminal<T>+Send>)
+                              foreground: fg, background: bg })
     }
 }