Skip to content

Region parameterization inference does not consider inheritance #4723

@erickt

Description

@erickt

See this code:

pub trait Map<K, V> {
    pure fn f(&self) -> Option<&self/V>;
}

pub trait MutableMap<K, V>: Map<K, V> {
}

fn main() { }

It fails with:

foo.rs:7:28: 7:37 error: to use region types here, the containing type must be declared with a region bound
foo.rs:7 pub trait MutableMap<K, V>: Map<K, V> {
                                     ^~~~~~~~~
error: aborting due to previous error

I'm not quite sure what to do in this case. Is this an error? If not, how do I pass a region bound to a parent trait?

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions