Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/93340.rs: fixed with errors #1103

Merged
merged 1 commit into from
Jan 31, 2022
Merged

ices/93340.rs: fixed with errors #1103

merged 1 commit into from
Jan 31, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#93340

#![feature(generic_associated_types)]

pub trait Scalar: 'static {
    type RefType<'a>: ScalarRef<'a>;
}

pub trait ScalarRef<'a>: 'a {}

impl Scalar for i32 {
    type RefType<'a> = i32;
}

impl Scalar for String {
    type RefType<'a> = &'a str;
}

impl<'a> ScalarRef<'a> for i32 {}

impl<'a> ScalarRef<'a> for &'a str {}

fn cmp_eq<'a, 'b, A: Scalar, B: Scalar>(a: A::RefType<'a>, b: B::RefType<'b>) -> bool {
    todo!()
}

fn str_contains(a: &str, b: &str) -> bool {
    a.contains(b)
}

fn build_expression<A: Scalar, B: Scalar, O: Scalar>(
) -> impl Fn(A::RefType<'_>, B::RefType<'_>) -> O {
    cmp_eq::<i32, i32>
}

fn main() {
    println!("Hello, world!");
}
=== stdout ===
=== stderr ===
error[E0631]: type mismatch in function arguments
  --> /home/runner/work/glacier/glacier/ices/93340.rs:30:6
   |
21 | fn cmp_eq<'a, 'b, A: Scalar, B: Scalar>(a: A::RefType<'a>, b: B::RefType<'b>) -> bool {
   | ------------------------------------------------------------------------------------- found signature of `fn(i32, i32) -> _`
...
30 | ) -> impl Fn(A::RefType<'_>, B::RefType<'_>) -> O {
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected signature of `for<'r, 's> fn(<A as Scalar>::RefType<'r>, <B as Scalar>::RefType<'s>) -> _`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0631`.
==============

=== stdout ===
=== stderr ===
error[E0631]: type mismatch in function arguments
  --> /home/runner/work/glacier/glacier/ices/93340.rs:30:6
   |
21 | fn cmp_eq<'a, 'b, A: Scalar, B: Scalar>(a: A::RefType<'a>, b: B::RefType<'b>) -> bool {
   | ------------------------------------------------------------------------------------- found signature of `fn(i32, i32) -> _`
...
30 | ) -> impl Fn(A::RefType<'_>, B::RefType<'_>) -> O {
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected signature of `for<'r, 's> fn(<A as Scalar>::RefType<'r>, <B as Scalar>::RefType<'s>) -> _`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0631`.
==============
@Alexendoo Alexendoo merged commit 9e606ee into master Jan 31, 2022
@Alexendoo Alexendoo deleted the autofix/ices/93340.rs branch January 31, 2022 13:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants