Ah indeed.  In fact the current syntax is:

    pub fn init<T: Copy+Send>(...)



Steven Blenkinsop wrote:
You shouldn't have a comma between Copy and Send. It thinks Send is a type parameter, and it can't infer a type argument since Send doesn't appear in the signature.

On Wed, Feb 13, 2013 at 9:33 PM, <[email protected] <mailto:[email protected]>> wrote:

    Sorry if it wasn't clear, but the body of glut::init is included
    in the pastebin snippet I posted. Line 15: pub fn init<T: Copy,
    Send>(…)

    I tried adding the GLUT<int> annotation to the function, and got
    the same error:

    main.rs:10:4: 10:14 error: cannot determine a type for this
    expression: unconstrained type
    main.rs:10 <http://main.rs:10>     glut::init(move initial,
    |glut_s: GLUT<int>| {
    Niko Matsakis wrote:

    That is somewhat surprising to me. In some cases you do need type
    annotations but I wouldn't expect one to be required on that line.
    Can you give a larger snippet, including perhaps the body of the
    function you are calling?

    Also, you can try an explicit annotation:

            glut::init(~1, |glut_s: GLUT<int>|) { ... }

    Niko

    [email protected] <mailto:[email protected]> wrote:

        I'm trying to create a function which initializes a generic
        structure with a generic value. However, rustc is giving me
        the error that is the subject. I have no idea why this is
        happening. Anyone have any tips?

        Code here: http://pastebin.com/6LiciGeX

        _______________________________________________

        Rust-dev mailing list

        [email protected] <mailto:[email protected]>

        https://mail.mozilla.org/listinfo/rust-dev


    _______________________________________________
    Rust-dev mailing list
    [email protected] <mailto:[email protected]>
    https://mail.mozilla.org/listinfo/rust-dev


_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to