Skip to content

Rollup of 8 pull requests #29610

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

Merged
merged 80 commits into from
Nov 5, 2015
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
ec3dc2d
1.4 release notes
brson Oct 27, 2015
018c468
Address release notes feedback
brson Oct 29, 2015
615275b
doc: make example more simple
tshepang Oct 29, 2015
37735b4
run rustfmt on std::path
tshepang Oct 21, 2015
ab10cb7
Clarify Windows gcc setup instructions.
vadimcn Nov 1, 2015
363deb0
Formatting
vadimcn Nov 2, 2015
a9cbf6c
Accept tabs as indentation character
meqif Oct 31, 2015
6e27448
mk: Add rtstartup to dist
alexcrichton Nov 2, 2015
b1ef530
librustdoc: ignore lint warnings when compiling documentation
Ryman Nov 2, 2015
900f36f
Specify Microsoft Windows and Mac OS X explicitly
amitsaha Nov 2, 2015
eacd359
Auto merge of #29459 - tshepang:simplify, r=steveklabnik
bors Nov 3, 2015
6d7c66e
Introduce a "liberated fn sigs" map so that we have easy access to this
nikomatsakis Oct 21, 2015
88a9c3e
Build the MIR using the liberated fn sigs, and track the return type
nikomatsakis Oct 21, 2015
1e30f3e
Change ShallowDrop to Free, so that it matches what trans will do
nikomatsakis Oct 21, 2015
15c1da4
Convert from using named fields to always using indices
nikomatsakis Oct 21, 2015
3c07b46
Pass the mir map to trans
nikomatsakis Oct 21, 2015
b5d3580
Move the "HAIR" code that reads the tcx tables etc out of the `tcx`
nikomatsakis Oct 21, 2015
3ab29d3
Add adt_def into Switch, since it's convenient to have in trans
nikomatsakis Oct 21, 2015
044096b
Change Call operands to be, well, Operands
nikomatsakis Oct 21, 2015
0a62158
Add helper methods that require tcx; these compute types of
nikomatsakis Oct 21, 2015
81ff2c2
Change adt case handling fn to be less tied to match
nikomatsakis Oct 21, 2015
877b93a
Move shifting code out of expr and into somewhere more accessible
nikomatsakis Oct 21, 2015
02017b3
New trans codepath that builds fn body from MIR instead.
nikomatsakis Oct 21, 2015
e84829d
Plumbing to omit allocas for temps when possible (currently unused)
nikomatsakis Nov 2, 2015
5b87225
Auto merge of #29509 - vadimcn:readme, r=alexcrichton
bors Nov 3, 2015
61e5b6d
Warn unused_assignments for arguments
sanxiyn Nov 3, 2015
7690ec8
libstd: implement From<&Path|PathBuf> for Cow<Path>
Ryman Nov 3, 2015
544b06d
Add a MIR visitor
nikomatsakis Nov 3, 2015
d9df16b
Fix #29533
Nov 3, 2015
f18c905
Auto merge of #29535 - Toby-S:patch-1, r=steveklabnik
bors Nov 3, 2015
bf7c920
Closes #24954
bltavares Nov 3, 2015
b0ca039
Mention what iterator terminators do with an empty iterator
shepmaster Nov 3, 2015
c143ae7
Auto merge of #29495 - meqif:fix_unindent_tabs, r=steveklabnik
bors Nov 3, 2015
6468292
Fix ICE with unresolved associated items in closures (fixes #28971)
Manishearth Oct 11, 2015
4aa1f59
Auto merge of #29515 - Manishearth:ice-itembody, r=eddyb
bors Nov 3, 2015
1805e5f
Allow indirect operands to be used as inputs for inline asm
Amanieu Nov 3, 2015
de11d2a
Auto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichton
bors Nov 3, 2015
cc830ef
libstd: implement PartialEq<Path> for PathBuf and Cow<Path>
Ryman Nov 3, 2015
f576215
libcollections: DRY up a PartialEq impl for String
Ryman Nov 3, 2015
54d85b4
Update compiler-rt
angelsl Oct 23, 2015
26db717
Correct incorrect assertion in VecDeque::wrap_copy
mystor Nov 3, 2015
59c5191
Add test for inline asm indirect memory operands
Amanieu Nov 3, 2015
ca04855
resolve: don't speculatively create freevars when resolving
Nov 3, 2015
2a7bd08
Auto merge of #29532 - Ryman:cow_path, r=alexcrichton
bors Nov 3, 2015
708e319
Auto merge of #29545 - mystor:vec-deque-test-panic, r=bluss
bors Nov 3, 2015
6252af9
save-analysis: emit the crate root
nrc Nov 3, 2015
6a5b263
Add (and use) an analysis to determine which temps can forgo an alloca.
nikomatsakis Nov 3, 2015
9c9f4be
correct typos
nikomatsakis Nov 3, 2015
b46c0fc
address nits from dotdash
nikomatsakis Nov 3, 2015
c340ea1
Auto merge of #29547 - arielb1:speculative-upvar, r=eddyb
bors Nov 4, 2015
e787863
remove unused import
nikomatsakis Nov 4, 2015
a216e84
Auto merge of #29217 - nikomatsakis:mir-trans, r=dotdash
bors Nov 4, 2015
9fe4e96
Build compiler-rt/builtins with MSVC
angelsl Oct 23, 2015
fb2129e
Remove the RefCell around freevars and freevars_seen in librustc_resolve
gereeter Nov 4, 2015
cc403b6
Auto merge of #29478 - angelsl:msvc2, r=alexcrichton
bors Nov 4, 2015
6fb2333
Fix #29542
Nov 4, 2015
1ad89e0
Auto merge of #29550 - nrc:save-root, r=alexcrichton
bors Nov 4, 2015
e9989d5
Add note about HashMap::capacity's bounds
steveklabnik Nov 4, 2015
0c93e72
Mention multiple impl blocks in TRPL
steveklabnik Nov 4, 2015
1be3f9f
Auto merge of #29200 - tshepang:rustfmt-path, r=aturon
bors Nov 4, 2015
a118aa2
Mention [T]::sort is stable in docs
steveklabnik Nov 4, 2015
14db074
Auto merge of #29528 - amitsaha:rust-inside-other-languages-minor, r=…
bors Nov 4, 2015
11e55e4
Auto merge of #29564 - gereeter:no-freevar-refcell, r=sanxiyn
bors Nov 4, 2015
8fa8684
Auto merge of #29519 - alexcrichton:fix-distcheck, r=nikomatsakis
bors Nov 4, 2015
4ee11cd
Auto merge of #29536 - sanxiyn:unused-assign-arg, r=alexcrichton
bors Nov 4, 2015
effcd29
Auto merge of #29543 - Amanieu:asm_mem_constraint, r=alexcrichton
bors Nov 4, 2015
6b1de25
More relnotes tweaks
brson Nov 5, 2015
8a69a00
Unwrap the RefCell around DefMap
gereeter Nov 4, 2015
f5781f1
Remove use of RefCell<DefMap> in check_static_recursion
gereeter Nov 4, 2015
1ca1874
Remove use of RefCell<DefMap> in resolve_lifetime
gereeter Nov 4, 2015
b1788ef
Remove use of RefCell<DefMap> in the simpler parts of pat_util
gereeter Nov 4, 2015
7839827
Auto merge of #29581 - gereeter:unwrap-defmap-refcell, r=nrc
bors Nov 5, 2015
72f3002
Rollup merge of #29416 - brson:relnotes, r=alexcrichton
steveklabnik Nov 5, 2015
dd53c83
Rollup merge of #29537 - bltavares:issue-24954, r=steveklabnik
steveklabnik Nov 5, 2015
268e360
Rollup merge of #29538 - steveklabnik:ch1_edits, r=brson
steveklabnik Nov 5, 2015
444e8d6
Rollup merge of #29539 - shepmaster:empty-iterator-docs, r=Gankro
steveklabnik Nov 5, 2015
92eb851
Rollup merge of #29567 - Toby-S:patch-1, r=steveklabnik
steveklabnik Nov 5, 2015
255b81d
Rollup merge of #29568 - steveklabnik:gh24591, r=apasel422
steveklabnik Nov 5, 2015
f04e77d
Rollup merge of #29571 - steveklabnik:gh29322, r=apasel422
steveklabnik Nov 5, 2015
05cbfa4
Rollup merge of #29579 - steveklabnik:gh27322, r=apasel422
steveklabnik Nov 5, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -68,7 +68,8 @@ Read ["Installing Rust"] from [The Book].
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
$ pacman -Sy pacman-mirrors

# Choose one based on platform:
# Choose one based on platform:
# *** see the note below ***
$ pacman -S mingw-w64-i686-toolchain
$ pacman -S mingw-w64-x86_64-toolchain

@@ -89,9 +90,12 @@ Read ["Installing Rust"] from [The Book].
```
> ***Note:*** gcc versions >= 5 currently have issues building LLVM on Windows
> resulting in a segmentation fault when building Rust. In order to avoid this
> it may be necessary to obtain an earlier version of gcc such as 4.9.x.
> Installers for earlier Windows builds of gcc are available at the
> [Mingw-Builds] project. For more information on this see issue #28260.
> it may be necessary to obtain an earlier version of gcc such as 4.9.x.
> Msys's `pacman` will install the latest version, so for the time being it is
> recommended to skip gcc toolchain installation step above and use [Mingw-Builds]
> project's installer instead. Be sure to add gcc `bin` directory to the path
> before running `configure`.
> For more information on this see issue #28260.

[Mingw-Builds]: http://sourceforge.net/projects/mingw-w64/

179 changes: 179 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,182 @@
Version 1.4.0 (2015-10-29)
============================

* ~1200 changes, numerous bugfixes

Highlights
----------

* Windows builds targeting the 64-bit MSVC ABI and linker (instead of
GNU) are now supported and recommended for use.

Breaking Changes
----------------

* [Several changes have been made to fix type soundness and improve
the behavior of associated types][sound]. See [RFC 1214]. Although
we have mostly introduced these changes as warnings this release, to
become errors next release, there are still some scenarios that will
see immediate breakage.
* [The `str::lines` and `BufRead::lines` iterators treat `\r\n` as
line breaks in addition to `\n`][crlf].
* [Loans of `'static` lifetime extend to the end of a function][stat].
* [`str::parse` no longer introduces avoidable rounding error when
parsing floating point numbers. Together with earlier changes to
float formatting/output, "round trips" like f.to_string().parse()
now preserve the value of f exactly. Additionally, leading plus
signs are now accepted][fp3].


Language
--------

* `use` statements that import multiple items [can now rename
them][i], as in `use foo::{bar as kitten, baz as puppy}`.
* [Binops work correctly on fat pointers][binfat].
* `pub extern crate`, which does not behave as expected, [issues a
warning][pec] until a better solution is found.

Libraries
---------

* [Many APIs were stabilized][stab]: `<Box<str>>::into_string`,
[`Arc::downgrade`], [`Arc::get_mut`], [`Arc::make_mut`],
[`Arc::try_unwrap`], [`Box::from_raw`], [`Box::into_raw`], [`CStr::to_str`],
[`CStr::to_string_lossy`], [`CString::from_raw`], [`CString::into_raw`],
[`IntoRawFd::into_raw_fd`], [`IntoRawFd`],
`IntoRawHandle::into_raw_handle`, `IntoRawHandle`,
`IntoRawSocket::into_raw_socket`, `IntoRawSocket`, [`Rc::downgrade`],
[`Rc::get_mut`], [`Rc::make_mut`], [`Rc::try_unwrap`], [`Result::expect`],
[`String::into_boxed_str`], [`TcpStream::read_timeout`],
[`TcpStream::set_read_timeout`], [`TcpStream::set_write_timeout`],
[`TcpStream::write_timeout`], [`UdpSocket::read_timeout`],
[`UdpSocket::set_read_timeout`], [`UdpSocket::set_write_timeout`],
[`UdpSocket::write_timeout`], `Vec::append`, `Vec::split_off`,
[`VecDeque::append`], [`VecDeque::retain`], [`VecDeque::split_off`],
[`rc::Weak::upgrade`], [`rc::Weak`], [`slice::Iter::as_slice`],
[`slice::IterMut::into_slice`], [`str::CharIndices::as_str`],
[`str::Chars::as_str`], [`str::split_at_mut`], [`str::split_at`],
[`sync::Weak::upgrade`], [`sync::Weak`], [`thread::park_timeout`],
[`thread::sleep`].
* [Some APIs were deprecated][dep]: `BTreeMap::with_b`,
`BTreeSet::with_b`, `Option::as_mut_slice`, `Option::as_slice`,
`Result::as_mut_slice`, `Result::as_slice`, `f32::from_str_radix`,
`f64::from_str_radix`.
* [Reverse-searching strings is faster with the 'two-way'
algorithm][s].
* [`std::io::copy` allows `?Sized` arguments][cc].
* The `Windows`, `Chunks`, and `ChunksMut` iterators over slices all
[override `count`, `nth` and `last` with an O(1)
implementation][it].
* [`Default` is implemented for arrays up to `[T; 32]`][d].
* [`IntoRawFd` has been added to the Unix-specific prelude,
`IntoRawSocket` and `IntoRawHandle` to the Windows-specific
prelude][pr].
* [`Extend<String>` and `FromIterator<String` are both implemented for
`String`][es].
* [`IntoIterator` is implemented for references to `Option` and
`Result`][into2].
* [`HashMap` and `HashSet` implement `Extend<&T>` where `T:
Copy`][ext] as part of [RFC 839]. This will cause type inferance
breakage in rare situations.
* [`BinaryHeap` implements `Debug`][bh2].
* [`Borrow` and `BorrowMut` are implemented for fixed-size
arrays][bm].
* [`extern fn`s with the "Rust" and "C" ABIs implement common
traits including `Eq`, `Ord`, `Debug`, `Hash`][fp].
* [String comparison is faster][faststr].
* `&mut T` where `T: std::fmt::Write` [also implements
`std::fmt::Write`][mutw].
* [A stable regression in `VecDeque::push_back` and other
capicity-altering methods that caused panics for zero-sized types
was fixed][vd].
* [Function pointers implement traits for up to 12 parameters][fp2].

Miscellaneous
-------------

* The compiler [no longer uses the 'morestack' feature to prevent
stack overflow][mm]. Instead it uses guard pages and stack
probes (though stack probes are not yet implemented on any platform
but Windows).
* [The compiler matches traits faster when projections are involved][p].
* The 'improper_ctypes' lint [no longer warns about use of `isize` and
`usize`][ffi].
* [Cargo now displays useful information about what its doing during
`cargo update`][cu].

[`Arc::downgrade`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.downgrade
[`Arc::make_mut`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.make_mut
[`Arc::get_mut`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.get_mut
[`Arc::try_unwrap`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.try_unwrap
[`Box::from_raw`]: http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.from_raw
[`Box::into_raw`]: http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.into_raw
[`CStr::to_str`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.to_str
[`CStr::to_string_lossy`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.to_string_lossy
[`CString::from_raw`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html#method.from_raw
[`CString::into_raw`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html#method.into_raw
[`IntoRawFd::into_raw_fd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.IntoRawFd.html#tymethod.into_raw_fd
[`IntoRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.IntoRawFd.html
[`Rc::downgrade`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.downgrade
[`Rc::get_mut`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.get_mut
[`Rc::make_mut`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.make_mut
[`Rc::try_unwrap`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.try_unwrap
[`Result::expect`]: http://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.expect
[`String::into_boxed_str`]: http://doc.rust-lang.org/nightly/collections/string/struct.String.html#method.into_boxed_str
[`TcpStream::read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read_timeout
[`TcpStream::set_read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_read_timeout
[`TcpStream::write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.write_timeout
[`TcpStream::set_write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_write_timeout
[`UdpSocket::read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read_timeout
[`UdpSocket::set_read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_read_timeout
[`UdpSocket::write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.write_timeout
[`UdpSocket::set_write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_write_timeout
[`VecDeque::append`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.append
[`VecDeque::retain`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.retain
[`VecDeque::split_off`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.split_off
[`rc::Weak::upgrade`]: http://doc.rust-lang.org/nightly/std/rc/struct.Weak.html#method.upgrade
[`rc::Weak`]: http://doc.rust-lang.org/nightly/std/rc/struct.Weak.html
[`slice::Iter::as_slice`]: http://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#method.as_slice
[`slice::IterMut::into_slice`]: http://doc.rust-lang.org/nightly/std/slice/struct.IterMut.html#method.into_slice
[`str::CharIndices::as_str`]: http://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.as_str
[`str::Chars::as_str`]: http://doc.rust-lang.org/nightly/std/str/struct.Chars.html#method.as_str
[`str::split_at_mut`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_mut
[`str::split_at`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at
[`sync::Weak::upgrade`]: http://doc.rust-lang.org/nightly/std/sync/struct.Weak.html#method.upgrade
[`sync::Weak`]: http://doc.rust-lang.org/nightly/std/sync/struct.Weak.html
[`thread::park_timeout`]: http://doc.rust-lang.org/nightly/std/thread/fn.park_timeout.html
[`thread::sleep`]: http://doc.rust-lang.org/nightly/std/thread/fn.sleep.html
[bh2]: https://github.com/rust-lang/rust/pull/28156
[binfat]: https://github.com/rust-lang/rust/pull/28270
[bm]: https://github.com/rust-lang/rust/pull/28197
[cc]: https://github.com/rust-lang/rust/pull/27531
[crlf]: https://github.com/rust-lang/rust/pull/28034
[cu]: https://github.com/rust-lang/cargo/pull/1931
[d]: https://github.com/rust-lang/rust/pull/27825
[dep]: https://github.com/rust-lang/rust/pull/28339
[es]: https://github.com/rust-lang/rust/pull/27956
[ext]: https://github.com/rust-lang/rust/pull/28094
[faststr]: https://github.com/rust-lang/rust/pull/28338
[ffi]: https://github.com/rust-lang/rust/pull/28779
[fp]: https://github.com/rust-lang/rust/pull/28268
[fp2]: https://github.com/rust-lang/rust/pull/28560
[fp3]: https://github.com/rust-lang/rust/pull/27307
[i]: https://github.com/rust-lang/rust/pull/27451
[into2]: https://github.com/rust-lang/rust/pull/28039
[it]: https://github.com/rust-lang/rust/pull/27652
[mm]: https://github.com/rust-lang/rust/pull/27338
[mutw]: https://github.com/rust-lang/rust/pull/28368
[sound]: https://github.com/rust-lang/rust/pull/27641
[p]: https://github.com/rust-lang/rust/pull/27866
[pec]: https://github.com/rust-lang/rust/pull/28486
[pr]: https://github.com/rust-lang/rust/pull/27896
[RFC 839]: https://github.com/rust-lang/rfcs/blob/master/text/0839-embrace-extend-extinguish.md
[RFC 1214]: https://github.com/rust-lang/rfcs/blob/master/text/1214-projections-lifetimes-and-wf.md
[s]: https://github.com/rust-lang/rust/pull/27474
[stab]: https://github.com/rust-lang/rust/pull/28339
[stat]: https://github.com/rust-lang/rust/pull/28321
[vd]: https://github.com/rust-lang/rust/pull/28494

Version 1.3.0 (2015-09-17)
==============================

46 changes: 27 additions & 19 deletions configure
Original file line number Diff line number Diff line change
@@ -1484,25 +1484,9 @@ do
done
fi

if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ]
# We need the generator later on for compiler-rt even if LLVM's not built
if [ ${is_msvc} -ne 0 ]
then
msg "configuring LLVM for $t with cmake"

CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF"
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
else
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
fi
if [ -z "$CFG_ENABLE_LLVM_ASSERTIONS" ]
then
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=OFF"
else
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON"
fi

msg "configuring LLVM with:"
msg "$CMAKE_ARGS"
case "$CFG_MSVC_ROOT" in
*14.0*)
generator="Visual Studio 14 2015"
@@ -1524,8 +1508,32 @@ do
err "can only build LLVM for x86 platforms"
;;
esac
CFG_CMAKE_GENERATOR=$generator
putvar CFG_CMAKE_GENERATOR
fi

if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ]
then
msg "configuring LLVM for $t with cmake"

CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF"
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
else
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
fi
if [ -z "$CFG_ENABLE_LLVM_ASSERTIONS" ]
then
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=OFF"
else
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON"
fi

msg "configuring LLVM with:"
msg "$CMAKE_ARGS"

(cd $LLVM_BUILD_DIR && "$CFG_CMAKE" $CFG_LLVM_SRC_DIR \
-G "$generator" \
-G "$CFG_CMAKE_GENERATOR" \
$CMAKE_ARGS)
need_ok "LLVM cmake configure failed"
fi
2 changes: 1 addition & 1 deletion mk/crates.mk
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ DEPS_rustc_mir := rustc rustc_front syntax
DEPS_rustc_resolve := rustc rustc_front log syntax
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
DEPS_rustc_privacy := rustc rustc_front log syntax
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics

1 change: 1 addition & 0 deletions mk/dist.mk
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ PKG_FILES := \
libcoretest \
libbacktrace \
rt \
rtstartup \
rustllvm \
snapshots.txt \
rust-installer \
39 changes: 24 additions & 15 deletions mk/rt.mk
Original file line number Diff line number Diff line change
@@ -216,22 +216,31 @@ COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt

# Note that on MSVC-targeting builds we hardwire CC/AR to gcc/ar even though
# we're targeting MSVC. This is because although compiler-rt has a CMake build
# config I can't actually figure out how to use it, so I'm not sure how to use
# cl.exe to build the objects. Additionally, the compiler-rt library when built
# with gcc has the same ABI as cl.exe, so they're largely compatible
COMPRT_CC_$(1) := $$(CC_$(1))
COMPRT_AR_$(1) := $$(AR_$(1))
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1))
ifeq ($$(findstring msvc,$(1)),msvc)
COMPRT_CC_$(1) := gcc
COMPRT_AR_$(1) := ar
ifeq ($$(findstring i686,$(1)),i686)
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m32
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
@$$(call E, cmake: compiler-rt)
$$(Q)cd "$$(COMPRT_BUILD_DIR_$(1))"; $$(CFG_CMAKE) "$(S)src/compiler-rt" \
-DCMAKE_BUILD_TYPE=$$(LLVM_BUILD_CONFIG_MODE) \
-DLLVM_CONFIG_PATH=$$(LLVM_CONFIG_$(1)) \
-G"$$(CFG_CMAKE_GENERATOR)"
$$(Q)$$(CFG_CMAKE) --build "$$(COMPRT_BUILD_DIR_$(1))" \
--target lib/builtins/builtins \
--config $$(LLVM_BUILD_CONFIG_MODE) \
-- //v:m //nologo
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/lib/windows/$$(LLVM_BUILD_CONFIG_MODE)/clang_rt.builtins-$$(HOST_$(1)).lib $$@
else
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m64
endif
COMPRT_CC_$(1) := $$(CC_$(1))
COMPRT_AR_$(1) := $$(AR_$(1))
# We chomp -Werror here because GCC warns about the type signature of
# builtins not matching its own and the build fails. It's a bit hacky,
# but what can we do, we're building libclang-rt using GCC ......
COMPRT_CFLAGS_$(1) := $$(subst -Werror,,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99

# FreeBSD Clang's packaging is problematic; it doesn't copy unwind.h to
# the standard include directory. This should really be in our changes to
# compiler-rt, but we override the CFLAGS here so there isn't much choice
ifeq ($$(findstring freebsd,$(1)),freebsd)
COMPRT_CFLAGS_$(1) += -I/usr/include/c++/v1
endif

$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
@@ -246,7 +255,7 @@ $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
TargetTriple=$(1) \
triple-builtins
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$@

endif
################################################################################
# libbacktrace
#
2 changes: 1 addition & 1 deletion src/compiler-rt
Submodule compiler-rt updated 1585 files
15 changes: 6 additions & 9 deletions src/doc/trpl/error-handling.md
Original file line number Diff line number Diff line change
@@ -1605,14 +1605,11 @@ arguments.

## Writing the logic

We're all different in how we write code, but error handling is
usually the last thing we want to think about. This isn't very good
practice for good design, but it can be useful for rapidly
prototyping. In our case, because Rust forces us to be explicit about
error handling, it will also make it obvious what parts of our program
can cause errors. Why? Because Rust will make us call `unwrap`! This
can give us a nice bird's eye view of how we need to approach error
handling.
We all write code differently, but error handling is usually the last thing we
want to think about. This isn't great for the overall design of a program, but
it can be useful for rapid prototyping. Because Rust forces us to be explicit
about error handling (by making us call `unwrap`), it is easy to see which
parts of our program can cause errors.

In this case study, the logic is really simple. All we need to do is parse the
CSV data given to us and print out a field in matching rows. Let's do it. (Make
@@ -2074,7 +2071,7 @@ tweak the case analysis in `main`:
```rust,ignore
match search(&args.arg_data_path, &args.arg_city) {
Err(CliError::NotFound) if args.flag_quiet => process::exit(1),
Err(err) => fatal!("{}", err),
Err(err) => panic!("{}", err),
Ok(pops) => for pop in pops {
println!("{}, {}: {:?}", pop.city, pop.country, pop.count);
}
Loading