Skip to content

Commit 7e3ee02

Browse files
committed
Bug fixes
1 parent e7122a5 commit 7e3ee02

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

src/librustc_typeck/check/coercion.rs

-23
Original file line numberDiff line numberDiff line change
@@ -381,29 +381,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
381381
None
382382
}
383383
}
384-
(&ty::ty_trait(ref data_a), &ty::ty_trait(ref data_b)) => {
385-
// For now, we only support upcasts from
386-
// `Foo+Send` to `Foo` (really, any time there are
387-
// fewer builtin bounds then before). These are
388-
// convenient because they don't require any sort
389-
// of change to the vtable at runtime.
390-
if data_a.bounds.builtin_bounds != data_b.bounds.builtin_bounds &&
391-
data_a.bounds.builtin_bounds.is_superset(&data_b.bounds.builtin_bounds)
392-
{
393-
let bounds_a1 = ty::ExistentialBounds {
394-
region_bound: data_a.bounds.region_bound,
395-
builtin_bounds: data_b.bounds.builtin_bounds,
396-
projection_bounds: data_a.bounds.projection_bounds.clone(),
397-
};
398-
let ty_a1 = ty::mk_trait(tcx, data_a.principal.clone(), bounds_a1);
399-
match self.fcx.infcx().try(|_| self.subtype(ty_a1, ty_b)) {
400-
Ok(_) => Some((ty_b, ty::UnsizeUpcast(ty_b))),
401-
Err(_) => None,
402-
}
403-
} else {
404-
None
405-
}
406-
}
407384
(_, &ty::ty_trait(ref data)) => {
408385
Some((ty_b, ty::UnsizeVtable(ty::TyTrait {
409386
principal: data.principal.clone(),

src/libstd/sys/windows/os.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl Iterator for Env {
109109
if *self.cur == 0 { return None }
110110
let p = &*self.cur;
111111
let mut len = 0;
112-
while *(p as *const _).offset(len) != 0 {
112+
while *(p as *const u16).offset(len) != 0 {
113113
len += 1;
114114
}
115115
let p = p as *const u16;

src/libstd/thread/local.rs

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ macro_rules! __thread_local_inner {
176176
}
177177
};
178178

179+
#[allow(trivial_casts)]
179180
#[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
180181
const _INIT: ::std::thread::__local::__impl::KeyInner<$t> = {
181182
::std::thread::__local::__impl::KeyInner {

src/libterm/win.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<T: Write+Send+'static> WinConsole<T> {
126126
}
127127
Some(box WinConsole { buf: out,
128128
def_foreground: fg, def_background: bg,
129-
foreground: fg, background: bg } as Box<Terminal<T>+Send>)
129+
foreground: fg, background: bg })
130130
}
131131
}
132132

0 commit comments

Comments
 (0)