Skip to content

Condition types do not support non-static-lifetime borrowed pointers #5370

Closed
@brson

Description

@brson
pub struct ReaderError(&'self mut int);

condition! {
    reader_error: super::ReaderError -> bool;
}

fn main() {
}
<core-macros>:63:20: 63:48 error: cannot infer an appropriate lifetime due to conflicting requirements
<core-macros>:63                     ::core::condition::Condition {
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: first, the lifetime cannot outlive lifetime re_bound(br_anon(0))...
<core-macros>:63:20: 63:48 note: ...due to the following expression
<core-macros>:63                     ::core::condition::Condition {
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: but, the lifetime must be valid for the static lifetime...
<core-macros>:63:20: 63:48 note: ...due to the following expression
<core-macros>:63                     ::core::condition::Condition {
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions