Content-Length: 24256 | pFad | https://doc.rust-lang.org/std/string/../error/../string/../vec/../../error_codes/./E0324.html

E0324 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0324

A method was implemented when another trait item was expected.

Erroneous code example:

#![allow(unused)]
fn main() {
struct Bar;

trait Foo {
    const N : u32;

    fn M();
}

impl Foo for Bar {
    fn N() {}
    // error: item `N` is an associated method, which doesn't match its
    //        trait `<Bar as Foo>`
}
}

To fix this error, please verify that the method name wasn’t misspelled and verify that you are indeed implementing the correct trait items. Example:

#![allow(unused)]
fn main() {
struct Bar;

trait Foo {
    const N : u32;

    fn M();
}

impl Foo for Bar {
    const N : u32 = 0;

    fn M() {} // ok!
}
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../error/../string/../vec/../../error_codes/./E0324.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy