Commit Graph

49561 Commits

Author SHA1 Message Date
Manish Goregaokar
11e24a21cd Rollup merge of #30990 - msvbg:msvbg-clang-7x, r=alexcrichton
I'm using clang 7.2 which works just fine to compile Rust with, but was disallowed.
2016-01-19 04:08:59 +05:30
Manish Goregaokar
49474313fd Rollup merge of #30988 - bluss:doc-space-t-bound, r=apasel422
Fix spacing style of `T: Bound` in docs

The space between `T` and `Bound` is the typical style used in code and
produced by rustdoc's rendering. Fixed first in Reflect's docs and then
I fixed all occurrences in docs I could find.
2016-01-19 04:08:59 +05:30
Manish Goregaokar
f0e8594bce Rollup merge of #30986 - sliz1:book-macro, r=alexcrichton
Sorry for nitpicking, but I think the example of the expanded macro should be wrapped inside a pair of curly braces to match the macro definition. Also the current example triggers a variable redefinition error.
2016-01-19 04:08:58 +05:30
Manish Goregaokar
f791395525 Rollup merge of #30981 - boblehest:tmp, r=alexcrichton
Original: #30968 (My first PR was targeting the wrong branch)
2016-01-19 04:08:58 +05:30
bors
08886499cf Auto merge of #31000 - bluss:efficient-clone-from-slice, r=dotdash
Restore indexed formulation of clone_from_slice

For good codegen here, we need a lock step iteration where the loop
bound is only checked once per iteration; .zip() unfortunately does not
optimize this way.

If we use a counted loop, and make sure that llvm sees that the bounds
check condition is the same as the loop bound condition, the bounds
checks are optimized out. For this reason we need to slice `from`
(apparently) redundantly.

This commit restores the old formulation of clone_from_slice. In this
shape, clone_from_slice will again optimize into calling memcpy where possible
(for example for &[u8] or &[i32]).
2016-01-18 18:35:48 +00:00
Martin
da56967a3e Enumerate acceptable clang versions 2016-01-18 15:57:57 +01:00
Ulrik Sverdrup
6a7bc47a8f core: Restore indexed formulation of clone_from_slice
For good codegen here, we need a lock step iteration where the loop
bound is only checked once per iteration; .zip() unfortunately does not
optimize this way.

If we use a counted loop, and make sure that llvm sees that the bounds
check condition is the same as the loop bound condition, the bounds
checks are optimized out. For this reason we need to slice `from`
(apparently) redundantly.

This commit restores the old formulation of clone_from_slice. In this
shape, clone_from_slice will again optimize into calling memcpy where possible
(for example for &[u8] or &[i32]).
2016-01-18 15:28:00 +01:00
bors
a09a604d36 Auto merge of #30956 - KiChjang:move-tests-to-libcollectionstest, r=bluss
Encountered while I was trying to work on #28518. Please let me know whether this is a correct move.
2016-01-18 13:28:57 +00:00
bors
50a8333300 Auto merge of #30996 - oli-obk:fix/load_range_assert, r=nagisa
it makes no sense here, accidentally introduced in #30931

r? @dotdash
2016-01-18 10:34:59 +00:00
Oliver Schneider
c02ba1618d revert using trans::Disr in LoadRangeAssert
it makes no sense here, accidentally introduced in #30931
2016-01-18 11:30:52 +01:00
bors
9d21acaf9b Auto merge of #30953 - KalitaAlexey:17823-get-rid-of-duplicate-error, r=nrc 2016-01-18 06:29:59 +00:00
kalita.alexey
8a41eb55d8 simplify E0308 message for primitive types 2016-01-18 08:59:44 +04:00
Martin
2f1703d161 Allow clang 7.x in configuration
I'm using clang 7.2 which works just fine to compile Rust with, but was disallowed.
2016-01-18 04:44:35 +01:00
bors
257d3244f0 Auto merge of #30980 - gereeter:fix-btree-iter-variance, r=apasel422
This takes the approach of making `NodeRef` universally covariant.

 Fixes #30979.
2016-01-18 02:55:09 +00:00
bors
d0bac3f147 Auto merge of #30973 - SimonSapin:patch-16, r=alexcrichton
I don’t understand what the "flow information" of an IPv6 address is, but it looks separate from the scope ID. This was probably a copy/paste error.
2016-01-18 00:58:21 +00:00
bors
4ab9a2d1d6 Auto merge of #30964 - GuillaumeGomez:patch-5, r=Manishearth
r? @Manishearth
2016-01-17 22:51:11 +00:00
Ulrik Sverdrup
f4fac9b0fa Fix spacing style of T: Bound in docs
The space between `T` and `Bound` is the typical style used in code and
produced by rustdoc's rendering. Fixed first in Reflect's docs and then
I fixed all occurrences in docs I could find.
2016-01-17 23:44:33 +01:00
Stephen (Ziyun) Li
8a829704cb Fix C macro example 2016-01-17 14:56:23 -05:00
Jonathan S
7a9c4a4941 Expand the macro in variance-btree-invariant-types.rs to make compiletest recognize that it should error 2016-01-17 11:26:11 -06:00
bors
f682639ce6 Auto merge of #30978 - nikomatsakis:fulfillment-tree-add-fixme, r=aturon
r? @aturon
2016-01-17 16:10:27 +00:00
Jonathan S
fae75c93b3 Fix and test variance of BTreeMap and its companion structs. 2016-01-17 10:08:22 -06:00
Keith Yeung
706e9f5eba Move zst test from libcollections to src/test 2016-01-17 09:21:25 -05:00
Guillaume Gomez
f15512e7f9 Add E0507 error explanation 2016-01-17 14:51:41 +01:00
bors
bff52927f5 Auto merge of #30975 - Manishearth:rollup, r=Manishearth
- Successful merges: #30938, #30940, #30943, #30949, #30952, #30957, #30959
- Failed merges:
2016-01-17 12:23:57 +00:00
Niko Matsakis
fcb3d1e729 add fixme number into code 2016-01-17 07:15:19 -05:00
Manish Goregaokar
00a4eeadaf Rollup merge of #30959 - bluss:bench-resolution, r=Gankro
test: Increase resolution of MB/s stat for bench runs close to 1 second

MB/s was based on the number of iterations performed in a second, when
the iteration duration nears 1 second (1e9 ns), the resolution of the
MB/s stat decreases.
2016-01-17 17:25:48 +05:30
Manish Goregaokar
3ba057b0b1 Rollup merge of #30957 - GuillaumeGomez:patch-3, r=apasel422
r? @Manishearth
2016-01-17 17:25:48 +05:30
Manish Goregaokar
dbca989721 Rollup merge of #30952 - jonastepe:nomicon_vec_zst_code_fix, r=Gankro
* Moved semicolon to the right place in the `let` statement in the ZST section.
* Fixed the missing ZST additions for `RawValIter<T>` from this section in the final code section.
2016-01-17 17:25:48 +05:30
Manish Goregaokar
a993669a40 Rollup merge of #30949 - MrMormon:patch-1, r=alexcrichton
‌ ‌▲
▲‌ ▲
2016-01-17 17:25:48 +05:30
Manish Goregaokar
80e21d1958 Rollup merge of #30943 - alexcrichton:stabilize-1.7, r=aturon
This commit stabilizes and deprecates the FCP (final comment period) APIs for
the upcoming 1.7 beta release. The specific APIs which changed were:

Stabilized

* `Path::strip_prefix` (renamed from `relative_from`)
* `path::StripPrefixError` (new error type returned from `strip_prefix`)
* `Ipv4Addr::is_loopback`
* `Ipv4Addr::is_private`
* `Ipv4Addr::is_link_local`
* `Ipv4Addr::is_multicast`
* `Ipv4Addr::is_broadcast`
* `Ipv4Addr::is_documentation`
* `Ipv6Addr::is_unspecified`
* `Ipv6Addr::is_loopback`
* `Ipv6Addr::is_unique_local`
* `Ipv6Addr::is_multicast`
* `Vec::as_slice`
* `Vec::as_mut_slice`
* `String::as_str`
* `String::as_mut_str`
* `<[T]>::clone_from_slice` - the `usize` return value is removed
* `<[T]>::sort_by_key`
* `i32::checked_rem` (and other signed types)
* `i32::checked_neg` (and other signed types)
* `i32::checked_shl` (and other signed types)
* `i32::checked_shr` (and other signed types)
* `i32::saturating_mul` (and other signed types)
* `i32::overflowing_add` (and other signed types)
* `i32::overflowing_sub` (and other signed types)
* `i32::overflowing_mul` (and other signed types)
* `i32::overflowing_div` (and other signed types)
* `i32::overflowing_rem` (and other signed types)
* `i32::overflowing_neg` (and other signed types)
* `i32::overflowing_shl` (and other signed types)
* `i32::overflowing_shr` (and other signed types)
* `u32::checked_rem` (and other unsigned types)
* `u32::checked_shl` (and other unsigned types)
* `u32::saturating_mul` (and other unsigned types)
* `u32::overflowing_add` (and other unsigned types)
* `u32::overflowing_sub` (and other unsigned types)
* `u32::overflowing_mul` (and other unsigned types)
* `u32::overflowing_div` (and other unsigned types)
* `u32::overflowing_rem` (and other unsigned types)
* `u32::overflowing_neg` (and other unsigned types)
* `u32::overflowing_shl` (and other unsigned types)
* `u32::overflowing_shr` (and other unsigned types)
* `ffi::IntoStringError`
* `CString::into_string`
* `CString::into_bytes`
* `CString::into_bytes_with_nul`
* `From<CString> for Vec<u8>`
* `From<CString> for Vec<u8>`
* `IntoStringError::into_cstring`
* `IntoStringError::utf8_error`
* `Error for IntoStringError`

Deprecated

* `Path::relative_from` - renamed to `strip_prefix`
* `Path::prefix` - use `components().next()` instead
* `os::unix::fs` constants - moved to the `libc` crate
* `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize
* `IntoCow` - conflicts with `Into` and may come back later
* `i32::{BITS, BYTES}` (and other integers) - not pulling their weight
* `DebugTuple::formatter` - will be removed
* `sync::Semaphore` - not used enough and confused with system semaphores

Closes #23284
cc #27709 (still lots more methods though)
Closes #27712
Closes #27722
Closes #27728
Closes #27735
Closes #27729
Closes #27755
Closes #27782
Closes #27798
2016-01-17 17:25:47 +05:30
Manish Goregaokar
fbf3e96e56 Rollup merge of #30940 - tshepang:extraneous-playpen-whitespace, r=steveklabnik 2016-01-17 17:25:47 +05:30
Manish Goregaokar
48a7651073 Rollup merge of #30938 - dotdash:zst_void, r=eddyb
The only way to get a value for a zero-sized type is `undef`, so
there's really no point in actually having a return type other than
void for such types. Also, while the comment in return_type_is_void
mentioned something about aiding C ABI support, @eddyb correctly
pointed out on IRC that there is no such thing as a zero-sized type in
C. And even with clang, which allows empty structs, those get
translated as void return types as well.

Fixes #28766
2016-01-17 17:25:47 +05:30
bors
0b524edb04 Auto merge of #30931 - oli-obk:trans_disr_newtype, r=arielb1
This is groundwork for #30587 (typestrong constant integrals), but imo it's a change that in itself is good, too, since we don't just juggle `u64`s around anymore.

`ty::Disr` will be changed to a `ConstInt` in #30587
2016-01-17 10:31:47 +00:00
Simon Sapin
f09bcc10c6 Fix SocketAddrV6::flowinfo docs
I don’t understand what the "flow information" of an IPv6 address is, but it looks separate from the scope ID. This was probably a copy/paste error.
2016-01-17 10:54:38 +01:00
bors
87608746f0 Auto merge of #30928 - sfackler:any-unsized, r=aturon
This is a bit weird since unsized types can't be used in trait objects,
but Any is *also* used as pure marker trait since Reflect isn't stable.
There are many cases (e.g. TypeMap) where all you need is a TypeId.

r? @aturon
2016-01-17 08:40:01 +00:00
bors
88463364bf Auto merge of #30426 - gereeter:btree-rewrite, r=Gankro
Despite being over 700 lines shorter, this implementation should use less memory than the previous one and is faster on at least insertions and iteration, the latter improving approximately 5x.

Technically a [breaking-change] due to removal of deprecated functions.

cc @apasel422 @Gankro @goyox86

Fixes #27865.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/rust-lang/rust/30426)
<!-- Reviewable:end -->
2016-01-17 06:47:55 +00:00
Jonathan S
be4128d148 BTreeMap: Add a test for clone 2016-01-16 22:55:56 -06:00
Jonathan S
cd639d8927 Rewrite BTreeMap to use parent pointers. 2016-01-16 21:40:03 -06:00
Jørn Lode
46c23e8f03 Fix typo in std::fmt docs 2016-01-17 04:36:03 +01:00
bors
077f4eeb84 Auto merge of #30567 - steffengy:master, r=alexcrichton
Add support to use functions exported using vectorcall.
This essentially only allows to pass a new LLVM calling convention
from rust to LLVM.

```rust
extern "vectorcall" fn abc(param: c_void);
```

references
----
http://llvm.org/docs/doxygen/html/CallingConv_8h_source.html
https://msdn.microsoft.com/en-us/library/dn375768.aspx
2016-01-16 23:30:30 +00:00
Ulrik Sverdrup
627829bde8 test: Increase resolution of MB/s stat for bench runs close to 1 second
MB/s was based on the number of iterations performed in a second, when
the iteration duration nears 1 second (1e9 ns), the resolution of the
MB/s stat decreases.
2016-01-16 22:58:00 +01:00
bors
1f516dc7c1 Auto merge of #30624 - Ticki:specialization, r=alexcrichton
Part of #30520. Completes #24214
2016-01-16 21:38:39 +00:00
Jonas Tepe
5c62178658 Fixed indent from tabs to spaces 2016-01-16 20:51:55 +01:00
Alex Crichton
9a4f43b9b6 std: Stabilize APIs for the 1.7 release
This commit stabilizes and deprecates the FCP (final comment period) APIs for
the upcoming 1.7 beta release. The specific APIs which changed were:

Stabilized

* `Path::strip_prefix` (renamed from `relative_from`)
* `path::StripPrefixError` (new error type returned from `strip_prefix`)
* `Ipv4Addr::is_loopback`
* `Ipv4Addr::is_private`
* `Ipv4Addr::is_link_local`
* `Ipv4Addr::is_multicast`
* `Ipv4Addr::is_broadcast`
* `Ipv4Addr::is_documentation`
* `Ipv6Addr::is_unspecified`
* `Ipv6Addr::is_loopback`
* `Ipv6Addr::is_unique_local`
* `Ipv6Addr::is_multicast`
* `Vec::as_slice`
* `Vec::as_mut_slice`
* `String::as_str`
* `String::as_mut_str`
* `<[T]>::clone_from_slice` - the `usize` return value is removed
* `<[T]>::sort_by_key`
* `i32::checked_rem` (and other signed types)
* `i32::checked_neg` (and other signed types)
* `i32::checked_shl` (and other signed types)
* `i32::checked_shr` (and other signed types)
* `i32::saturating_mul` (and other signed types)
* `i32::overflowing_add` (and other signed types)
* `i32::overflowing_sub` (and other signed types)
* `i32::overflowing_mul` (and other signed types)
* `i32::overflowing_div` (and other signed types)
* `i32::overflowing_rem` (and other signed types)
* `i32::overflowing_neg` (and other signed types)
* `i32::overflowing_shl` (and other signed types)
* `i32::overflowing_shr` (and other signed types)
* `u32::checked_rem` (and other unsigned types)
* `u32::checked_neg` (and other unsigned types)
* `u32::checked_shl` (and other unsigned types)
* `u32::saturating_mul` (and other unsigned types)
* `u32::overflowing_add` (and other unsigned types)
* `u32::overflowing_sub` (and other unsigned types)
* `u32::overflowing_mul` (and other unsigned types)
* `u32::overflowing_div` (and other unsigned types)
* `u32::overflowing_rem` (and other unsigned types)
* `u32::overflowing_neg` (and other unsigned types)
* `u32::overflowing_shl` (and other unsigned types)
* `u32::overflowing_shr` (and other unsigned types)
* `ffi::IntoStringError`
* `CString::into_string`
* `CString::into_bytes`
* `CString::into_bytes_with_nul`
* `From<CString> for Vec<u8>`
* `From<CString> for Vec<u8>`
* `IntoStringError::into_cstring`
* `IntoStringError::utf8_error`
* `Error for IntoStringError`

Deprecated

* `Path::relative_from` - renamed to `strip_prefix`
* `Path::prefix` - use `components().next()` instead
* `os::unix::fs` constants - moved to the `libc` crate
* `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize
* `IntoCow` - conflicts with `Into` and may come back later
* `i32::{BITS, BYTES}` (and other integers) - not pulling their weight
* `DebugTuple::formatter` - will be removed
* `sync::Semaphore` - not used enough and confused with system semaphores

Closes #23284
cc #27709 (still lots more methods though)
Closes #27712
Closes #27722
Closes #27728
Closes #27735
Closes #27729
Closes #27755
Closes #27782
Closes #27798
2016-01-16 11:03:10 -08:00
bors
05aeeb314d Auto merge of #30934 - oli-obk:simplify_const_eval, r=alexcrichton
the `None` and the `DefVariant` paths were unused anyway.
2016-01-16 17:57:01 +00:00
bors
c14b615534 Auto merge of #30533 - nikomatsakis:fulfillment-tree, r=aturon
This PR introduces an `ObligationForest` data structure that the fulfillment context can use to track what's going on, instead of the current flat vector. This enables a number of improvements:

1. transactional support, at least for pushing new obligations
2. remove the "errors will be reported" hack -- instead, we only add types to the global cache once their entire subtree has been proven safe. Before, we never knew when this point was reached because we didn't track the subtree.
   - this in turn allows us to limit coinductive reasoning to structural traits, which sidesteps #29859
3. keeping the backtrace should allow for an improved error message, where we give the user full context
    - we can also remove chained obligation causes

This PR is not 100% complete. In particular:

- [x] Currently, types that embed themselves like `struct Foo { f: Foo }` give an overflow when evaluating whether `Foo: Sized`. This is not a very user-friendly error message, and this is a common beginner error. I plan to special-case this scenario, I think.
- [x] I should do some perf. measurements. (Update: 2% regression.)
- [x] More tests targeting #29859
- [ ] The transactional support is not fully integrated, though that should be easy enough.
- [ ] The error messages are not taking advantage of the backtrace.

I'd certainly like to do 1 through 3 before landing, but 4 and 5 could come as separate PRs.

r? @aturon // good way to learn more about this part of the trait system
f? @arielb1 // already knows this part of the trait system :)
2016-01-16 16:03:22 +00:00
Guillaume Gomez
864cd8d58e Fix typo 2016-01-16 16:34:51 +01:00
Oliver 'ker' Schneider
6fef118bc0 use a newtype for the variant discriminant instead of u64 2016-01-16 16:03:09 +01:00
Niko Matsakis
4fbb71fda1 Add regression tests for #29859. However #29859 is not fully fixed. 2016-01-16 09:58:09 -05:00
bors
dda25f2221 Auto merge of #30946 - antonblanchard:powerpc64_merge2, r=alexcrichton
This brings in powerpc64 and powerpc64le support recently added.
2016-01-16 14:11:29 +00:00