Bug fixes
This commit is contained in:
parent
e7122a5a09
commit
7e3ee02006
@ -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(),
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user