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

Rollup of 14 pull requests #24260

Closed
wants to merge 101 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
dc8a8e9
Check uses of `Self` in impls in the compiler rather than during expa…
nrc Apr 3, 2015
05b8a10
Encode more precise scoping rules for function params.
pnkfelix Apr 3, 2015
c4216a5
Test cases for Issue 23338.
pnkfelix Apr 3, 2015
19e9828
Fix printing of extended errors.
michaelsproul Apr 4, 2015
8842760
Make `AdditiveIterator` and `MultiplicativeIterator` extensible
tbu- Mar 11, 2015
ab32154
Provide context for macro expansions which result in unparsed tokens.
whipsch Apr 4, 2015
63b36ea
Work with assoc types in a super trait.
nrc Apr 7, 2015
da7529a
Split check_cast to a separate file
sanxiyn Apr 7, 2015
f4c2228
Check casts from float
sanxiyn Apr 7, 2015
d18b405
Check casts from fat pointer
sanxiyn Apr 7, 2015
039a553
Add more extended error messages for match exprs.
michaelsproul Apr 7, 2015
4cf5930
Remove incorrect example from docs
hauleth Apr 7, 2015
df95719
Add Clone impls for extern "C" and unsafe fns
lilyball Apr 7, 2015
4695bf0
Remove another invalid example
hauleth Apr 7, 2015
3344221
Fix a typo
omo Apr 7, 2015
9a51c63
rustup: let RUSTUP_PREFIX env override default prefix.
rillian Apr 7, 2015
97f24a8
Make `sum` and `product` inherent methods on `Iterator`
tbu- Apr 6, 2015
dddcbcf
Fix range performance regression
aturon Apr 6, 2015
f354c8a
New TOC
steveklabnik Apr 7, 2015
5c3aa01
disabling a test that is failing on bitrig.
Apr 7, 2015
dd6c4a8
Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichton
bors Apr 8, 2015
0027253
Import real content.
steveklabnik Apr 8, 2015
c9454b1
Update "`let` is used to introduce variables" paragraph
bombless Apr 8, 2015
ce97c19
Auto merge of #24078 - whipsch:extra-token-msg, r=huonw
bors Apr 8, 2015
a329a61
alloc: impl fmt::Pointer for Rc, Arc and Box
richo Apr 7, 2015
e2ff188
Address review comments
sanxiyn Apr 8, 2015
3a66c7f
Auto merge of #24120 - aturon:range-perf, r=alexcrichton
bors Apr 8, 2015
926f38e
Auto merge of #23998 - nrc:impl-self, r=nikomatsakis
bors Apr 8, 2015
86c5faf
Address review nit by making `map_id` take an `FnMut`.
pnkfelix Apr 8, 2015
9266d59
Auto merge of #24021 - pnkfelix:fn-params-outlive-body, r=nikomatsakis
bors Apr 8, 2015
59e62de
Add tests for #22289, #22370 and #22384
lgrz Apr 8, 2015
1e79870
Modify the ExprUseVisitor to walk each part of an AutoRef, and in
nikomatsakis Apr 8, 2015
ac3cc6c
Rollup merge of #24143 - michaelsproul:extended-errors, r=pnkfelix
steveklabnik Apr 8, 2015
4cef7f2
Rollup merge of #24149 - bombless:update-faq, r=steveklabnik
steveklabnik Apr 8, 2015
91798a8
Rollup merge of #24167 - hauleth:remove-incorrect-example-from-mpsc, …
steveklabnik Apr 8, 2015
12e9d7c
Rollup merge of #24178 - steveklabnik:new_toc, r=nikomatsakis
steveklabnik Apr 8, 2015
30e7e6e
Auto merge of #24195 - steveklabnik:rollup, r=steveklabnik
bors Apr 8, 2015
45aa6c8
Implement reentrant mutexes and make stdio use them
nagisa Apr 3, 2015
ff80477
Auto merge of #24029 - nagisa:print-locking, r=alexcrichton
bors Apr 8, 2015
45eb54c
configure: Remove obsolete --nightly flag
brson Apr 8, 2015
bc9f16c
configure: Remove obsolete --disable-verify option
brson Apr 8, 2015
ed8eebd
configure: Rename --enable-debug to --enable-debug-assertions
brson Apr 8, 2015
59e332b
configure: Disable debug assertions by default
brson Apr 8, 2015
2cdfd37
configure: Clarify help message for --enable-debug-assertions
brson Apr 8, 2015
8545d2c
configure: Disable LLVM asserts by default
brson Apr 8, 2015
1b34f0a
configure: Clarify --enable-debug-assertions status message
brson Apr 8, 2015
7cbf823
configure: Add --enable-debuginfo
brson Apr 8, 2015
0cb9379
Allow plugins to register LLVM passes
kmcallister Apr 8, 2015
1002155
Add --enable-debug to control multiple perf options
brson Apr 8, 2015
6436e34
Auto merge of #24144 - richo:ptr-formatter, r=alexcrichton
bors Apr 8, 2015
6d17c35
configure: Add --enable-debug-jemalloc
brson Apr 8, 2015
2a9e101
Remove `ignore-tidy-linelength` from tests that no longer need it
lgrz Apr 8, 2015
65e3f03
std: Destabilize the internals of panic!
alexcrichton Apr 8, 2015
6b32072
std: Stabilize Clone::clone_from
alexcrichton Apr 8, 2015
561fdec
std: Stabilize io::Error::from_raw_os_error
alexcrichton Apr 8, 2015
ec7c800
Remove pretty-expanded from failing tests
alexcrichton Apr 8, 2015
287a544
Auto merge of #24158 - sanxiyn:cast, r=nrc
bors Apr 9, 2015
a725426
Don't deoptimize llvm when --enable-debug
brson Apr 9, 2015
0a380a9
Implement io::Seek for io::BufReader<R> where R: io::Seek
lilyball Apr 7, 2015
1605205
Implement io::Seek for io::BufWriter<W> where W: io::Seek
lilyball Apr 8, 2015
0e5e669
Auto merge of #24168 - kballard:clone-for-extern-c-unsafe-fns, r=alex…
bors Apr 9, 2015
613cf9a
Debug impls for a few things in syntax::codemap
nrc Apr 9, 2015
e57410c
Auto merge of #24171 - rillian:rustup, r=brson
bors Apr 9, 2015
341870a
Fix the span for `for` expressions
nrc Apr 9, 2015
ce76589
Rollup merge of #24171 - rillian:rustup, r=brson
Manishearth Apr 9, 2015
a00ab58
Rollup merge of #24175 - dhuseby:bitrig_fixing_tests_2, r=alexcrichton
Manishearth Apr 9, 2015
68100e4
Rollup merge of #24176 - kballard:bufreader-seek-impl, r=aturon
Manishearth Apr 9, 2015
e326aa1
Auto merge of #24176 - kballard:bufreader-seek-impl, r=aturon
bors Apr 9, 2015
e3f324c
Improve bounds in Iterator API
aturon Apr 9, 2015
549bd55
resurrect research paper list #24004
Apr 9, 2015
c3aa057
Add regression test for #19097
aturon Apr 9, 2015
746725a
Add librustc_data_structures crate
nikomatsakis Apr 7, 2015
af273d2
Use the newer snapshot_vec, which has a simplified delegate
nikomatsakis Apr 7, 2015
dbdb315
Port to using the newer graph, which offers iterators instead of the
nikomatsakis Apr 7, 2015
71aa0aa
Port to use the new Unify code, which has no UnifyValue trait
nikomatsakis Apr 7, 2015
ee94ee7
Add licenses.
nikomatsakis Apr 8, 2015
ead4631
Address nits
nikomatsakis Apr 8, 2015
0e0c841
Nightly gets LLVM assertions
brson Apr 9, 2015
3b87140
Rollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix
Manishearth Apr 9, 2015
67fa4d3
Rollup merge of #24193 - lstat:needstest, r=alexcrichton
Manishearth Apr 9, 2015
2dffe78
Rollup merge of #24205 - brson:debug, r=alexcrichton
Manishearth Apr 9, 2015
4e466e7
Rollup merge of #24207 - kmcallister:llvm-plugin, r=brson
Manishearth Apr 9, 2015
5daee19
Rollup merge of #24212 - alexcrichton:destabilize-begin-unwind, r=huonw
Manishearth Apr 9, 2015
cdfbb11
Rollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturon
Manishearth Apr 9, 2015
1a6e100
Rollup merge of #24216 - alexcrichton:stabilize-from-raw-os-error, r=…
Manishearth Apr 9, 2015
b389207
Rollup merge of #24218 - lstat:remove-ignore-tidy, r=alexcrichton
Manishearth Apr 9, 2015
27ecaa2
Rollup merge of #24221 - nrc:debug-loc, r=sfackler
Manishearth Apr 9, 2015
ce825ab
Rollup merge of #24170 - omo:omo-typo-fix, r=steveklabnik
Manishearth Apr 9, 2015
ede25fe
Rollup merge of #24225 - nrc:for-span, r=pnkfelix
Manishearth Apr 9, 2015
53a609b
Rollup merge of #24217 - aturon:iterator-fixes, r=alexcrichton
Manishearth Apr 9, 2015
ea73179
fixup windows std_misc
Manishearth Apr 9, 2015
88fc543
Auto merge of #24232 - Manishearth:rollup, r=Manishearth
bors Apr 9, 2015
bf88539
TRPL: new introduction
steveklabnik Apr 9, 2015
6b95d8b
Auto merge of #24205 - brson:debug, r=alexcrichton
bors Apr 9, 2015
5a90661
Add examples for Convert
steveklabnik Apr 6, 2015
b6dc3a6
Rollup merge of #24121 - steveklabnik:gh24107, r=alexcrichton
Manishearth Apr 10, 2015
d4f89a6
Rollup merge of #24180 - huonw:optimise-max-etc, r=alexcrichton
Manishearth Apr 10, 2015
7da6065
Rollup merge of #24209 - nikomatsakis:refactor-unification, r=nrc
Manishearth Apr 10, 2015
2e3cc5f
Rollup merge of #24234 - thiagooak:academic-research, r=steveklabnik
Manishearth Apr 10, 2015
858f3c8
Rollup merge of #24236 - aturon:issue-19097, r=alexcrichton
Manishearth Apr 10, 2015
3252694
Rollup merge of #24239 - steveklabnik:editing_pass, r=steveklabnik
Manishearth Apr 10, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 44 additions & 19 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -523,30 +523,35 @@ fi
BOOL_OPTIONS=""
VAL_OPTIONS=""

opt debug 0 "debug mode"
opt valgrind 0 "run tests with valgrind (memcheck by default)"
opt helgrind 0 "run tests with helgrind instead of memcheck"
opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
opt docs 1 "build standard library documentation"
opt compiler-docs 0 "build compiler documentation"
opt optimize 1 "build optimized rust code"
opt optimize-cxx 1 "build optimized C++ code"
opt optimize-llvm 1 "build optimized LLVM"
opt optimize-tests 1 "build tests with optimizations"
opt libcpp 1 "build with llvm with libc++ instead of libstdc++ when using clang"
opt llvm-assertions 1 "build LLVM with assertions"
opt debug 1 "build with extra debug fun"
opt llvm-assertions 0 "build LLVM with assertions"
opt debug-assertions 0 "build with debugging assertions"
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
opt rpath 0 "build rpaths into rustc itself"
opt nightly 0 "build nightly packages"
opt verify-install 1 "verify installed binaries work"
# This is used by the automation to produce single-target nightlies
opt dist-host-only 0 "only install bins for the host architecture"
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
opt llvm-version-check 1 "don't check if the LLVM version is supported, build anyway"

# Optimization and debugging options. These may be overridden by the release channel, etc.
opt_nosave optimize 1 "build optimized rust code"
opt_nosave optimize-cxx 1 "build optimized C++ code"
opt_nosave optimize-llvm 1 "build optimized LLVM"
opt_nosave llvm-assertions 0 "build LLVM with assertions"
opt_nosave debug-assertions 0 "build with debugging assertions"
opt_nosave debuginfo 0 "build with debugger metadata"
opt_nosave debug-jemalloc 0 "build jemalloc with --enable-debug --enable-fill"

valopt localstatedir "/var/lib" "local state directory"
valopt sysconfdir "/etc" "install system configuration files"

Expand All @@ -556,6 +561,7 @@ valopt llvm-root "" "set LLVM root"
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
valopt release-channel "dev" "the name of the release channel to build"

# Many of these are saved below during the "writing configuration" step
# (others are conditionally saved).
Expand All @@ -568,7 +574,6 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
valopt_nosave release-channel "dev" "the name of the release channel to build"

# Temporarily support old triples until buildbots get updated
CFG_BUILD=$(to_llvm_triple $CFG_BUILD)
Expand Down Expand Up @@ -612,22 +617,37 @@ fi
step_msg "validating $CFG_SELF args"
validate_opt

# Validate the release channel
# Validate the release channel, and configure options
case "$CFG_RELEASE_CHANNEL" in
(dev | nightly | beta | stable)
nightly )
msg "overriding settings for $CFG_RELEASE_CHANNEL"
CFG_ENABLE_LLVM_ASSERTIONS=1
;;
dev | beta | stable)
;;
(*)
*)
err "release channel must be 'dev', 'nightly', 'beta' or 'stable'"
;;
esac

# Continue supporting the old --enable-nightly flag to transition the bots
# XXX Remove me
if [ ! -z "$CFG_ENABLE_NIGHTLY" ]
then
CFG_RELEASE_CHANNEL=nightly
# Adjust perf and debug options for debug mode
if [ -n "$CFG_ENABLE_DEBUG" ]; then
msg "debug mode enabled, setting performance options"
CFG_DISABLE_OPTIMIZE=1
CFG_DISABLE_OPTIMIZE_CXX=1
CFG_ENABLE_LLVM_ASSERTIONS=1
CFG_ENABLE_DEBUG_ASSERTIONS=1
CFG_ENABLE_DEBUG_JEMALLOC=1
fi
putvar CFG_RELEASE_CHANNEL

# OK, now write the debugging options
if [ -n "$CFG_DISABLE_OPTIMIZE" ]; then putvar CFG_DISABLE_OPTIMIZE; fi
if [ -n "$CFG_DISABLE_OPTIMIZE_CXX" ]; then putvar CFG_DISABLE_OPTIMIZE_CXX; fi
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then putvar CFG_DISABLE_OPTIMIZE_LLVM; fi
if [ -n "$CFG_ENABLE_LLVM_ASSERTIONS" ]; then putvar CFG_ENABLE_LLVM_ASSERTIONS; fi
if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTIONS; fi
if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi
if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi

# A magic value that allows the compiler to use unstable features
# during the bootstrap even when doing so would normally be an error
Expand Down Expand Up @@ -1180,7 +1200,7 @@ do
LLVM_DBG_OPTS="--enable-optimized"
LLVM_INST_DIR=$LLVM_BUILD_DIR/Release
fi
if [ ! -z "$CFG_DISABLE_LLVM_ASSERTIONS" ]
if [ -z "$CFG_ENABLE_LLVM_ASSERTIONS" ]
then
LLVM_ASSERTION_OPTS="--disable-assertions"
else
Expand Down Expand Up @@ -1434,6 +1454,11 @@ move_if_changed config.tmp config.mk
rm -f config.tmp
touch config.stamp

step_msg "complete"
if [ -z "$CFG_ENABLE_DEBUG" ]; then
step_msg "configured in release mode. for development consider --enable-debug"
else
step_msg "complete"
fi

msg "run \`make help\`"
msg
11 changes: 7 additions & 4 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ TARGET_CRATES := libc std flate arena term \
log graphviz core rbml alloc \
unicode rustc_bitflags
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
rustc_data_structures
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
TOOLS := compiletest rustdoc rustc rustbook
Expand All @@ -80,9 +81,10 @@ DEPS_rustc_resolve := rustc log syntax
DEPS_rustc_privacy := rustc log syntax
DEPS_rustc_lint := rustc log syntax
DEPS_rustc := syntax flate arena serialize getopts rbml \
log graphviz rustc_llvm rustc_back
log graphviz rustc_llvm rustc_back rustc_data_structures
DEPS_rustc_llvm := native:rustllvm libc std
DEPS_rustc_back := std syntax rustc_llvm flate log libc
DEPS_rustc_data_structures := std log serialize
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
test rustc_lint
DEPS_rustc_bitflags := core
Expand Down Expand Up @@ -141,16 +143,17 @@ DOC_CRATES := $(filter-out rustc, \
$(filter-out rustc_trans, \
$(filter-out rustc_typeck, \
$(filter-out rustc_borrowck, \
$(filter-out rustc_data_structures, \
$(filter-out rustc_resolve, \
$(filter-out rustc_driver, \
$(filter-out rustc_privacy, \
$(filter-out rustc_lint, \
$(filter-out log, \
$(filter-out getopts, \
$(filter-out syntax, $(CRATES))))))))))))
$(filter-out syntax, $(CRATES)))))))))))))
#endif
#endif
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_data_structures rustc_resolve \
rustc_typeck rustc_driver syntax rustc_privacy \
rustc_lint

Expand Down
10 changes: 2 additions & 8 deletions mk/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.

ifdef CFG_DISABLE_VERIFY_INSTALL
MAYBE_DISABLE_VERIFY=--disable-verify
else
MAYBE_DISABLE_VERIFY=
endif

install:
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
# Build the dist as the original user
Expand All @@ -22,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
endif
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist

Expand Down
13 changes: 9 additions & 4 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,16 @@ endif

CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)

ifdef CFG_DISABLE_DEBUG
CFG_RUSTC_FLAGS += --cfg ndebug
else
$(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
ifdef CFG_ENABLE_DEBUG_ASSERTIONS
$(info cfg: enabling debug assertions (CFG_ENABLE_DEBUG_ASSERTIONS))
CFG_RUSTC_FLAGS += --cfg debug -C debug-assertions=on
else
CFG_RUSTC_FLAGS += --cfg ndebug
endif

ifdef CFG_ENABLE_DEBUGINFO
$(info cfg: enabling debuginfo (CFG_ENABLE_DEBUGINFO))
CFG_RUSTC_FLAGS += -g
endif

ifdef SAVE_TEMPS
Expand Down
4 changes: 4 additions & 0 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
JEMALLOC_ARGS_$(1) := --disable-tls
endif

ifdef CFG_ENABLE_DEBUG_JEMALLOC
JEMALLOC_ARGS_$(1) += --enable-debug --enable-fill
endif

################################################################################
# jemalloc
################################################################################
Expand Down
16 changes: 10 additions & 6 deletions src/doc/complement-design-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,17 @@ This is to make the language easier to parse for humans, especially in the face
of higher-order functions. `fn foo<T>(f: fn(int): int, fn(T): U): U` is not
particularly easy to read.

## `let` is used to introduce variables
## Why is `let` used to introduce variables?

`let` not only defines variables, but can do pattern matching. One can also
redeclare immutable variables with `let`. This is useful to avoid unnecessary
`mut` annotations. An interesting historical note is that Rust comes,
syntactically, most closely from ML, which also uses `let` to introduce
bindings.
We don't use the term "variable", instead, we use "variable bindings". The
simplest way for binding is the `let` syntax, other ways including `if let`,
`while let` and `match`. Bindings also exist in function arguments positions.

Bindings always happen in pattern matching positions, and it's also Rust's way
to declare mutability. One can also redeclare mutability of a binding in
pattern matching. This is useful to avoid unnecessary `mut` annotations. An
interesting historical note is that Rust comes, syntactically, most closely
from ML, which also uses `let` to introduce bindings.

See also [a long thread][alt] on renaming `let mut` to `var`.

Expand Down
Loading