Skip to content

Error in compilation #103181

Description

@belooping

Code

//------- External library (jv_lib/src/lib.rs
/*--------------------------------------------------------
# Purpose: shared library for jv_* micro services project
# version: 1.0
# created by DIRI on 11/10/2022.
# last modified by DIRI on 17/10/2022.
--------------------------------------------------------*/
use clap::Parser;
use serde::{Serialize, Deserialize};
use hyper::http;

#[derive(Serialize, Deserialize)]
pub struct JvObject {
    pub jv_id: String,
    pub jv_owner: String,
    pub jv_build: String,
    pub jv_value: String
}

#[derive(Serialize, Deserialize)]
pub struct JVs {
    pub contact: String,
    pub description: String,
    pub build: String,
    pub jvs_list: Vec<JvObject>
}

#[derive(Serialize, Deserialize)]
// see https://jsonapi.org for reference
pub struct ErrorObject {
    pub status: String, // HTML status code
    pub reason: String, // short description
    pub detail: String, // detailed description
//    pub source: String  // reference to the primary source of the error
}

#[derive(Serialize, Deserialize)]
pub struct ErrorMessage {
    pub contact: String,
    pub id: String, // timestamp
    pub errors: Vec<ErrorObject>
}

#[derive(Parser)]
#[command(author, version, about = "Microservice to read JVs file.")]
pub struct Args {
    #[arg(
        short,
        long,
        help = "Address to bind the server to.",
        default_value = "127.0.0.1"
    )]
    pub address: String,
    #[arg(short, long, help = "Listening port.", default_value = "9000")]
    pub port: u16,
}

pub type Request = http::Request<hyper::Body>;
pub type Response = http::Response<hyper::Body>;
//-------
//------- Main program jv_fget/src/lib.rs
/*--------------------------------------------------------
# Purpose: library for jv_fget
# version: 1.0
# created by DIRI on 05/10/2022.
# last modified by DIRI on 17/10/2022.
--------------------------------------------------------*/
// system crates
use chrono::prelude::*;
use backtrace::Backtrace;
use std::{
    net::SocketAddr,
    convert::Infallible,
    error::Error,
    io::Write,
    cell::RefCell,
    sync::Arc,
    panic::AssertUnwindSafe,
};
use hyper::http;
use flate2::{write::ZlibEncoder, Compression};
use futures::{future::FutureExt, Future};

// smals crates
use jv_lib;


// --- Functions ---
async fn get_jvs(jvs_file: &str) -> jv_lib::Response {
    let json_buffer = std::fs::read_to_string(jvs_file).unwrap();
    response_handler(&json_buffer, "application/json", http::StatusCode::OK).await
}

async fn request_handler(request: jv_lib::Request, jvs_file: &str) -> jv_lib::Response {
    match(request.method(), request.uri().path()) {
        // get the JVs list
        (&hyper::Method::GET, "/jvs") => get_jvs(&jvs_file).await,
        // all other request are not allowed
        _ => {
            // method OK but wrong uri
            if request.method().as_str() == "GET" {
                error_handler(http::StatusCode::NOT_FOUND).await
            // wrong method
            } else {
                error_handler(http::StatusCode::METHOD_NOT_ALLOWED).await
            }
        }
    }
}

async fn response_handler(body: &str, content_type: &str, status_code: http::StatusCode) -> jv_lib::Response {
    bytes_handler(body.as_bytes(), content_type, status_code).await
}

async fn error_handler(http_status: http::StatusCode) -> jv_lib::Response {
    let content_type = "application/json";
    // create error_message
    let err_msg = jv_lib::ErrorMessage {
        contact: String::from("l2000@smals.be"),
        id: format!("{}",Local::now().format("%Y%m%d.%H%M%S")),
        errors: vec![
            jv_lib::ErrorObject {
                status: String::from(http_status.as_str()),
                reason: match http_status {
                    http::StatusCode::NOT_FOUND => String::from("notFound"),
                    http::StatusCode::METHOD_NOT_ALLOWED => String::from("methodNotAllowed"),
                    _ => String::from("unknown")
                },
                detail: match http_status {
                    http::StatusCode::NOT_FOUND => String::from("API not found"),
                    http::StatusCode::METHOD_NOT_ALLOWED => String::from("Method is not allowed"),
                    _ => String::from("unknown")
                },
            }
        ]
    };
    let err_json = serde_json::to_vec(&err_msg).unwrap();
    bytes_handler(&err_json, &content_type, http_status).await
}

async fn bytes_handler(body: &[u8], content_type: &str, status_code: http::StatusCode) -> jv_lib::Response {
    let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default());
    encoder.write_all(body).unwrap();
    let compressed = encoder.finish().unwrap();
    hyper::Response::builder()
        .status(status_code)
        .header(hyper::header::CONTENT_TYPE, content_type)
        .header(hyper::header::CONTENT_ENCODING, "deflate")
        .body(hyper::Body::from(compressed))
        .unwrap()
}

async fn serve<H, F>( socket: SocketAddr, jvs_file: &str, r_handler: H) -> hyper::Result<()>
    where H: 'static + Fn(jv_lib::Request, &str) -> F + Send + Sync,
          F: Future<Output = jv_lib::Response> + Send,  
{
    // Create a task local that will store the panic message and backtrace if a panic occurs.
    tokio::task_local! {
        static PANIC_MESSAGE_AND_BACKTRACE: RefCell<Option<(String, Backtrace)>>;
    }
    async fn service<H, F>(
        r_handler: Arc<H>,
        mut request: jv_lib::Request,
    ) -> Result<jv_lib::Response, Infallible>
    where
        H: Fn(jv_lib::Request, &str) -> F + Send + Sync + 'static,
        F: Future<Output = jv_lib::Response> + Send,
    {
        let method = request.method().clone();
        let path = request.uri().path_and_query().unwrap().path().to_owned();
        tracing::info!(path = %path, method = %method, "request");
//        request.extensions_mut().insert(context);
        let result = AssertUnwindSafe(request_handler(request, &jvs_file)).catch_unwind().await;
        let start = std::time::SystemTime::now();
        let response = result.unwrap_or_else(|_| {
            let body = PANIC_MESSAGE_AND_BACKTRACE.with(|panic_message_and_backtrace| {
                let panic_message_and_backtrace = panic_message_and_backtrace.borrow();
                let (message, backtrace) = panic_message_and_backtrace.as_ref().unwrap();
                tracing::error!(
                    method = %method,
                    path = %path,
                    backtrace = ?backtrace,
                    "500"
                );
                format!("{}\n{:?}", message, backtrace)
            });
            http::Response::builder()
                .status(http::StatusCode::INTERNAL_SERVER_ERROR)
                .body(hyper::Body::from(body))
                .unwrap()
        });
        tracing::info!(
            "Response generated in {}μs",
            start.elapsed().unwrap_or_default().as_micros()
        );
        Ok(response)
    }
    // Install a panic hook that will record the panic message and backtrace if a panic occurs.
    let hook = std::panic::take_hook();
    std::panic::set_hook(Box::new(|panic_info| {
        let value = (panic_info.to_string(), Backtrace::new());
        PANIC_MESSAGE_AND_BACKTRACE.with(|panic_message_and_backtrace| {
            panic_message_and_backtrace.borrow_mut().replace(value);
        })
    }));
    // Wrap the request handler and context with Arc to allow sharing a reference to it with each task.
    let request_handler = Arc::new(request_handler);
    let service = hyper::service::make_service_fn(|_| {
        let request_handler = request_handler.clone();
        async move {
            Ok::<_, Infallible>(hyper::service::service_fn(move |request| {
                let request_handler = request_handler.clone();
                PANIC_MESSAGE_AND_BACKTRACE.scope(RefCell::new(None), async move {
                    service(request_handler, request).await
                })
            }))
        }
    });
    let server = hyper::server::Server::try_bind(&socket)?;
    tracing::info!("🚀 service listening at {}", socket);
    server.serve(service).await?;
    std::panic::set_hook(hook);
    Ok(())
}

// --- Main ---
#[tokio::main]
pub async fn run(params: jv_lib::Args) -> Result<(), Box<dyn Error>> {
    let jvs_file = "/opt/data/jvs.json";
    // prepare listener
    println!("- Preparing connection");
    let socket = SocketAddr::new(params.address.parse(), params.port);
    
    // start listening 
    serve(socket, &jvs_file, request_handler).await;
    Ok(())
}
//-------

Meta

rustc --version --verbose:

rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-unknown-linux-gnu
release: 1.64.0
LLVM version: 14.0.6

Error output

Same as below...
Backtrace

didou@1906L66C4BF:~/projects/rust/JVs/jv_fget$ RUST_BACKTRACE=1 cargo build
   Compiling jv_fget v0.1.0 (/home/didou/projects/rust/JVs/jv_fget)
error[E0434]: can't capture dynamic environment in a fn item
   --> jv_fget/src/lib.rs:112:65
    |
112 |         let result = AssertUnwindSafe(request_handler(request, &jvs_file)).catch_unwind().await;
    |                                                                 ^^^^^^^^
    |
    = help: use the `|| { ... }` closure form instead

error[E0308]: mismatched types
   --> jv_fget/src/lib.rs:153:21
    |
153 |                     service(request_handler, request).await
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
    = note: expected trait `for<'r> <for<'r> fn(Request<Body>, &'r str) -> impl for<'r> futures::Future<Output = Response<Body>> {request_handler} as FnOnce<(Request<Body>, &'r str)>>`
               found trait `for<'r> <for<'r> fn(Request<Body>, &'r str) -> impl for<'r> futures::Future<Output = Response<Body>> {request_handler} as FnOnce<(Request<Body>, &'r str)>>`
note: the lifetime requirement is introduced here
   --> jv_fget/src/lib.rs:105:41
    |
105 |         H: Fn(jv_lib::Request, &str) -> F + Send + Sync + 'static,
    |                                         ^

error: internal compiler error: compiler/rustc_trait_selection/src/traits/query/normalize.rs:257:21: unexpected ambiguity: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(ProjectionPredicate(ProjectionTy { substs: [F], item_def_id: DefId(2:13762 ~ core[6fcc]::future::future::Future::Output) }, Ty(hyper::Response<hyper::Body>)), []), Binder(TraitPredicate(<F as std::marker::Send>, polarity:Positive), []), Binder(TraitPredicate(<F as futures::Future>, polarity:Positive), []), Binder(ProjectionPredicate(ProjectionTy { substs: [H, (hyper::Request<hyper::Body>, &str)], item_def_id: DefId(2:3521 ~ core[6fcc]::ops::function::FnOnce::Output) }, Ty(F)), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<H as std::marker::Sync>, polarity:Positive), []), Binder(TraitPredicate(<H as std::marker::Send>, polarity:Positive), []), Binder(TraitPredicate(<H as std::ops::Fn<(hyper::Request<hyper::Body>, &str)>>, polarity:Positive), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<H as std::ops::FnMut<(hyper::Request<hyper::Body>, &str)>>, polarity:Positive), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<H as std::ops::FnOnce<(hyper::Request<hyper::Body>, &str)>>, polarity:Positive), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<F as std::marker::Sized>, polarity:Positive), []), Binder(TraitPredicate(<H as std::marker::Sized>, polarity:Positive), []), Binder(OutlivesPredicate(H, ReStatic), [])], reveal: UserFacing, constness: NotConst }, value: ProjectionTy { substs: [hyper::Server<hyper::server::conn::AddrIncoming, hyper::service::make::MakeServiceFn<[closure@jv_fget/src/lib.rs:147:51: 147:54]>>], item_def_id: DefId(2:13778 ~ core[6fcc]::future::into_future::IntoFuture::IntoFuture) } } } Canonical { max_universe: U40, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U39) }, CanonicalVarInfo { kind: Region(U39) }, CanonicalVarInfo { kind: Region(U16) }, CanonicalVarInfo { kind: Region(U39) }, CanonicalVarInfo { kind: Region(U39) }, CanonicalVarInfo { kind: Region(U39) }, CanonicalVarInfo { kind: Region(U40) }, CanonicalVarInfo { kind: Region(U40) }, CanonicalVarInfo { kind: Region(U1) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U1, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U2) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U2, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U3) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U3, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U4) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U4, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U5) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U5, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U6) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U6, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U7) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U7, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U8) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U8, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U9) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U9, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U10) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U10, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U11) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U11, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U12) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U12, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U13) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U13, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U14) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U14, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U15) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U15, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U16) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U16, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U17) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U17, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U18) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U18, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U19) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U19, name: BrNamed(DefId(35:1017 ~ hyper[5ea2]::service::make::{impl#2}::'a), 'a) }) }, CanonicalVarInfo { kind: Region(U20) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U20, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U20) }, CanonicalVarInfo { kind: Region(U21) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U21, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U22) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U22, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U22) }, CanonicalVarInfo { kind: Region(U23) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U23, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U23) }, CanonicalVarInfo { kind: Region(U24) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U24, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U24) }, CanonicalVarInfo { kind: Region(U25) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U25, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U25) }, CanonicalVarInfo { kind: Region(U26) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U26, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U26) }, CanonicalVarInfo { kind: Region(U27) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U27, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U27) }, CanonicalVarInfo { kind: Region(U28) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U28, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U28) }, CanonicalVarInfo { kind: Region(U29) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U29, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U29) }, CanonicalVarInfo { kind: Region(U30) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U30, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U30) }, CanonicalVarInfo { kind: Region(U31) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U31, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U31) }, CanonicalVarInfo { kind: Region(U32) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U32, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U32) }, CanonicalVarInfo { kind: Region(U33) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U33, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U33) }, CanonicalVarInfo { kind: Region(U34) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U34, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U34) }, CanonicalVarInfo { kind: Region(U35) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U35, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U35) }, CanonicalVarInfo { kind: Region(U36) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U36, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U36) }, CanonicalVarInfo { kind: Region(U37) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U37, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U37) }, CanonicalVarInfo { kind: Region(U38) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U38, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U38) }, CanonicalVarInfo { kind: Region(U39) }, CanonicalVarInfo { kind: PlaceholderRegion(Placeholder { universe: U39, name: BrNamed(DefId(35:10727 ~ hyper[5ea2]::service::make::{impl#4}::'_), '_) }) }, CanonicalVarInfo { kind: Region(U39) }], value: QueryResponse { var_values: CanonicalVarValues { var_values: [ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0) })] }, region_constraints: QueryRegionConstraints { outlives: [Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(1) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(1) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 2, kind: BrAnon(2) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 2, kind: BrAnon(2) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(1) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(1) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 2, kind: BrAnon(2) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 2, kind: BrAnon(2) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 3, kind: BrAnon(3) }), ReStatic), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 4, kind: BrAnon(4) }), ReStatic), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 5, kind: BrAnon(5) }), ReStatic), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 6, kind: BrAnon(6) }), ReStatic), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 7, kind: BrAnon(7) }), ReStatic), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 8, kind: BrAnon(8) }), ReStatic), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 9, kind: BrAnon(9) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 10, kind: BrAnon(10) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 11, kind: BrAnon(11) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 12, kind: BrAnon(12) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 13, kind: BrAnon(13) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 14, kind: BrAnon(14) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 15, kind: BrAnon(15) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 16, kind: BrAnon(16) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 17, kind: BrAnon(17) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 18, kind: BrAnon(18) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 19, kind: BrAnon(19) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 20, kind: BrAnon(20) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 21, kind: BrAnon(21) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 22, kind: BrAnon(22) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 23, kind: BrAnon(23) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 24, kind: BrAnon(24) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 25, kind: BrAnon(25) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 26, kind: BrAnon(26) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 27, kind: BrAnon(27) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 28, kind: BrAnon(28) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 29, kind: BrAnon(29) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 30, kind: BrAnon(30) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 31, kind: BrAnon(31) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 32, kind: BrAnon(32) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 33, kind: BrAnon(33) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 34, kind: BrAnon(34) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 35, kind: BrAnon(35) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 36, kind: BrAnon(36) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 37, kind: BrAnon(37) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 38, kind: BrAnon(38) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 39, kind: BrAnon(39) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 40, kind: BrAnon(40) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 41, kind: BrAnon(41) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 42, kind: BrAnon(42) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 43, kind: BrAnon(43) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 44, kind: BrAnon(44) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 45, kind: BrAnon(45) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 46, kind: BrAnon(46) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 47, kind: BrAnon(47) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 48, kind: BrAnon(48) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 49, kind: BrAnon(49) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 48, kind: BrAnon(48) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 50, kind: BrAnon(50) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 51, kind: BrAnon(51) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 52, kind: BrAnon(52) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 53, kind: BrAnon(53) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 54, kind: BrAnon(54) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 53, kind: BrAnon(53) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 55, kind: BrAnon(55) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 56, kind: BrAnon(56) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 57, kind: BrAnon(57) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 56, kind: BrAnon(56) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 58, kind: BrAnon(58) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 59, kind: BrAnon(59) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 60, kind: BrAnon(60) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 59, kind: BrAnon(59) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 61, kind: BrAnon(61) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 62, kind: BrAnon(62) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 63, kind: BrAnon(63) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 62, kind: BrAnon(62) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 64, kind: BrAnon(64) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 65, kind: BrAnon(65) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 66, kind: BrAnon(66) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 65, kind: BrAnon(65) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 67, kind: BrAnon(67) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 68, kind: BrAnon(68) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 69, kind: BrAnon(69) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 68, kind: BrAnon(68) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 70, kind: BrAnon(70) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 71, kind: BrAnon(71) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 72, kind: BrAnon(72) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 71, kind: BrAnon(71) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 73, kind: BrAnon(73) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 74, kind: BrAnon(74) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 75, kind: BrAnon(75) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 74, kind: BrAnon(74) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 76, kind: BrAnon(76) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 77, kind: BrAnon(77) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 78, kind: BrAnon(78) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 77, kind: BrAnon(77) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 79, kind: BrAnon(79) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 80, kind: BrAnon(80) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 81, kind: BrAnon(81) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 80, kind: BrAnon(80) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 82, kind: BrAnon(82) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 83, kind: BrAnon(83) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 84, kind: BrAnon(84) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 83, kind: BrAnon(83) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 85, kind: BrAnon(85) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 86, kind: BrAnon(86) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 87, kind: BrAnon(87) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 86, kind: BrAnon(86) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 88, kind: BrAnon(88) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 89, kind: BrAnon(89) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 90, kind: BrAnon(90) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 89, kind: BrAnon(89) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 91, kind: BrAnon(91) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 92, kind: BrAnon(92) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 93, kind: BrAnon(93) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 92, kind: BrAnon(92) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 94, kind: BrAnon(94) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 95, kind: BrAnon(95) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 96, kind: BrAnon(96) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 95, kind: BrAnon(95) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 97, kind: BrAnon(97) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 98, kind: BrAnon(98) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 99, kind: BrAnon(99) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 98, kind: BrAnon(98) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 100, kind: BrAnon(100) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 101, kind: BrAnon(101) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 102, kind: BrAnon(102) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 101, kind: BrAnon(101) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 103, kind: BrAnon(103) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 104, kind: BrAnon(104) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 105, kind: BrAnon(105) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 104, kind: BrAnon(104) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 10, kind: BrAnon(10) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 9, kind: BrAnon(9) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 12, kind: BrAnon(12) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 11, kind: BrAnon(11) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 14, kind: BrAnon(14) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 13, kind: BrAnon(13) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 16, kind: BrAnon(16) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 15, kind: BrAnon(15) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 18, kind: BrAnon(18) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 17, kind: BrAnon(17) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 20, kind: BrAnon(20) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 19, kind: BrAnon(19) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 22, kind: BrAnon(22) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 21, kind: BrAnon(21) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 24, kind: BrAnon(24) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 23, kind: BrAnon(23) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 26, kind: BrAnon(26) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 25, kind: BrAnon(25) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 28, kind: BrAnon(28) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 27, kind: BrAnon(27) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 30, kind: BrAnon(30) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 29, kind: BrAnon(29) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 32, kind: BrAnon(32) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 31, kind: BrAnon(31) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 34, kind: BrAnon(34) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 33, kind: BrAnon(33) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 36, kind: BrAnon(36) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 35, kind: BrAnon(35) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 38, kind: BrAnon(38) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 37, kind: BrAnon(37) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 40, kind: BrAnon(40) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 39, kind: BrAnon(39) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 42, kind: BrAnon(42) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 41, kind: BrAnon(41) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 44, kind: BrAnon(44) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 43, kind: BrAnon(43) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 46, kind: BrAnon(46) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 45, kind: BrAnon(45) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 48, kind: BrAnon(48) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 47, kind: BrAnon(47) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 48, kind: BrAnon(48) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 49, kind: BrAnon(49) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 51, kind: BrAnon(51) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 50, kind: BrAnon(50) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 53, kind: BrAnon(53) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 52, kind: BrAnon(52) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 53, kind: BrAnon(53) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 54, kind: BrAnon(54) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 56, kind: BrAnon(56) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 55, kind: BrAnon(55) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 56, kind: BrAnon(56) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 57, kind: BrAnon(57) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 59, kind: BrAnon(59) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 58, kind: BrAnon(58) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 59, kind: BrAnon(59) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 60, kind: BrAnon(60) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 62, kind: BrAnon(62) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 61, kind: BrAnon(61) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 62, kind: BrAnon(62) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 63, kind: BrAnon(63) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 65, kind: BrAnon(65) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 64, kind: BrAnon(64) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 65, kind: BrAnon(65) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 66, kind: BrAnon(66) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 68, kind: BrAnon(68) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 67, kind: BrAnon(67) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 68, kind: BrAnon(68) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 69, kind: BrAnon(69) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 71, kind: BrAnon(71) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 70, kind: BrAnon(70) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 71, kind: BrAnon(71) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 72, kind: BrAnon(72) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 74, kind: BrAnon(74) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 73, kind: BrAnon(73) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 74, kind: BrAnon(74) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 75, kind: BrAnon(75) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 77, kind: BrAnon(77) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 76, kind: BrAnon(76) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 77, kind: BrAnon(77) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 78, kind: BrAnon(78) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 80, kind: BrAnon(80) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 79, kind: BrAnon(79) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 80, kind: BrAnon(80) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 81, kind: BrAnon(81) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 83, kind: BrAnon(83) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 82, kind: BrAnon(82) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 83, kind: BrAnon(83) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 84, kind: BrAnon(84) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 86, kind: BrAnon(86) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 85, kind: BrAnon(85) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 86, kind: BrAnon(86) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 87, kind: BrAnon(87) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 89, kind: BrAnon(89) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 88, kind: BrAnon(88) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 89, kind: BrAnon(89) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 90, kind: BrAnon(90) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 92, kind: BrAnon(92) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 91, kind: BrAnon(91) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 92, kind: BrAnon(92) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 93, kind: BrAnon(93) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 95, kind: BrAnon(95) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 94, kind: BrAnon(94) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 95, kind: BrAnon(95) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 96, kind: BrAnon(96) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 98, kind: BrAnon(98) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 97, kind: BrAnon(97) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 98, kind: BrAnon(98) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 99, kind: BrAnon(99) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 101, kind: BrAnon(101) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 100, kind: BrAnon(100) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 101, kind: BrAnon(101) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 102, kind: BrAnon(102) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 104, kind: BrAnon(104) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 103, kind: BrAnon(103) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 104, kind: BrAnon(104) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 105, kind: BrAnon(105) })), []), Binder(OutlivesPredicate(hyper::server::conn::AddrStream, ReStatic), []), Binder(OutlivesPredicate(hyper::Body, ReStatic), []), Binder(OutlivesPredicate(hyper::proto::h2::server::H2Stream<tokio::task::futures::TaskLocalFuture<std::cell::RefCell<std::option::Option<(std::string::String, backtrace::Backtrace)>>, impl futures::Future<Output = std::result::Result<hyper::Response<hyper::Body>, std::convert::Infallible>>>, hyper::Body>, ReStatic), []), Binder(OutlivesPredicate(hyper::server::server::new_svc::NewSvcTask<hyper::server::conn::AddrStream, impl futures::Future<Output = std::result::Result<hyper::service::util::ServiceFn<[closure@jv_fget/src/lib.rs:150:60: 150:74], hyper::Body>, std::convert::Infallible>>, hyper::service::util::ServiceFn<[closure@jv_fget/src/lib.rs:150:60: 150:74], hyper::Body>, hyper::common::exec::Exec, hyper::server::server::NoopWatcher>, ReStatic), []), Binder(OutlivesPredicate(std::io::Error, ReLateBound(DebruijnIndex(1), BoundRegion { var: 3, kind: BrAnon(3) })), []), Binder(OutlivesPredicate(hyper::body::Bytes, ReStatic), []), Binder(OutlivesPredicate(hyper::body::Bytes, ReStatic), []), Binder(OutlivesPredicate(hyper::server::conn::AddrStream, ReStatic), []), Binder(OutlivesPredicate(hyper::Body, ReStatic), []), Binder(OutlivesPredicate(hyper::Body, ReStatic), []), Binder(OutlivesPredicate(hyper::Body, ReStatic), []), Binder(OutlivesPredicate(std::convert::Infallible, ReLateBound(DebruijnIndex(1), BoundRegion { var: 4, kind: BrAnon(4) })), []), Binder(OutlivesPredicate(std::cell::RefCell<std::option::Option<(std::string::String, backtrace::Backtrace)>>, ReStatic), []), Binder(OutlivesPredicate(hyper::proto::h2::server::H2Stream<tokio::task::futures::TaskLocalFuture<std::cell::RefCell<std::option::Option<(std::string::String, backtrace::Backtrace)>>, impl futures::Future<Output = std::result::Result<hyper::Response<hyper::Body>, std::convert::Infallible>>>, hyper::Body>, ReStatic), []), Binder(OutlivesPredicate(hyper::proto::h2::server::H2Stream<tokio::task::futures::TaskLocalFuture<std::cell::RefCell<std::option::Option<(std::string::String, backtrace::Backtrace)>>, impl futures::Future<Output = std::result::Result<hyper::Response<hyper::Body>, std::convert::Infallible>>>, hyper::Body>, ReStatic), []), Binder(OutlivesPredicate(hyper::proto::h2::server::H2Stream<tokio::task::futures::TaskLocalFuture<std::cell::RefCell<std::option::Option<(std::string::String, backtrace::Backtrace)>>, impl futures::Future<Output = std::result::Result<hyper::Response<hyper::Body>, std::convert::Infallible>>>, hyper::Body>, ReStatic), []), Binder(OutlivesPredicate((), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(1) })), []), Binder(OutlivesPredicate(hyper::body::Bytes, ReStatic), []), Binder(OutlivesPredicate(hyper::Error, ReLateBound(DebruijnIndex(1), BoundRegion { var: 5, kind: BrAnon(5) })), []), Binder(OutlivesPredicate((), ReLateBound(DebruijnIndex(1), BoundRegion { var: 2, kind: BrAnon(2) })), [])], member_constraints: [] }, certainty: Ambiguous, opaque_types: [], value: NormalizationResult { normalized_ty: hyper::Server<hyper::server::conn::AddrIncoming, hyper::service::make::MakeServiceFn<[closure@jv_fget/src/lib.rs:147:51: 147:54]>> } } }

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/compiler/rustc_errors/src/lib.rs:1392:9
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::bug::<&alloc::string::String>
   3: <rustc_errors::Handler>::bug::<&alloc::string::String>
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, ()>
   5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_middle::ty::fold::FallibleTypeFolder>::try_fold_ty
   8: <&rustc_middle::ty::list::List<rustc_middle::ty::Ty> as rustc_middle::ty::fold::TypeFoldable>::try_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
   9: <rustc_infer::infer::at::At as rustc_trait_selection::traits::query::normalize::AtExt>::normalize::<rustc_middle::ty::sty::FnSig>
  10: rustc_traits::type_op::type_op_normalize::<rustc_middle::ty::sty::FnSig>
  11: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::Normalize<rustc_middle::ty::sty::FnSig>>, rustc_middle::ty::sty::FnSig, rustc_traits::type_op::type_op_normalize<rustc_middle::ty::sty::FnSig>>
  12: rustc_traits::type_op::type_op_normalize_fn_sig
  13: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_middle::infer::canonical::Canonical<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::Normalize<rustc_middle::ty::sty::FnSig>>>, core::result::Result<&rustc_middle::infer::canonical::Canonical<rustc_middle::infer::canonical::QueryResponse<rustc_middle::ty::sty::FnSig>>, rustc_middle::traits::query::NoSolution>>
  14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::infer::canonical::Canonical<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::Normalize<rustc_middle::ty::sty::FnSig>>>, core::result::Result<&rustc_middle::infer::canonical::Canonical<rustc_middle::infer::canonical::QueryResponse<rustc_middle::ty::sty::FnSig>>, rustc_middle::traits::query::NoSolution>>>
  15: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::type_op_normalize_fn_sig, rustc_query_impl::plumbing::QueryCtxt>
  16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_op_normalize_fn_sig
  17: <rustc_middle::ty::sty::FnSig as rustc_trait_selection::traits::query::type_op::normalize::Normalizable>::type_op_method
  18: <rustc_borrowck::type_check::TypeChecker>::typeck_mir
  19: rustc_borrowck::type_check::type_check
  20: rustc_borrowck::nll::compute_regions
  21: rustc_borrowck::do_mir_borrowck
  22: rustc_borrowck::mir_borrowck
  23: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
  24: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>
  25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>>
  26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  27: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  28: <rustc_borrowck::type_check::TypeChecker>::typeck_mir
  29: rustc_borrowck::type_check::type_check
  30: rustc_borrowck::nll::compute_regions
  31: rustc_borrowck::do_mir_borrowck
  32: rustc_borrowck::mir_borrowck
  33: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
  34: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>
  35: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>>
  36: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  37: rustc_typeck::collect::type_of::type_of
  38: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, rustc_middle::ty::Ty>
  39: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::type_of, rustc_query_impl::plumbing::QueryCtxt>
  40: rustc_typeck::check::check::check_mod_item_types
  41: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, ()>
  42: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, ()>>
  43: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::check_mod_item_types, rustc_query_impl::plumbing::QueryCtxt>
  44: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#6}>
  45: rustc_typeck::check_crate
  46: rustc_interface::passes::analysis
  47: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  48: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  49: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  50: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  51: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  52: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  53: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.64.0 (a55dd71d5 2022-09-19) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [type_op_normalize_fn_sig] normalizing `Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(ProjectionPredicate(ProjectionTy { substs: [F], item_def_id: DefId(2:13762 ~ core[6fcc]::future::future::Future::Output) }, Ty(http::response::Response<hyper::body::body::Body>)), []), Binder(TraitPredicate(<F as core::marker::Send>, polarity:Positive), []), Binder(TraitPredicate(<F as core::future::future::Future>, polarity:Positive), []), Binder(ProjectionPredicate(ProjectionTy { substs: [H, (http::request::Request<hyper::body::body::Body>, &str)], item_def_id: DefId(2:3521 ~ core[6fcc]::ops::function::FnOnce::Output) }, Ty(F)), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<H as core::marker::Sync>, polarity:Positive), []), Binder(TraitPredicate(<H as core::marker::Send>, polarity:Positive), []), Binder(TraitPredicate(<H as core::ops::function::Fn<(http::request::Request<hyper::body::body::Body>, &str)>>, polarity:Positive), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<H as core::ops::function::FnMut<(http::request::Request<hyper::body::body::Body>, &str)>>, polarity:Positive), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<H as core::ops::function::FnOnce<(http::request::Request<hyper::body::body::Body>, &str)>>, polarity:Positive), [Region(BrNamed(DefId(0:168 ~ jv_fget[6a58]::serve::'_#1), '_))]), Binder(TraitPredicate(<F as core::marker::Sized>, polarity:Positive), []), Binder(TraitPredicate(<H as core::marker::Sized>, polarity:Positive), []), Binder(OutlivesPredicate(H, ReStatic), [])], reveal: UserFacing, constness: NotConst }, value: Normalize { value: ([hyper::server::server::Server<hyper::server::tcp::AddrIncoming, hyper::service::make::MakeServiceFn<[closure@jv_fget/src/lib.rs:147:51: 147:54]>>]; c_variadic: false)-><hyper::server::server::Server<hyper::server::tcp::AddrIncoming, hyper::service::make::MakeServiceFn<[closure@jv_fget/src/lib.rs:147:51: 147:54]>> as core::future::into_future::IntoFuture>::IntoFuture } } }`
#1 [mir_borrowck] borrow-checking `serve::{closure#0}`
#2 [mir_borrowck] borrow-checking `serve`
#3 [type_of] computing type of `serve::{opaque#0}`
#4 [check_mod_item_types] checking item types in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack
Some errors have detailed explanations: E0308, E0434.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `jv_fget` due to 2 previous errors
didou@1906L66C4BF:~/projects/rust/JVs/jv_fget$ 

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Oct 18, 2022
  2. belooping commented on Oct 18, 2022

    @belooping
    Author

    I'm Rust newbie and I try to make a microservice.
    The offending line was at first the following:
    function serve
    '''
    let result = AssertUnwindSafe(request_handler(request)).catch_unwind().await;
    '''
    When I did "cargo check", I had an error and when I tried to correct it with the recommended option, I received.the panic message.
    '''
    let result = AssertUnwindSafe(request_handler(request, &jvs_file)).catch_unwind().await;
    '''
    I will investigate further to simplify the code, and sends this as requested in the error message.
    Regards
    Didier

  3. Noratrieb commented on Oct 18, 2022

    @Noratrieb
    Member

    Hi, thank you for your report. Can you verify that this issue still occurs on the latest nightly version?

    rustup toolchain install nightly
    cargo +nightly build
    
  4. belooping commented on Oct 18, 2022

    @belooping
    Author

    Hi Nilstrieb, yes, same behavior with the nightly build.

  5. jruderman commented on Oct 18, 2022

    @jruderman
    Contributor
    error: internal compiler error: compiler/rustc_trait_selection/src/traits/query/normalize.rs:257:21: unexpected ambiguity: ...
    

    This check was promoted to 'internal compiler error' in commit 7808f69 as part of pull request #99015 (@lcnr)

  6. Noratrieb commented on Oct 18, 2022

    @Noratrieb
    Member

    Looks like this is the same issue as #102588, which unfortunately also doesn't contain useful info.

  7. belooping commented on Oct 18, 2022

    @belooping
    Author
  8. compiler-errors commented on Oct 18, 2022

    @compiler-errors
    Contributor

    I can look into this. I was investigating the same assertion in #102858.

    @rustbot claim

  9. compiler-errors commented on Oct 18, 2022

    @compiler-errors
    Contributor

    Minimized quite a lot:

    use hyper::http;
    
    use std::{convert::Infallible, future::Future, net::SocketAddr, sync::Arc};
    
    async fn request_handler(jvs_file: &str) -> http::Response<hyper::Body> {
        todo!()
    }
    
    async fn service<H, F>(r_handler: Arc<H>) -> Result<http::Response<hyper::Body>, Infallible>
    where
        H: Fn(&str) -> F + Send,
        F: Future<Output = http::Response<hyper::Body>> + Send,
    {
        r_handler(s).await;
        todo!()
    }
    
    async fn serve<H, F>(socket: SocketAddr) -> hyper::Result<()>
    where
        H: Fn(&str) -> F + Send,
        F: Future<Output = http::Response<hyper::Body>> + Send,
    {
        let request_handler = Arc::new(request_handler);
        let service = hyper::service::make_service_fn(|_| {
            let request_handler = request_handler.clone();
            async move {
                Ok::<_, Infallible>(hyper::service::service_fn(move |_| {
                    let request_handler = request_handler.clone();
                    service(request_handler)
                }))
            }
        });
    
        let server = hyper::server::Server::try_bind(&socket)?;
        server.serve(service).await?;
    
        Ok(())
    }
    
    fn main() {}
  10. belooping commented on Oct 19, 2022

    @belooping
    Author
  11. compiler-errors commented on Oct 20, 2022

    @compiler-errors
    Contributor

    This regressed in 7808f69 -- I can't really work on it any further without a self-contained, minimized version of the ICE, which I attempted and failed to do. If someone wants to minimize it, then that would be greatly appreciated, and I can pick it up after that if nobody else has.

    @rustbot ping icebreakers-cleanup-crew
    @rustbot release-assignment

  12. 3 remaining items

  13. aliemjay commented on Oct 20, 2022

    @aliemjay
    Contributor

    How could an ambiguity error be raised when the canonical request has no inference variables? This looks interesting.

  14. compiler-errors commented on Oct 20, 2022

    @compiler-errors
    Contributor

    It's related to the variable name resolution error being emitted earlier, so maybe the inference context being tainted by errors causes something about evaluation to get messed up.

  15. hellow554 commented on Oct 20, 2022

    @hellow554
    Contributor

    Here's a cve without any external dependencies. Not quiet small, but it does the job.

    mod hyper {
        use std::{fmt::Debug, future::Future, marker::PhantomData, pin::Pin, task::Poll};
    
        pub trait HttpBody {
            type Error;
        }
        impl HttpBody for () {
            // don't implement `Error` here for the ICE
        }
    
        pub struct Server<I, S>(I, S);
    
        pub fn serve<I, S>(_: S) -> Server<I, S> {
            todo!()
        }
    
        impl<S, B> Future for Server<(), S>
        where
            S: MakeServiceRef<(), (), ResBody = B>,
            B: HttpBody,
            B::Error: Debug,
        {
            type Output = ();
    
            fn poll(self: Pin<&mut Self>, _: &mut std::task::Context<'_>) -> Poll<Self::Output> {
                todo!()
            }
        }
    
        pub trait MakeServiceRef<Target, ReqBody> {
            type ResBody;
        }
    
        impl<T, S> MakeServiceRef<(), ()> for T
        where
            T: for<'a> Service<&'a (), Response = S>,
            S: Service<()>,
        {
            type ResBody = ();
        }
    
        pub struct MakeServiceFn<F>(pub F);
        pub struct ServiceFn<F, R>(pub PhantomData<(F, R)>);
    
        pub trait Service<Request> {
            type Response;
        }
    
        impl<'t, F, Ret, Target, Svc> Service<&'t Target> for MakeServiceFn<F>
        where
            F: Fn() -> Ret,
            Ret: Future<Output = Result<Svc, ()>>,
        {
            type Response = Svc;
        }
    
        impl<F, ReqBody, Ret, ResBody, E> Service<ReqBody> for ServiceFn<F, ReqBody>
        where
            F: Fn() -> Ret,
            Ret: Future<Output = Result<ResBody, E>>,
        {
            type Response = ResBody;
        }
    }
    
    async fn smarvice() -> Result<(), ()> {
        Ok(())
    }
    
    fn service_fn<F, R, S>(f: F) -> hyper::ServiceFn<F, R>
    where
        F: Fn() -> S,
    {
        hyper::ServiceFn(std::marker::PhantomData)
    }
    
    async fn iceice() {
        let service = hyper::MakeServiceFn(|| async { Ok::<_, ()>(service_fn(|| smarvice())) });
        hyper::serve::<(), _>(service).await;
    }
    
    fn main() {}
  16. aliemjay commented on Oct 20, 2022

    @aliemjay
    Contributor

    Minimized: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=094c295011fa93fe6abefbbe1674496b

    trait SendFuture: Send {
        type Output;
    }
    
    impl<Fut: Send> SendFuture for Fut {
        type Output = ();
    }
    
    async fn broken_fut() {
        ident_error;
    }
    
    // triggers normalization of `<Fut as SendFuture>::Output`,
    // which requires `Fut: Send`.
    fn normalize<Fut: SendFuture>(_: Fut, _: Fut::Output) {}
    
    async fn iceice<A, B>() // <- async fn is necessary
    where
        A: Send,
        B: Send, // <- a second bound
    {
        normalize(broken_fut(), ());
    }

    @rustbot label S-bug-has-mcve

  17. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    on Oct 20, 2022
  18. hellow554 commented on Oct 20, 2022

    @hellow554
    Contributor

    @aliemjay interesting enough you seem to trigger the ICE in a different way than me?
    You're using the ident_error token, I use an incomplete trait impl.

    Maybe it's worth to test a possible solution to both inputs?

  19. compiler-errors commented on Oct 20, 2022

    @compiler-errors
    Contributor

    I'm pretty sure I understand this error now.

    Either via @aliemjay's solution of having a async fn with an error in its body, or via @hellow554's solution of having a missing associated type , we end up trying to check a trait bound on a [type error] (error) type in order to normalize a type inside a closure signature, which ends up evaluating as ambiguous.

    However, we don't handle ambiguities properly with the normalization query call. I took a stab at fixing this in #102858, and I extended it a bit to also fix these cases, too.

  20. added 2 commits that reference this issue on Oct 22, 2022
    afab9f1
    0ab4934
  21. added a commit that references this issue on Oct 23, 2022
    72f75d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions