Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed most instances of vec!(..) and replaced them with vec![..]s #37476

Closed
wants to merge 19 commits into from

Conversation

iirelu
Copy link
Contributor

@iirelu iirelu commented Oct 29, 2016

Everyone hates the old syntax. I hope. Otherwise this PR has some controversy I wasn't expecting.

This would be the perfect time to write a lint recommending vec![..] when you use another style.

Disclaimer: I may have broken something. If I have, I'll fix them when the tests come in. Luckily the chance for a non-syntactical error is pretty low in all this.

nnethercote and others added 4 commits October 28, 2016 15:18
On 64-bit this reduces the size of `Expr_` from 144 to 64 bytes, and
reduces the size of `Expr` from 176 to 96 bytes.
Most of the Rust community agrees that the vec! macro is more clear when
called using square brackets [] instead of regular brackets (). Most of
these ocurrences are from before macros allowed using different types of
brackets.
These are all legacies from before the clearer vec![] was possible to
write. They are now all gone. This would be a perfect time to write a
lint for ocurrences of vec!().
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Aatch (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@steveklabnik
Copy link
Member

👍

On Oct 29, 2016, 19:34 -0400, Anna Harren notifications@github.com, wrote:

Everyone hates the old syntax. I hope. Otherwise this PR has some controversy I wasn't expecting.

This would be the perfect time to write a lint recommending vec![..] when you use another style.

Disclaimer: I may have broken something. If I have, I'll fix them when the tests come in. Luckily the chance for a non-syntactical error is pretty low in all this.

You can view, comment on, or merge this pull request online at:

#37476

Commit Summary
Changed all empty vec!()s to use square brackets
Removed every last vec!(..) from Rust. Yay.

File Changes
M src/libcollections/slice.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-0) (2)
M src/libcollections/vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-1) (6)
M src/libcore/option.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-2) (4)
M src/libcore/result.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-3) (4)
M src/libgetopts/lib.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-4) (4)
M src/libgraphviz/lib.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-5) (10)
M src/librand/chacha.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-6) (12)
M src/librand/distributions/mod.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-7) (18)
M src/librand/isaac.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-8) (16)
M src/librustc/cfg/construct.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-9) (6)
M src/librustc/infer/error_reporting.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-10) (4)
M src/librustc/lint/context.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-11) (10)
M src/librustc/middle/lang_items.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-12) (2)
M src/librustc/session/config.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-13) (4)
M src/librustc/session/mod.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-14) (2)
M src/librustc/traits/project.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-15) (8)
M src/librustc/ty/walk.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-16) (2)
M src/librustc/ty/wf.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-17) (10)
M src/librustc_back/sha2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-18) (4)
M src/librustc_back/target/dragonfly_base.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-19) (4)
M src/librustc_back/target/freebsd_base.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-20) (4)
M src/librustc_back/target/le32_unknown_nacl.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-21) (6)
M src/librustc_back/target/netbsd_base.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-22) (4)
M src/librustc_back/target/openbsd_base.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-23) (4)
M src/librustc_back/target/windows_base.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-24) (20)
M src/librustc_borrowck/borrowck/gather_loans/move_error.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-25) (2)
M src/librustc_borrowck/borrowck/move_data.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-26) (2)
M src/librustc_const_eval/diagnostics.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-27) (6)
M src/librustc_metadata/creader.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-28) (16)
M src/librustc_plugin/registry.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-29) (10)
M src/librustc_save_analysis/dump_visitor.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-30) (8)
M src/librustc_save_analysis/span_utils.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-31) (4)
M src/librustc_trans/asm.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-32) (2)
M src/librustc_trans/back/rpath.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-33) (2)
M src/librustc_trans/back/write.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-34) (2)
M src/librustc_trans/cleanup.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-35) (8)
M src/librustc_typeck/check/intrinsic.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-36) (118)
M src/librustc_typeck/collect.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-37) (2)
M src/librustc_typeck/lib.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-38) (4)
M src/librustdoc/core.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-39) (4)
M src/librustdoc/html/markdown.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-40) (2)
M src/librustdoc/html/render.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-41) (2)
M src/librustdoc/html/toc.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-42) (4)
M src/librustdoc/lib.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-43) (4)
M src/librustdoc/test.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-44) (4)
M src/libserialize/json.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-45) (6)
M src/libstd/io/cursor.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-46) (12)
M src/libstd/rand/mod.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-47) (2)
M src/libsyntax/ast.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-48) (4)
M src/libsyntax/ext/build.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-49) (32)
M src/libsyntax/ext/quote.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-50) (62)
M src/libsyntax/parse/mod.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-51) (32)
M src/libsyntax/parse/parser.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-52) (8)
M src/libsyntax/print/pprust.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-53) (2)
M src/libsyntax/test.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-54) (2)
M src/libsyntax/util/small_vector.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-55) (6)
M src/libsyntax_ext/deriving/cmp/partial_eq.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-56) (4)
M src/libsyntax_ext/deriving/cmp/partial_ord.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-57) (4)
M src/libsyntax_ext/deriving/decodable.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-58) (4)
M src/libsyntax_ext/deriving/encodable.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-59) (14)
M src/libsyntax_ext/deriving/mod.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-60) (4)
M src/libtest/lib.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-61) (4)
M src/test/compile-fail/E0297.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-62) (2)
M src/test/compile-fail/auto-ref-slice-plus-ref.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-63) (2)
M src/test/compile-fail/borrowck/borrowck-assign-comp-idx.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-64) (6)
M src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue-2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-65) (2)
M src/test/compile-fail/borrowck/borrowck-loan-vec-content.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-66) (4)
M src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-67) (2)
M src/test/compile-fail/borrowck/borrowck-move-out-of-vec-tail.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-68) (4)
M src/test/compile-fail/borrowck/borrowck-mut-slice-of-imm-vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-69) (2)
M src/test/compile-fail/borrowck/borrowck-overloaded-index-move-from-vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-70) (2)
M src/test/compile-fail/borrowck/borrowck-vec-pattern-element-loan.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-71) (6)
M src/test/compile-fail/borrowck/borrowck-vec-pattern-loan-from-mut.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-72) (2)
M src/test/compile-fail/borrowck/borrowck-vec-pattern-nesting.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-73) (8)
M src/test/compile-fail/borrowck/borrowck-vec-pattern-tail-element-loan.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-74) (2)
M src/test/compile-fail/drop-with-active-borrows-2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-75) (2)
M src/test/compile-fail/integral-indexing.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-76) (2)
M src/test/compile-fail/issue-11873.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-77) (2)
M src/test/compile-fail/issue-13446.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-78) (2)
M src/test/compile-fail/issue-3044.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-79) (2)
M src/test/compile-fail/issue-5067.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-80) (2)
M src/test/compile-fail/lint-unused-mut-variables.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-81) (4)
M src/test/compile-fail/match-vec-unreachable.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-82) (2)
M src/test/compile-fail/moves-based-on-type-access-to-field.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-83) (2)
M src/test/compile-fail/moves-based-on-type-exprs.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-84) (10)
M src/test/compile-fail/no-capture-arc.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-85) (2)
M src/test/compile-fail/no-reuse-move-arc.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-86) (2)
M src/test/compile-fail/non-copyable-void.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-87) (2)
M src/test/compile-fail/non-exhaustive-match.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-88) (8)
M src/test/compile-fail/on-unimplemented/on-trait.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-89) (2)
M src/test/compile-fail/regions-escape-loop-via-vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-90) (2)
M src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-91) (2)
M src/test/compile-fail/unboxed-closures-move-upvar-from-non-once-ref-closure.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-92) (2)
M src/test/compile-fail/vec-macro-with-comma-only.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-93) (2)
M src/test/compile-fail/vec-mut-iter-borrow.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-94) (2)
M src/test/compile-fail/vec-res-add.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-95) (4)
M src/test/compile-fail/writing-to-immutable-vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-96) (2)
M src/test/debuginfo/issue14411.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-97) (2)
M src/test/parse-fail/issue-10412.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-98) (2)
M src/test/pretty/block-disambig.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-99) (4)
M src/test/pretty/stmt_expr_attributes.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-100) (2)
M src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-101) (4)
M src/test/run-pass/assignability-trait.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-102) (2)
M src/test/run-pass/associated-types-doubleendediterator-object.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-103) (2)
M src/test/run-pass/associated-types-iterator-binding.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-104) (2)
M src/test/run-pass/auto-loop.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-105) (2)
M src/test/run-pass/auto-ref-sliceable.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-106) (2)
M src/test/run-pass/autobind.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-107) (2)
M src/test/run-pass/block-arg.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-108) (2)
M src/test/run-pass/borrow-by-val-method-receiver.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-109) (2)
M src/test/run-pass/borrowck/borrowck-binding-mutbl.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-110) (2)
M src/test/run-pass/borrowck/borrowck-mut-vec-as-imm-slice.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-111) (2)
M src/test/run-pass/break.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-112) (2)
M src/test/run-pass/byte-literals.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-113) (2)
M src/test/run-pass/cci_no_inline_exe.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-114) (2)
M src/test/run-pass/class-poly-methods-cross-crate.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-115) (8)
M src/test/run-pass/class-poly-methods.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-116) (8)
M src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-117) (2)
M src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-118) (2)
M src/test/run-pass/coerce-reborrow-mut-vec-arg.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-119) (2)
M src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-120) (2)
M src/test/run-pass/deriving-in-macro.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-121) (2)
M src/test/run-pass/drop-with-type-ascription-2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-122) (2)
M src/test/run-pass/expr-fn.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-123) (2)
M src/test/run-pass/expr-match-panic.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-124) (2)
M src/test/run-pass/for-destruct.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-125) (2)
M src/test/run-pass/foreach-nested.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-126) (2)
M src/test/run-pass/generic-ivec-leak.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-127) (2)
M src/test/run-pass/generic-static-methods.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-128) (2)
M src/test/run-pass/getopts_ref.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-129) (2)
M src/test/run-pass/hashmap-memory.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-130) (2)
M src/test/run-pass/html-literals.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-131) (2)
M src/test/run-pass/ifmt.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-132) (2)
M src/test/run-pass/issue-13204.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-133) (2)
M src/test/run-pass/issue-14936.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-134) (2)
M src/test/run-pass/issue-15080.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-135) (2)
M src/test/run-pass/issue-15189.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-136) (2)
M src/test/run-pass/issue-15734.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-137) (2)
M src/test/run-pass/issue-2631-b.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-138) (2)
M src/test/run-pass/issue-2723-b.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-139) (2)
M src/test/run-pass/issue-28936.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-140) (2)
M src/test/run-pass/issue-2989.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-141) (4)
M src/test/run-pass/issue-3389.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-142) (4)
M src/test/run-pass/issue-6153.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-143) (2)
M src/test/run-pass/ivec-pass-by-value.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-144) (2)
M src/test/run-pass/ivec-tag.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-145) (4)
M src/test/run-pass/lambda-infer-unresolved.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-146) (2)
M src/test/run-pass/linear-for-loop.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-147) (2)
M src/test/run-pass/log-poly.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-148) (2)
M src/test/run-pass/loop-scope.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-149) (2)
M src/test/run-pass/match-vec-rvalue.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-150) (2)
M src/test/run-pass/monad.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-151) (6)
M src/test/run-pass/move-arg-2-unique.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-152) (4)
M src/test/run-pass/move-arg-2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-153) (4)
M src/test/run-pass/newtype-polymorphic.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-154) (2)
M src/test/run-pass/nullable-pointer-iotareduction.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-155) (2)
M src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-156) (4)
M src/test/run-pass/overloaded-deref.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-157) (2)
M src/test/run-pass/rcvr-borrowed-to-slice.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-158) (6)
M src/test/run-pass/regions-borrow-evec-uniq.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-159) (4)
M src/test/run-pass/regions-dependent-addr-of.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-160) (2)
M src/test/run-pass/regions-dependent-autoslice.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-161) (2)
M src/test/run-pass/regions-infer-borrow-scope-view.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-162) (2)
M src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-163) (2)
M src/test/run-pass/seq-compare.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-164) (18)
M src/test/run-pass/size-and-align.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-165) (2)
M src/test/run-pass/static-impl.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-166) (6)
M src/test/run-pass/swap-2.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-167) (2)
M src/test/run-pass/task-comm-16.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-168) (2)
M src/test/run-pass/trait-bounds-in-arc.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-169) (4)
M src/test/run-pass/trait-generic.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-170) (8)
M src/test/run-pass/trait-to-str.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-171) (6)
M src/test/run-pass/unboxed-closures-counter-not-moved.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-172) (2)
M src/test/run-pass/unboxed-closures-move-some-upvars-in-by-ref-closure.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-173) (4)
M src/test/run-pass/unique-autoderef-index.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-174) (2)
M src/test/run-pass/unique-create.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-175) (2)
M src/test/run-pass/unique-drop-complex.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-176) (2)
M src/test/run-pass/unique-in-vec-copy.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-177) (2)
M src/test/run-pass/unique-in-vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-178) (2)
M src/test/run-pass/utf8_chars.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-179) (2)
M src/test/run-pass/vec-concat.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-180) (4)
M src/test/run-pass/vec-growth.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-181) (2)
M src/test/run-pass/vec-late-init.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-182) (2)
M src/test/run-pass/vec-macro-with-trailing-comma.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-183) (4)
M src/test/run-pass/vec-push.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-184) (2)
M src/test/run-pass/vec-to_str.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-185) (4)
M src/test/run-pass/vec.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-186) (2)
M src/test/run-pass/while-with-break.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-187) (2)
M src/tools/compiletest/src/main.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-188) (4)
M src/tools/compiletest/src/runtest.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-189) (70)
M src/tools/rustbook/book.rs (https://github.com/rust-lang/rust/pull/37476/files#diff-190) (10)

Patch Links:
https://github.com/rust-lang/rust/pull/37476.patch
https://github.com/rust-lang/rust/pull/37476.diff


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub (#37476), or mute the thread (https://github.com/notifications/unsubscribe-auth/AABsiiqj69F-DYas-YBb6E6JWfqg4pi4ks5q49gjgaJpZM4KkPzC).

@sanxiyn
Copy link
Member

sanxiyn commented Oct 30, 2016

failures:
    [pretty] pretty/stmt_expr_attributes.rs

@iirelu
Copy link
Contributor Author

iirelu commented Oct 30, 2016

Oh dear, looks like I hit some sort of snag in pretty printing. Looks like vec![] still pretty-prints as vec!() :(

Should I revert this single file's changes, or is there something else that needs fixing?

Edit: If it is something else that needs fixing, it'll probably need doing in another PR, so I'll just revert this for now.

Sadly it looks like pretty printing still wants vec![]s to be vec!()s :(

This is something that should be fixed at another time.
@iirelu iirelu changed the title Removed ALL instances of vec!(..) and replaced them with vec![..]s Removed most instances of vec!(..) and replaced them with vec![..]s Oct 30, 2016
@Mark-Simulacrum
Copy link
Member

I'd guess that'll be rather hard to fix--I don't believe pretty printing is "aware" of vec! specifically, and as such it doesn't know it should be vec![...] and not vec!(...).

I'm not familiar with that part of the compiler though, so may be wrong.

Shrink Expr_::ExprInlineAsm.

On 64-bit this reduces the size of `Expr_` from 144 to 64 bytes, and
reduces the size of `Expr` from 176 to 96 bytes.

For the workload in rust-lang#36799 this reduces the RSS for the "lowering ast -> hir" phase and all subsequent phases by 50 MiB, which reduces the peak RSS for that workload by about 1%. Not huge, but it's a very easy improvement.

r? @eddyb
@bors
Copy link
Contributor

bors commented Oct 30, 2016

☔ The latest upstream changes (presumably #37431) made this pull request unmergeable. Please resolve the merge conflicts.

@iirelu
Copy link
Contributor Author

iirelu commented Oct 30, 2016

Never resolved a merge conflict before. Sure hope I did that right!

@retep998
Copy link
Member

Typically the way merge conflicts are resolved is by rebasing your pull request on top of master, that way you don't have extra merge commits cluttering up the history.

bors and others added 8 commits October 30, 2016 13:36
Fix ICE when attempting to print closure generics

Fixes rust-lang#36622.

r? @eddyb or @arielb1
save-analysis: change imports to carry a ref id rather than their own…

… node id

To make jump to def for imports work

r? @eddyb
…xcrichton

Replace all uses of SHA-256 with BLAKE2b.

Removes the SHA-256 implementation and replaces all uses of it with BLAKE2b, which we already use for debuginfo type guids and incremental compilation hashes. It doesn't make much sense to have two different cryptographic hash implementations in the compiler and Blake has a few advantages over SHA-2 (computationally less expensive, hashes of up to 512 bits).
@bors
Copy link
Contributor

bors commented Oct 31, 2016

☔ The latest upstream changes (presumably #37439) made this pull request unmergeable. Please resolve the merge conflicts.

Most of the Rust community agrees that the vec! macro is more clear when
called using square brackets [] instead of regular brackets (). Most of
these ocurrences are from before macros allowed using different types of
brackets.
@iirelu
Copy link
Contributor Author

iirelu commented Oct 31, 2016

I fucked up my git history. :(

@iirelu
Copy link
Contributor Author

iirelu commented Oct 31, 2016

Okay I completely fucked up everything. I'm just going to close this.

@iirelu iirelu closed this Oct 31, 2016
@steveklabnik
Copy link
Member

@iirelu happy to help out if you need some; I think this is a good change, and would hate to see git be the reason it's not merged 😄

bors added a commit that referenced this pull request Oct 31, 2016
Make all vec! macros use square brackets: Attempt 2

[The last PR](#37476) ended with tears after a valiant struggle with git. I managed to clean up the completely broken history of that into a brand spanking new PR! Yay!

Original:

> Everyone hates the old syntax. I hope. Otherwise this PR has some controversy I wasn't expecting.

> This would be the perfect time to write a lint recommending vec![..] when you use another style.

> Disclaimer: I may have broken something. If I have, I'll fix them when the tests come in. Luckily the chance for a non-syntactical error is pretty low in all this.
spikespaz pushed a commit to spikespaz/dotwalk-rs that referenced this pull request Aug 29, 2024
Make all vec! macros use square brackets: Attempt 2

[The last PR](rust-lang/rust#37476) ended with tears after a valiant struggle with git. I managed to clean up the completely broken history of that into a brand spanking new PR! Yay!

Original:

> Everyone hates the old syntax. I hope. Otherwise this PR has some controversy I wasn't expecting.

> This would be the perfect time to write a lint recommending vec![..] when you use another style.

> Disclaimer: I may have broken something. If I have, I'll fix them when the tests come in. Luckily the chance for a non-syntactical error is pretty low in all this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.