Commit Graph

57966 Commits

Author SHA1 Message Date
Alex Crichton
f2adb70408 std: Update liblibc submodule
This fixes compilation on the s390x target
2016-10-11 10:10:10 -07:00
Alex Crichton
62861f8797 configure: Fix gcc detection for LLVM
We have a case where 32-bit compilation accidentally requested clang when gcc
was the only one available.
2016-10-11 10:08:07 -07:00
Guillaume Gomez
30164c21fa Rollup merge of #37081 - p512:master, r=sfackler
Changed 0 into '0'

Right now `0` is an undefined production rule.
[Documentation following the grammar specification](https://doc.rust-lang.org/nightly/std/fmt/#sign0) strongly suggests `'0'` is meant as it is used as a character literal.

r? @steveklabnik
2016-10-11 17:51:27 +02:00
Guillaume Gomez
5c29a914a9 Rollup merge of #37073 - GuillaumeGomez:string_url, r=steveklabnik
Add missing urls on String module

r? @steveklabnik
2016-10-11 17:51:27 +02:00
Guillaume Gomez
bfbd0a5e49 Rollup merge of #37072 - michaelwoerister:enable-trait-ich-tests, r=nikomatsakis
ICH: Enable some cases in trait definition hashing.

Enable some test cases originally written by @eulerdisk. The tests can be enabled now because @MathieuBordere has fixed the underlying problem in #36974.

r? @nikomatsakis
2016-10-11 17:51:27 +02:00
Guillaume Gomez
ffa9bbf7cd Rollup merge of #37065 - nnethercote:opt-mk_printer, r=nikomatsakis
Merge `Printer::token` and `Printer::size`.

Logically, it's a vector of pairs, so might as well represent it that
way.

The commit also changes `scan_stack` so that it is initialized with the
default size, instead of the excessive `55 * linewidth` size, which it
usually doesn't get even close to reaching.
2016-10-11 17:51:26 +02:00
Guillaume Gomez
ac94bde803 Rollup merge of #37060 - jfirebaugh:E0303, r=jonathandturner
Update E0303 to new error format

Fixes #35790

r? @jonathandturner
2016-10-11 17:51:26 +02:00
Guillaume Gomez
0ff115c507 Rollup merge of #37040 - flodiebold:hash-tests, r=michaelwoerister
Incr. comp. hash tests for consts and statics

Hi,

These two commits fix #37000 and #37001.

r? @michaelwoerister
2016-10-11 17:51:26 +02:00
Guillaume Gomez
97e9eac8bf Rollup merge of #36997 - KillTheMule:patch-1, r=steveklabnik
Book: Be very explicit of lifetimes being descriptive

... not prescriptive. Pointed out in https://users.rust-lang.org/t/what-if-i-get-lifetimes-wrong/7535/4, which was a revelation to me and made me think this should be more clear in the book. I'm not sure if I got this entirely right or if the wording is good, but I figured a PR is more helpful than a simple issue.

r? @steveklabnik

Small Note: There's also https://github.com/rust-lang/book, should I have sent the PR there? It doesn't coincide with the online book though, so I figured it's better of here.
2016-10-11 17:51:26 +02:00
Guillaume Gomez
0b7fe4d67c Rollup merge of #36699 - bluss:repeat-str, r=alexcrichton
Add method str::repeat(self, usize) -> String

It is relatively simple to repeat a string n times:
`(0..n).map(|_| s).collect::<String>()`. It becomes slightly more
complicated to do it “right” (sizing the allocation up front), which
warrants a method that does it for us.

This method is useful in writing testcases, or when generating text.
`format!()` can be used to repeat single characters, but not repeating
strings like this.
2016-10-11 17:51:26 +02:00
Guillaume Gomez
6717dba276 Rollup merge of #36679 - QuietMisdreavus:rustdoc-line-breaks, r=steveklabnik
rustdoc: print non-self arguments of bare functions and struct methods on their own line

This change alters the formatting rustdoc uses when it creates function and struct method documentation. For bare functions, each argument is printed on its own line. For struct methods, non-self arguments are printed on their own line. In both cases, no line breaks are introduced if there are no arguments, and for struct methods, no line breaks are introduced if there is only a single self argument. This should aid readability of long function signatures and allow for greater comprehension of these functions.

I've run rustdoc with these changes on my crate egg-mode and its set of dependencies and put the result [on my server](https://shiva.icesoldier.me/doc-custom/egg_mode/). Of note, here are a few shortcut links that highlight the changes:

* [Bare function with a long signature](https://shiva.icesoldier.me/doc-custom/egg_mode/place/fn.reverse_geocode.html)
* [Struct methods, with single self argument and with self and non-self arguments](https://shiva.icesoldier.me/doc-custom/egg_mode/tweet/struct.Timeline.html#method.reset)
* [Bare functions with no arguments](https://shiva.icesoldier.me/doc-custom/rand/fn.thread_rng.html) and [struct methods with no arguments](https://shiva.icesoldier.me/doc-custom/hyper/client/struct.Client.html#method.new) are left unchanged.

This PR consists of two commits: one for bare functions and one for struct methods.
2016-10-11 17:51:25 +02:00
Guillaume Gomez
b5bedfcd3f Add missing urls in io module 2016-10-11 17:48:14 +02:00
bors
304d0c8d85 Auto merge of #36871 - petrochenkov:pdderr, r=nikomatsakis
Turn compatibility lint `match_of_unit_variant_via_paren_dotdot` into a hard error

The lint was introduced 10 months ago and made deny-by-default 7 months ago.
In case someone is still using it, https://github.com/rust-lang/rust/pull/36868 contains a stable replacement.

r? @nikomatsakis
2016-10-11 07:39:09 -07:00
Felix S. Klock II
7d2d5bcbcf Code for enforcing #[may_dangle] attribute. 2016-10-11 16:34:31 +02:00
Felix S. Klock II
e8ccc68254 Thread pure_wrt_drop field through lifetime and type parameters. 2016-10-11 16:08:37 +02:00
Felix S. Klock II
4bb68be681 Add feature gate for dropck_eyepatch feature (RFC 1327). 2016-10-11 16:08:36 +02:00
Simon Sapin
401f1c45db Merge two impl<T> Vec<T> blocks.
The show up separately in rustdoc.

This is a separate commit to keep the previous one’s diff shorter.
2016-10-11 14:40:05 +02:00
Simon Sapin
be34bac1ab Add Vec::dedup_by and Vec::dedup_by_key 2016-10-11 14:39:14 +02:00
bors
e33562078f Auto merge of #36983 - alexcrichton:configure-multiple-musl, r=brson
configure: Add options for separate musl roots

This allows using the `./configure` script to enable rustbuild to compile
multiple musl targets at once. We'll hopefully use this soon on our bots to
produce a bunch of targets.
2016-10-11 04:26:56 -07:00
Tobias Bucher
2eda01ee43 Fix Android compilation io::Error -> io::ErrorKind 2016-10-11 12:16:35 +02:00
bors
1e4c8b1a81 Auto merge of #36825 - sbwtw:master, r=alexcrichton
add println!() macro with out any arguments

lets add println!() to write "\n".
like java https://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html#println()
2016-10-11 01:17:03 -07:00
Jeffrey Seyfried
829bd8c9b9 Add test. 2016-10-11 05:14:10 +00:00
Jeffrey Seyfried
a4c0daab6d Remove LegacyBindingKind::MacroUse. 2016-10-11 05:14:10 +00:00
Jeffrey Seyfried
111caef9a3 Clean up the scopes of expanded #[macro_use] imports. 2016-10-11 05:14:08 +00:00
Jeffrey Seyfried
31e0e12e69 Add support for undetermined macro invocations. 2016-10-11 03:41:48 +00:00
Jeffrey Seyfried
d5281ef681 Merge branch 'persistent_macro_scopes' into cleanup_expanded_macro_use_scopes 2016-10-11 03:41:18 +00:00
Jeffrey Seyfried
6808b0a2b7 Check for shadowing errors after all invocations have been expanded. 2016-10-11 03:28:54 +00:00
Wesley Wiser
5e91c073f2 Move IdxSetBuf and BitSlice to rustc_data_structures
Resolves a FIXME
2016-10-10 20:26:26 -04:00
bors
ead9212c33 Auto merge of #36707 - achanda:ip_type, r=alexcrichton
Add two functions to check type of given address

The is_v4 function returns true if the given IP is v4. The is_v6
function returns true if the IP is v6.
2016-10-10 17:18:01 -07:00
Corey Farwell
0038430192 Simplify str and Path comparison. 2016-10-10 19:46:18 -04:00
Corey Farwell
7c7a5949fe Return early to avoid excessive indentation.` 2016-10-10 19:40:05 -04:00
Corey Farwell
a8e257091b Use Cow instead of String to avoid unnecessary allocations. 2016-10-10 19:35:22 -04:00
Corey Farwell
3a15475d36 Convert String generating functions into &str constants. 2016-10-10 19:28:16 -04:00
p512
ee3de444e6 Changed 0 into '0'
0 is not a production rule but a literal
2016-10-11 01:25:50 +02:00
Ulrik Sverdrup
2b7222d3ec Add method str::repeat(self, usize) -> String
It is relatively simple to repeat a string n times:
`(0..n).map(|_| s).collect::<String>()`. It becomes slightly more
complicated to do it “right” (sizing the allocation up front), which
warrants a method that does it for us.

This method is useful in writing testcases, or when generating text.
`format!()` can be used to repeat single characters, but not repeating
strings like this.
2016-10-11 00:24:23 +02:00
Jeffrey Seyfried
448d6ad72e Test derive expansion ordering. 2016-10-10 22:15:57 +00:00
Jeffrey Seyfried
60a4b69ec0 Expand #[derive] attribute macro invocations last. 2016-10-10 22:15:55 +00:00
bors
a3bc191b5f Auto merge of #37030 - michaelwoerister:live-debug-values-fix, r=alexcrichton
llvm: Update LLVM to include fix for pathologic case in its LiveDebugValues pass.

See #36926.
r? @alexcrichton
2016-10-10 12:15:14 -07:00
Guillaume Gomez
3c66f96aac Add missing urls on String module 2016-10-10 18:15:55 +02:00
Mark-Simulacrum
f9c73adce8 Add comparison operators to boolean const eval. 2016-10-10 09:58:00 -06:00
Michael Woerister
f52723c330 ICH: Enable some cases in trait definition hashing. 2016-10-10 11:57:49 -04:00
Michael Woerister
7d03badb2a LLVM: Backport "[SimplifyCFG] Correctly test for unconditional branches in GetCaseResults" 2016-10-10 11:12:29 -04:00
Michael Woerister
d46defc82c Update LLVM to fix bug in SimplifyCFG pass. 2016-10-10 09:53:14 -04:00
Felix S. Klock II
b0eee76d25 Include attributes on generic parameter bindings in pretty printer. 2016-10-10 15:27:08 +02:00
bors
6d620843f6 Auto merge of #36341 - sagebind:thread_id, r=alexcrichton
Add ThreadId for comparing threads

This adds the capability to store and compare threads with the current calling thread via a new struct, `std:🧵:ThreadId`. Addresses the need outlined in issue #21507.

This avoids the need to add any special checks to the existing thread structs and does not rely on the system to provide an identifier for a thread, since it seems that this approach is unreliable and undesirable. Instead, this simply uses a lazily-created, thread-local `usize` whose value is copied from a global atomic counter. The code should be simple enough that it should be as much reliable as the `#[thread_local]` attribute it uses (however much that is).

`ThreadId`s can be compared directly for equality and have copy semantics.

Also see these other attempts:
- rust-lang/rust#29457
- rust-lang/rust#29448
- rust-lang/rust#29447

And this in the RFC repo: rust-lang/rfcs#1435
2016-10-10 04:04:51 -07:00
Jeffrey Seyfried
53fd3b0acc Avoid quadratic complexity. 2016-10-10 09:35:25 +00:00
Nicholas Nethercote
67a5444183 Merge Printer::token and Printer::size.
Logically, it's a vector of pairs, so might as well represent it that
way.

The commit also changes `scan_stack` so that it is initialized with the
default size, instead of the excessive `55 * linewidth` size, which it
usually doesn't get even close to reaching.
2016-10-10 16:19:53 +11:00
Nick Cameron
4df0f3f6a6 Error monitor should emit error to stderr instead of stdout 2016-10-10 18:14:45 +13:00
Nicholas Nethercote
b043e11de2 Avoid allocations in Decoder::read_str.
`opaque::Decoder::read_str` is very hot within `rustc` due to its use in
the reading of crate metadata, and it currently returns a `String`. This
commit changes it to instead return a `Cow<str>`, which avoids a heap
allocation.

This change reduces the number of calls to `malloc` by almost 10% in
some benchmarks.

This is a [breaking-change] to libserialize.
2016-10-10 10:36:35 +11:00
John Firebaugh
9d364267d6 Update E0303 to new error format 2016-10-09 11:41:59 -07:00