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(),
}
};
+ #[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 {
}
Some(box WinConsole { buf: out,
def_foreground: fg, def_background: bg,
- foreground: fg, background: bg } as Box<Terminal<T>+Send>)
+ foreground: fg, background: bg })
}
}