X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_error_codes%2Fsrc%2Ferror_codes%2FE0118.md;h=cfabae1a6346d6a2d0217d4622efb5706d06ed2f;hb=5271e32c463e92f1afa6c54aa9dbb6a9d8454e0d;hp=8033aa8384c2e1276f742b8dd37070774da23ef8;hpb=1dc672a766832287f2f998a1cdde76ea74cd480d;p=rust.git diff --git a/compiler/rustc_error_codes/src/error_codes/E0118.md b/compiler/rustc_error_codes/src/error_codes/E0118.md index 8033aa8384c..cfabae1a634 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0118.md +++ b/compiler/rustc_error_codes/src/error_codes/E0118.md @@ -4,7 +4,7 @@ enum, union, or trait object. Erroneous code example: ```compile_fail,E0118 -impl fn(u8) { // error: no nominal type found for inherent implementation +impl T { // error: no nominal type found for inherent implementation fn get_state(&self) -> String { // ... } @@ -20,8 +20,8 @@ trait LiveLongAndProsper { fn get_state(&self) -> String; } -// and now you can implement it on fn(u8) -impl LiveLongAndProsper for fn(u8) { +// and now you can implement it on T +impl LiveLongAndProsper for T { fn get_state(&self) -> String { "He's dead, Jim!".to_owned() } @@ -33,9 +33,9 @@ For example, `NewType` is a newtype over `Foo` in `struct NewType(Foo)`. Example: ``` -struct TypeWrapper(fn(u8)); +struct TypeWrapper(T); -impl TypeWrapper { +impl TypeWrapper { fn get_state(&self) -> String { "Fascinating!".to_owned() }