Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E0301: Duplicate interface requirement

CodeCategoryStability
E0301SemanticPermanent

Explanation

An interface declares more than one requirement with the same name. Requirement names are unique within an interface; different parameter lists do not introduce overloads.

Likely cause

A requirement was repeated or two operations were given the same name. Remove the duplicate or give distinct operations distinct names.

Examples

Repeated requirement

Requires --preview interfaces.

interface Show { fn show(borrow self); fn show(borrow self); }
fn main() {}

One requirement per name

Requires --preview interfaces.

interface Show { fn show(borrow self); }
fn main() {}

References