Commit Graph

58143 Commits

Author SHA1 Message Date
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
bors
a7bfb1aba9 Auto merge of #37055 - kali:master, r=alexcrichton
use MSG_NOSIGNAL on all relevant platforms

followup #36824
2016-10-09 10:07:39 -07:00
Mathieu Poumeyrol
14f9cbdfd5 use MSG_NOSIGNAL on all relevant platforms 2016-10-09 13:01:29 +02:00
Tobias Bucher
70dcfd634e Use try_into and move some functions 2016-10-09 10:49:05 +02:00
Tobias Bucher
f352f0eec0 Dynamically detect presence of p{read,write}64 on Android 2016-10-09 10:48:07 +02:00
Tobias Bucher
b3f2644b66 Implement reading and writing atomically at certain offsets
These functions allow to read from and write to a file in one atomic
action from multiple threads, avoiding the race between the seek and the
read.

The functions are named `{read,write}_at` on non-Windows (which don't
change the file cursor), and `seek_{read,write}` on Windows (which
change the file cursor).
2016-10-09 10:48:07 +02:00
bors
9d4d0da7af Auto merge of #36982 - GuillaumeGomez:slice_urls, r=frewsxcv
Add missing urls in slice doc module

r? @steveklabnik
2016-10-09 00:35:56 -07:00
Corey Farwell
e4f066fe8b Remove unnecessary pub function classifier. 2016-10-09 00:17:50 -04:00
Corey Farwell
ba20da1db7 Make ExternalHtml::load short-circuited. 2016-10-09 00:17:49 -04:00
Corey Farwell
7be14eea94 Refactor away load_or_return macro. 2016-10-09 00:17:46 -04:00
Srinivas Reddy Thatiparthy
bf5dfacdde
run rustfmt on librustc_lint folder 2016-10-09 09:38:07 +05:30
Corey Farwell
f410da5cbe Add doc comments describing fields on externalfiles::ExternalHtml. 2016-10-08 22:55:51 -04:00
bors
b98cc352cb Auto merge of #36637 - GuillaumeGomez:fix_run_button, r=bluss
Fixes run button appearing when it shouldn't

Fixes #36621.

r? @steveklabnik
2016-10-08 19:42:55 -07:00
Corey Farwell
fd073cf4a3 Don't construct PathBuf ownership if we don't need it. 2016-10-08 21:33:28 -04:00
bors
19ac57926a Auto merge of #37041 - tbu-:pr_less_sizet_casts, r=alexcrichton
Use less `size_t` casts in libstd since it's now defined as `usize`
2016-10-08 15:59:49 -07:00
bors
bff06afbc5 Auto merge of #37027 - alexcrichton:less-deps-in-bootstrap, r=japaric
rustbuild: Optimize build times slightly

As the entry point for building the Rust compiler, a good user experience hinges
on this compiling quickly to get to the meat of the problem. To that end use
`#[cfg]`-specific dependencies to avoid building Windows crates on Unix and drop
the `regex` crate for now which was easily replacable with some string
searching.
2016-10-08 12:36:11 -07:00
Alex Crichton
d17f0b0dd7 rustbuild: Optimize build times slightly
As the entry point for building the Rust compiler, a good user experience hinges
on this compiling quickly to get to the meat of the problem. To that end use
`#[cfg]`-specific dependencies to avoid building Windows crates on Unix and drop
the `regex` crate for now which was easily replacable with some string
searching.
2016-10-08 11:11:00 -07:00
Guillaume Gomez
89870b3305 Add missing urls in slice doc module 2016-10-08 18:08:32 +02:00
Guillaume Gomez
00098bd33b Add missing urls for hash modules 2016-10-08 18:05:18 +02:00
Tobias Bucher
717d2ddca7 Use less size_t casts in libstd since it's now defined as usize 2016-10-08 15:48:28 +02:00
bors
4344f147aa Auto merge of #37039 - Manishearth:rollup, r=Manishearth
Rollup of 6 pull requests

- Successful merges: #36937, #37016, #37028, #37029, #37031, #37034
- Failed merges: #37027
2016-10-08 05:55:27 -07:00
Florian Diebold
eb07a6cfd0 Add ICH test case for consts
Fixes #37000.
2016-10-08 14:44:51 +02:00
Florian Diebold
5a30f0c728 Add ICH test case for statics
Fixes #37001.
2016-10-08 14:43:50 +02:00
Manish Goregaokar
69f4126da5 Rollup merge of #37034 - nox:empty-trait-list, r=alexcrichton
Do not add an empty #[derive()] list in expand_derive (fixes #37033)
2016-10-08 16:52:44 +05:30