Commit Graph

57632 Commits

Author SHA1 Message Date
Frank Rehberger
ba84d4ff81 Update map.rs 2016-09-26 18:15:27 +02:00
Tim Neumann
f0e1738e51 fix rebase fallout 2016-09-26 17:21:45 +02:00
bors
c2769285ad Auto merge of #36735 - srinivasreddy:typck/variance, r=nrc
run rustfmt on librustc_typeck/variance folder
2016-09-26 07:53:27 -07:00
Frank Rehberger
3551008022 Update set.rs 2016-09-26 16:03:37 +02:00
Frank Rehberger
bd80e7bce7 Update map.rs 2016-09-26 16:00:24 +02:00
Frank Rehberger
aed99c800e Document init of HashSet/HashMap from vector 2016-09-26 13:39:31 +02:00
bors
3bf4a7ad45 Auto merge of #36734 - nnethercote:fix-HashSet-sizing, r=Aatch
Don't allocate during default HashSet creation.

The following `HashMap` creation functions don't allocate heap storage for elements.
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This is good, because it's surprisingly common to create a HashMap and never
use it. So that case should be cheap.

However, `HashSet` does not have the same behaviour. The corresponding creation
functions *do* allocate heap storage for the default number of non-zero
elements (which is 32 slots for 29 elements).
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This commit gives `HashSet` the same behaviour as `HashMap`, by simply calling
the corresponding `HashMap` functions (something `HashSet` already does for
`with_capacity` and `with_capacity_and_hasher`). It also reformats one existing
`HashSet` construction to use a consistent single-line format.

This speeds up rustc itself by 1.01--1.04x on most of the non-tiny
rustc-benchmarks.
2016-09-26 04:38:18 -07:00
Jeffrey Seyfried
df0e4bf911 Move ensure_complete_parse into expand.rs. 2016-09-26 11:24:10 +00:00
bors
b786976a15 Auto merge of #36730 - jseyfried:make_macro_rules_invocations_magic, r=nrc
Forbid user-defined macros named "macro_rules"

This is a [breaking-change].
r? @nrc
2016-09-26 01:21:00 -07:00
Alexander von Gluck IV
7c34d9c144 Haiku: Use common thread set_name stub 2016-09-26 00:41:41 -05:00
Tim Neumann
cf1fc2ce13 appease tidy 2016-09-26 07:07:41 +02:00
Tim Neumann
0dc2a95f1e emit feature help in cheat mode 2016-09-26 07:07:41 +02:00
Tim Neumann
ad81f11b01 deduplicate inline is_nightly_build implementations 2016-09-26 07:07:41 +02:00
Tim Neumann
3f287efc82 refactor away get_unstable_features_setting 2016-09-26 07:07:41 +02:00
Tim Neumann
ba838dc4e9 make is_nightly_build a method on UnstableFeatures 2016-09-26 07:07:41 +02:00
Tim Neumann
6d09d8d7d9 add unstable_features to ParseSess 2016-09-26 07:07:41 +02:00
Tim Neumann
b0dba7439d make emit_feature_err take a ParseSess 2016-09-26 07:07:41 +02:00
bors
0a0215ddcd Auto merge of #36652 - giannicic:issue-36553, r=nrc
this commit corrects E0520 error text.
See referenced issue for further info

r? @nrc
2016-09-25 22:03:28 -07:00
Tim Neumann
51ea050457 reject macros with empty repetitions 2016-09-26 06:59:06 +02:00
Jeffrey Seyfried
34f4ad1b71 Add regression test. 2016-09-26 04:38:53 +00:00
Jeffrey Seyfried
b90ceddcee Refactor ensure_complete_parse. 2016-09-26 04:29:30 +00:00
Jeffrey Seyfried
4a8467b62d Remove TokResult. 2016-09-26 04:16:55 +00:00
Jeffrey Seyfried
8b40eaddf1 Refactor parse_expansion out of ResultAnyMacro. 2016-09-26 04:15:27 +00:00
Srinivas Reddy Thatiparthy
765eaac000
run rustfmt on librustc_typeck/variance folder 2016-09-26 08:44:41 +05:30
Nicholas Nethercote
4eb069c981 Don't allocate during default HashSet creation.
The following `HashMap` creation functions don't allocate heap storage for elements.
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This is good, because it's surprisingly common to create a HashMap and never
use it. So that case should be cheap.

However, `HashSet` does not have the same behaviour. The corresponding creation
functions *do* allocate heap storage for the default number of non-zero
elements (which is 32 slots for 29 elements).
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This commit gives `HashSet` the same behaviour as `HashMap`, by simply calling
the corresponding `HashMap` functions (something `HashSet` already does for
`with_capacity` and `with_capacity_and_hasher`). It also reformats one existing
`HashSet` construction to use a consistent single-line format.

This speeds up rustc itself by 1.01--1.04x on most of the non-tiny
rustc-benchmarks.
2016-09-26 13:05:54 +10:00
Srinivas Reddy Thatiparthy
a33b921c0d
run rustfmt on typecheck/coherence folder 2016-09-26 07:56:44 +05:30
bors
9966397b61 Auto merge of #36151 - camlorn:struct_layout_optimization, r=eddyb
refactor to remove trans::adt and make rustc::ty::layout authoritative

I asked on IRC about optimizing struct layout by reordering fields from most-aligned to least-aligned and somehow ended up getting talked into doing this.  The goal here is to make `layout` authoritative and to remove `adt`.  The former has been accomplished by reimplementing `represent_type_uncached` and the latter is in progress.  @eddyb thought I should make the PR now.

My plan is to reserve the actual optimization for a second PR, as this work is useful by itself.
2016-09-25 18:47:00 -07:00
Gianni Ciccarelli
63a58929b9 #36553 specialisation error 520 is misleading
fit string in one line
2016-09-26 03:18:42 +02:00
Jeffrey Seyfried
77958d56bc Forbid user-defined macros named "macro_rules". 2016-09-26 00:22:40 +00:00
Austin Hicks
467454b0d2 Incorporate review comments. 2016-09-25 20:14:34 -04:00
bors
95abee1a68 Auto merge of #36442 - alexcrichton:rustbuild-cross, r=brson
rustbuild: Nicer error for host builds of targets

If a triple is configured only as a target, not a host, then trying to build
that triple with host artifacts would cause a panic. Fail a little nicer
instead.

Closes #36268
2016-09-25 15:30:01 -07:00
Corey Farwell
99e1b9cfa6 Move in-pass-function structs and impls outside functions.
Now that each pass has its own module, there's not much of a reason to
keep these structs within the functions.
2016-09-25 18:05:58 -04:00
Corey Farwell
bd62c4c83d Move pass contants/types into the new pass module. 2016-09-25 17:59:40 -04:00
Alexander von Gluck IV
7e91b86707 Haiku: Adjust haiku target to match new librustc_back design 2016-09-25 16:55:40 -05:00
Corey Farwell
f1a3eb633d Separate rustdoc passes into separate modules. 2016-09-25 17:40:16 -04:00
Christopher
42a5a065db Touch up formatting for variance README.md
There were a few places that need extra indentation to register as a code block.
2016-09-25 16:24:23 -05:00
bors
5fc14c1a6f Auto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrc
Load macros from `#[macro_use]` extern crates in `resolve`

r? @nrc
2016-09-25 12:14:11 -07:00
Corey Farwell
5495fab363 Privatize unindent function.
Doesn't look like it's used anywhere outside the module.
2016-09-25 15:04:01 -04:00
Corey Farwell
a147a9d01b Fix incorrect alignment for if statement. 2016-09-25 13:57:12 -04:00
Corey Farwell
ae3ed31155 Use underscores to breakup long number. 2016-09-25 13:56:54 -04:00
Jake Goulding
cc8727e675 Report which required build-time environment variable is not set 2016-09-25 12:18:09 -04:00
Alexander von Gluck IV
8ec1d21ffa Haiku: Fix pthread_t typesize set to stable 1.8.0 post #29791 2016-09-25 11:17:36 -05:00
Alexander von Gluck IV
729ae39090 Haiku: Style, TODO to FIXME 2016-09-25 11:16:38 -05:00
Niels Sascha Reedijk
01fecb9f8f Haiku: add support for building on Haiku
* Hand rebased from Niels original work on 1.9.0
2016-09-25 11:15:18 -05:00
Niels Sascha Reedijk
328743aa28 Haiku: add search path for terminfo
* Hand rebased from Niels original work on 1.9.0
2016-09-25 11:14:59 -05:00
Niels Sascha Reedijk
ba6eb57909 Haiku: add workaround for missing F_DUPFD_CLOEXEC
The src/libstd/sys/unix/net.rs file depends on it. It is missing
from Haiku. This workaround should actually 'fix' the problem,
but it turns out the fds-are-cloexec.rs test hangs. I do not
know how related these two issues are, but it warrants further
investigation.

The test is ignored on this platform for now.

* Hand rebased from Niels original work on 1.9.0
2016-09-25 11:14:41 -05:00
Niels Sascha Reedijk
783ab7766f Haiku: Work around the lack of the FIOCLEX ioctl
* Hand rebased from Niels original work on 1.9.0
2016-09-25 11:13:57 -05:00
Niels Sascha Reedijk
1a6fc8b7b8 Add support for the Haiku operating system on x86 and x86_64 machines
* Hand rebased from Niels original work on 1.9.0
2016-09-25 11:12:23 -05:00
bors
49dd95b078 Auto merge of #36564 - vanjacosic:patch-2, r=GuillaumeGomez
Docs: Update to "Ownership" section

Found #34865 while looking for easy docs wins I could contribute with.
2016-09-25 08:08:18 -07:00
bors
2d1d4d1994 Auto merge of #36713 - TimNN:fix-36708, r=arielb1
don't unwrap non-local span

Fixes #36708.
2016-09-25 02:46:18 -07:00