mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
be conservative in has_significant_drop
This commit is contained in:
parent
40ee019c17
commit
75c172246c
@ -816,6 +816,15 @@ impl<'tcx> ty::TyS<'tcx> {
|
||||
[component_ty] => component_ty,
|
||||
_ => self,
|
||||
};
|
||||
|
||||
// FIXME: We should be canonicalizing, or else moving this to a method of inference
|
||||
// context, or *something* like that, but for now just avoid passing inference
|
||||
// variables to queries that can't cope with them. Instead, conservatively
|
||||
// return "true" (may change drop order).
|
||||
if query_ty.needs_infer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// This doesn't depend on regions, so try to minimize distinct
|
||||
// query keys used.
|
||||
let erased = tcx.normalize_erasing_regions(param_env, query_ty);
|
||||
|
@ -0,0 +1,34 @@
|
||||
// edition:2018
|
||||
// check-pass
|
||||
|
||||
#![warn(rust_2021_compatibility)]
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
struct Runtime;
|
||||
|
||||
impl Runtime {
|
||||
pub fn block_on<F: Future>(&self, _future: F) -> F::Output {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn http<F, Fut>(_func: F)
|
||||
where
|
||||
F: Fn() -> Fut,
|
||||
Fut: Future<Output = ()>,
|
||||
{
|
||||
let rt = Runtime {};
|
||||
let srv = rt.block_on(async move { serve(move || async move { unimplemented!() }) });
|
||||
let _ = || rt.block_on(async { srv });
|
||||
}
|
||||
|
||||
pub struct Server<S> {
|
||||
_marker: std::marker::PhantomData<S>,
|
||||
}
|
||||
|
||||
pub fn serve<S>(_new_service: S) -> Server<S> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn main() { }
|
Loading…
Reference in New Issue
Block a user