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
I know it probably doesn't matter /too/ much how bad the code gen is with no optimization on, but generating a load for every static vector element could result in some serious code explosion.
The text was updated successfully, but these errors were encountered:
This still occurs, and, if the contents (i.e. 0 in this case) is changed to a value that can't be memset (x = [1, ..1024]) then even --opt-level=3 generates the horrible code:
I'm going to attempt to fix this by getting rustc to generate a loop, instead of individual mov instructions, which llvm can hopefully unroll/optimise as appropriate.
… r=ebroto
Identical arguments on assert macro family
Lint when identical args are used on `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros.
Added to the lint `eq_op`.
Common functions added to `utils/higher.rs`
Fixes: rust-lang#3574Fixes: rust-lang#4694
changelog: Lint on identical args when calling `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros
A program like this:
Results in code like (
--opt-level=0
):But with
--opt-level=3
:Which is what we'd expect.
I know it probably doesn't matter /too/ much how bad the code gen is with no optimization on, but generating a load for every static vector element could result in some serious code explosion.
The text was updated successfully, but these errors were encountered: