Philipp Gesang

Results 19 comments of Philipp Gesang

This now works again as of Element 1.11.110. Thanks everybody, you rock!

Hi, is there a way to tell in a late pass whether one or more of a struct’s members have been moved? That might enable machine-applicability of this lint.

Thanks for the pointer, I’ll look into folding it into ``unnecessary_struct_initialization``! > In particular, this lint also suffers from the same issues that > that other lint does, which is...

> *However* I think for the purposes of this PR it would be > easier to just not worry about the possible false positives > that had already existed and...

Hi again, I believe the PR is in a state that warrants another look now. As discussed I folded the lint into ``unnecessary_struct_initialization`` and integrated some further checks that were...

> Just ignoring/filtering out shorthand initialization seems like > it would introduce false positives Indeed it does, good catch! I dropped that check.

> Can you also add a test case involving ranges? > ```rs > let r = 0..5; > let r = r.start..r.end; > ``` > The desugaring to `Range {...

> > + if is_copy(cx, cx.typeck_results().expr_ty(expr_a)) && path_to_local(expr_b).is_some() { > + // When the type implements `Copy`, a reference to the new struct works on the > + // copy....