Skip to content

Lifetime inference related regression in latest nightly. #30519

Closed
@mitchmindtree

Description

@mitchmindtree

Travis failed to build one of conrod's examples using the latest nightly due to the following error.

examples/all_widgets.rs:330:24: 330:54 error: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements [E0495]
examples/all_widgets.rs:330             let elem = &mut app.bool_matrix[col][row];
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples/all_widgets.rs:313:5: 314:20 note: first, the lifetime cannot outlive the method call at 313:4...
examples/all_widgets.rs:313     WidgetMatrix::new(cols, rows)
examples/all_widgets.rs:314         .down(20.0)
examples/all_widgets.rs:313:5: 313:34 note: ...so that method receiver is valid for the method call
examples/all_widgets.rs:313     WidgetMatrix::new(cols, rows)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples/all_widgets.rs:330:24: 330:54 note: but, the lifetime must be valid for the expression at 330:23...
examples/all_widgets.rs:330             let elem = &mut app.bool_matrix[col][row];
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples/all_widgets.rs:330:24: 330:54 note: ...so that reference is valid at the time of borrow
examples/all_widgets.rs:330             let elem = &mut app.bool_matrix[col][row];
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The area of the example code that fails is here.

It was able to build this same example without any problems using the rustc 1.5 stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions