Git Product home page Git Product logo

Comments (4)

Ddystopia avatar Ddystopia commented on July 21, 2024

Here is even smaller example:

#![feature(type_alias_impl_trait)]

fn foo<T2>(bar: T2) {
    type T = impl Sized;
    let x: T = || {};
}

fn main() {}

from rust.

oli-obk avatar oli-obk commented on July 21, 2024

Yes, all of these don't work anymore. You need to move the TAIT out of the function for now

from rust.

veera-sivarajan avatar veera-sivarajan commented on July 21, 2024

@rustbot label -needs-triage +F-type_alias_impl_trait +T-compiler

from rust.

traviscross avatar traviscross commented on July 21, 2024

Probably adding the generic parameter is what is wanted:

#![feature(type_alias_impl_trait)]

fn foo<U>() {
    type T<V> = impl Sized;
    let x: T<U> = || (); //~ OK
}

fn main() {}

This is a duplicate of:

E.g.:

#![feature(type_alias_impl_trait)]

type Ty = impl Sized;

fn test<'v, T, const U: usize>() -> Ty {
    || ()
    //~^ ERROR type parameter `T` is part of concrete type but not
    //~|       used in parameter list for the `impl Trait` type alias
    //~^ ERROR const parameter `U` is part of concrete type but not
    //~|       used in parameter list for the `impl Trait` type alias
}

fn main() {}

So let's close in favor of that issue.

from rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.