You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found out syntax for this was E2/&r<T> from @nikomatsakis' blog post. Probably needs to be documented somewhere at some point, but that's issue #3886 (which seems to have been closed on the basis that &r/T is already documented, when the issue was about T/&r...).
When checking for functions that are potential candidates for trait
implementations check the function header to make sure modifiers like
asyncness, constness and safety match before triggering the lint.
Fixesrust-lang#5413, rust-lang#4290
oli-obk
pushed a commit
to oli-obk/rust
that referenced
this issue
May 2, 2020
Check fn header along with decl when suggesting to implement trait
When checking for functions that are potential candidates for trait
implementations check the function header to make sure modifiers like
asyncness, constness and safety match before triggering the lint.
Fixesrust-lang#5413, rust-lang#4290
changelog: check fn header along with decl for should_implement_trait
This code fails to compile:
enum E1 = ∫
fn f1(v: &r/int) -> E1/&r { E1(v) }
enum E2<T> = &T;
fn f2<T>(v: &r/T) -> E2<T>/&r { E2(v) }
fn main() {
let v = &5;
io::println(fmt!("%d", **f1(v)));
io::println(fmt!("%d", **f2(v)));
}
test.rs:7:26: 7:27 error: expected
{
but found/
test.rs:7 fn f2<T>(v: &r/T) -> E2<T>/&r { E2(v) }
The text was updated successfully, but these errors were encountered: