Commit Graph

54179 Commits

Author SHA1 Message Date
Guillaume Gomez
ee0821a371 Rollup merge of #33891 - polachok:faster-ipv4-cmp, r=bluss
Make Ipv4Addr cmp() faster

Closes #33885
2016-05-27 10:50:05 +02:00
Guillaume Gomez
6636dcc2ca Rollup merge of #33874 - Byron:patch-1, r=alexcrichton
Add `make tips` as useful make target

By accident, I found the `make tips` target, which helped me to gain more insight on how to work with the system more quickly.
2016-05-27 10:50:05 +02:00
Guillaume Gomez
c04e838eb5 Rollup merge of #33870 - jseyfried:ice-issue-33569, r=pnkfelix
Fix ICE on parsing a bad metavariable in a macro definition

Fixes #33569, fixes #33728.
r? @pnkfelix
2016-05-27 10:50:04 +02:00
Guillaume Gomez
43b430ed35 Rollup merge of #33866 - GuillaumeGomez:err-codes, r=jonathandturner
Add new error code tests

r? @steveklabnik
2016-05-27 10:50:04 +02:00
Guillaume Gomez
4ffebe72bf Rollup merge of #33865 - GuillaumeGomez:E0084, r=jonathandturner
Improve E0084 error explanation

r? @Manishearth

cc @steveklabnik
2016-05-27 10:50:03 +02:00
Guillaume Gomez
caa732a725 Rollup merge of #33858 - liigo:patch-7, r=GuillaumeGomez
Point out the clone operation in summary line docs of `Vec::extend_from_slice`
2016-05-27 10:50:03 +02:00
Guillaume Gomez
98e768fa84 Rollup merge of #33829 - GuillaumeGomez:stability-css, r=steveklabnik
Fix invalid background color in stability elements

r? @steveklabnik
2016-05-27 10:50:03 +02:00
Guillaume Gomez
967c3880d8 Rollup merge of #33815 - carols10cents:trait-documentation-clarifications, r=steveklabnik
Trait documentation clarifications

Hi! I've felt a bit of friction lately in figuring out how to write custom implementations of the `derive`able traits, so I decided to add to the docs :)

The docs for `Copy` are already excellent-- clear, useful sections that I only reordered a bit-- they're now:

* General explanation
* When can my type be `Copy`?
* When can my type _not_ be `Copy`?
* When should my type be `Copy`?
* Derivable
* How can I implement `Copy`?

I didn't add all these sections for all the traits, but I did make sure all the derivable traits had a consistent "Derivable" section that explained what the derived implementation does and a "How can I implement" section that has an example.

Please check me for correctness-- I tried to do research to make sure I was saying accurate things but I'm still learning! ❤️ I'd also love suggestions on information to add that is still missing-- I think these traits are important and deserve to have awesome docs!
2016-05-27 10:50:03 +02:00
Guillaume Gomez
575149561e Rollup merge of #33753 - mmatyas:armtestfix, r=alexcrichton
Fix `asm-misplaced-option` on ARM/AArch64

This fixes rust-lang/rust#33737. Of course, since we don't run `make check` for ARM cross builds, you probably won't notice it.
2016-05-27 10:50:02 +02:00
bors
36d5dc7c9b Auto merge of #33864 - Manishearth:breaking-batch, r=Manishearth
Batch up libsyntax breaking changes

cc https://github.com/rust-lang/rust/issues/31645
2016-05-26 22:46:08 -07:00
Manish Goregaokar
63dfbdbc1b Rollup merge of #33839 - kamalmarhubi:codemape-get-filemap-option, r=nmatsakis
This is more idiomatic, putting the caller in charge of whether or not
to panic.
2016-05-27 10:02:45 +05:30
Manish Goregaokar
7905452f08 Rollup merge of #33644 - petrochenkov:selfast, r=nrc
The AST part of https://github.com/rust-lang/rust/pull/33505.
https://github.com/rust-lang/rust/pull/33505 isn't landed yet, so this PR is based on top of it.

r? @nrc

plugin-[breaking-change] cc #31645 @Manishearth
2016-05-27 09:57:11 +05:30
Manish Goregaokar
35785712cd Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakis
cc https://github.com/rust-lang/rust/issues/33627
r? @nikomatsakis

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-27 09:57:00 +05:30
Manish Goregaokar
a70880fea9 Rollup merge of #33351 - birkenfeld:loop-label-spans, r=pnkfelix
This makes the \"shadowing labels\" warning *not* print the entire loop as a span, but only the lifetime.

Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
2016-05-27 09:56:47 +05:30
Srinivas Reddy Thatiparthy
38bbb60c8c rustfmt on liblog 2016-05-27 08:06:17 +05:30
Simonas Kazlauskas
f18118702f Rewrite variadic-ffi pass to use test helper
The sprintf used in this test previously isn’t available on some versions of MSVC.

Fixes #32305
2016-05-27 03:05:52 +03:00
Jeffrey Seyfried
0558df24af Refactor expand_expr 2016-05-27 00:01:04 +00:00
Jeffrey Seyfried
1aa34e0b5f Strip unconfigured items during macro expansion 2016-05-27 00:01:04 +00:00
Jeffrey Seyfried
25c733360b Update spans' expn_id during the marking fold 2016-05-27 00:01:04 +00:00
Jeffrey Seyfried
3636ce7875 Test that a feature gated cfg variable in a cfg_attr on an unconfigured item is allowed 2016-05-27 00:01:04 +00:00
Jeffrey Seyfried
15d5074a34 Process cfg_attr attributes on non-optional expressions 2016-05-27 00:01:04 +00:00
Jeffrey Seyfried
d3a0e1783c Move cfg_attr processing and stmt/expr attribute gated feature checking into StripUnconfigured 2016-05-26 23:54:05 +00:00
Jeffrey Seyfried
a306f85df9 Implement CfgFolder directly instead of passing a closure to strip_items 2016-05-26 23:23:11 +00:00
Jeffrey Seyfried
f3e80760e9 Refactor CfgFolder::in_cfg -> CfgFolder::configure 2016-05-26 23:23:09 +00:00
Jeffrey Seyfried
79854395ca Introduce CfgFolder trait 2016-05-26 23:23:07 +00:00
Jeffrey Seyfried
7a42e46eec Refactor the syntax::config::fold_* functions into methods 2016-05-26 23:23:06 +00:00
Jeffrey Seyfried
29c105964b Add and use HasAttrs trait 2016-05-26 23:23:01 +00:00
Guillaume Gomez
abe9961283 * Fix compile_fail tag (in some cases, it compiled whereas it wasn't expected to and was still considered 'ok')
* Fix error explanations tests/tags
2016-05-27 00:39:57 +02:00
Vadim Petrochenkov
0ca9bf3940 Fix overflow in type checking of tuple patterns 2016-05-26 23:43:02 +03:00
Alexander Polyakov
7ba0016030 Make Ipv4Addr cmp() faster 2016-05-26 22:38:33 +03:00
bors
97e3a2401e Auto merge of #33783 - michaelwoerister:collector-cleanup-2, r=nikomatsakis
trans::collector: Remove some redundant calls to erase_regions().

r? @Aatch
2016-05-26 11:28:45 -07:00
Sean McArthur
6af17e69ff core: check pointer equality when comparing byte slices 2016-05-26 11:23:42 -07:00
Leo Testard
864b3c8017 Reject a LHS formed of a single sequence TT during macro_rules! checking.
This was already rejected during expansion. Encountering malformed LHS or RHS during expansion is now considered a bug.
2016-05-26 19:05:44 +02:00
bors
dc91467db0 Auto merge of #33766 - jseyfried:cleanup_expansion, r=nrc
Cleanup macro expansion and improve diagnostics

Cleanup macro expansion and improve diagnostics. Fixes #33709.
r? @nrc
2016-05-26 08:32:21 -07:00
bors
3c795e08d6 Auto merge of #33872 - nagisa:undef-is-llvm-for-sigsegv, r=eddyb
Fix handling of FFI arguments

r? @eddyb @nikomatsakis or whoever else.

cc @alexcrichton @rust-lang/core

The strategy employed here was to essentially change code we generate from

```llvm
  %s = alloca %S ; potentially smaller than argument, but never larger
  %1 = bitcast %S* %s to { i64, i64 }*
  store { i64, i64 } %0, { i64, i64 }* %1, align 4
```

to

```llvm
  %1 = alloca { i64, i64 } ; the copy of argument itself
  store { i64, i64 } %0, { i64, i64 }* %1, align 4
  %s = bitcast { i64, i64 }* %1 to %S* ; potentially truncate by casting to a pointer of smaller type.
```
2016-05-26 02:52:49 -07:00
Simonas Kazlauskas
5b404523dd Fix stores codegen pass 2016-05-26 12:41:40 +03:00
Andrea Canciani
6b5e86b0ce Extend the test for EscapeUnicode
to also check that it is legitimately an `ExactSizeIterator`.
2016-05-26 10:54:58 +02:00
Simonas Kazlauskas
2f0da79e47 Do not forget to schedule the drop for the argument 2016-05-26 11:26:03 +03:00
Vadim Petrochenkov
35ef09c38b Replace pat_adjust_pos with an iterator adapter 2016-05-26 11:11:58 +03:00
Vadim Petrochenkov
c038b45423 Address review comments 2016-05-26 11:11:58 +03:00
Vadim Petrochenkov
d69aeaf662 Implement .. in tuple (struct) patterns 2016-05-26 11:11:58 +03:00
Sebastian Thiel
eface32e41 Add make tips as useful make target
By accident, I found the `make tips` target, which helped me to gain more insight on how to work with the system more quickly.
2016-05-26 10:08:45 +02:00
Andrea Canciani
41950c64a1 Explain the order of the enumeration items
Simply a micro-optimization to reduce code size and to open up
inlining opportunities.
2016-05-26 10:04:05 +02:00
Andrea Canciani
da03950f62 Move length computation to ExactSizeIterator impls
and reuse it in `size_hint`.
2016-05-26 09:59:21 +02:00
Andrea Canciani
baa9680a34 Implement count for EscapeDefault and EscapeUnicode
Trivial implementation, as both are `ExactSizeIterator`s.

Part of #24214.
2016-05-26 09:59:21 +02:00
Andrea Canciani
c30fa92a0a EscapeUnicode and EscapeDefault are ExactSizeIterators
In #28662, `size_hint` was made exact for `EscapeUnicode` and
`EscapeDefault`, but neither was marked as `ExactSizeIterator`.
2016-05-26 09:59:21 +02:00
bors
d5759a3417 Auto merge of #33699 - alexcrichton:stabilize-1.10, r=aturon
std: Stabilize APIs for the 1.10 release

This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:

Stabilized:

* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`

Deprecated:

* `StaticCondvar` - this, and all other static synchronization primitives
                    below, are usable today through the lazy-static crate on
                    stable Rust today. Additionally, we'd like the non-static
                    versions to be directly usable in a static context one day,
                    so they're unlikely to be the final forms of the APIs in any
                    case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`

Closes #27717
Closes #27720
Closes #30014
Closes #30425
Closes #30449
Closes #31190
Closes #31399
Closes #31767
Closes #32111
Closes #32281
Closes #32312
Closes #32551
Closes #33018
2016-05-25 20:36:09 -07:00
Jeffrey Seyfried
5b82c5f369 Fix ICE on failure to parse token tree 2016-05-26 01:20:55 +00:00
Simonas Kazlauskas
e0e50a4b74 Fix nit/Refine the datum construction 2016-05-26 03:38:17 +03:00
Simonas Kazlauskas
0d2a84c97d Fix the fix/hack interaction with debuginfo 2016-05-26 03:25:23 +03:00