]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agosave-analysis: change imports to carry a ref id rather than their own node id
Nick Cameron [Fri, 28 Oct 2016 22:24:37 +0000 (08:24 +1000)]
save-analysis: change imports to carry a ref id rather than their own node id

7 years agoAuto merge of #37450 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 28 Oct 2016 17:20:55 +0000 (10:20 -0700)]
Auto merge of #37450 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

- Successful merges: #36206, #37343, #37430, #37436, #37441
- Failed merges:

7 years agoRollup merge of #37441 - federicomenaquintero:master, r=steveklabnik
Guillaume Gomez [Fri, 28 Oct 2016 15:05:48 +0000 (17:05 +0200)]
Rollup merge of #37441 - federicomenaquintero:master, r=steveklabnik

reference: Mention --crate-type=cdylib in the Linkage section

This option is missing in the docs! :)

7 years agoRollup merge of #37436 - nrc:save-span-errs, r=petrochenkov
Guillaume Gomez [Fri, 28 Oct 2016 15:05:48 +0000 (17:05 +0200)]
Rollup merge of #37436 - nrc:save-span-errs, r=petrochenkov

Give variant spans used in derives the correct expansion id

This fixes a problem in save-analysis where it mistakes a path to a variant as the variant itself.

r? @petrochenkov

7 years agoRollup merge of #37430 - robinst:missing-crate-message-add-semicolon, r=eddyb
Guillaume Gomez [Fri, 28 Oct 2016 15:05:47 +0000 (17:05 +0200)]
Rollup merge of #37430 - robinst:missing-crate-message-add-semicolon, r=eddyb

Add semicolon to "Maybe a missing `extern crate foo`" message

I had it a couple of times that I was missing the "extern crate" line
after I introduced a new dependency. So I copied the text from the
message and inserted it into the beginning of my code, only to find the
compiler complaining that I was missing the semicolon. (I forgot to add
it after the text that I had pasted.)

There's a similar message which does include the semicolon, namely
"help: you can import it into scope: `use foo::Bar;`". I think the two
messages should be consistent, so this change adds it for "extern
crate".

7 years agoRollup merge of #37343 - bluss:write-doc, r=GuillaumeGomez
Guillaume Gomez [Fri, 28 Oct 2016 15:05:47 +0000 (17:05 +0200)]
Rollup merge of #37343 - bluss:write-doc, r=GuillaumeGomez

Add documentation for Read, Write impls for slices and Vec

The Write imps for &[u8] and Vec<u8> are quite different, and we need this to
be reflected in the docs.

These documentation comments will be visible on the respective type's
page in the trait impls section.

7 years agoRollup merge of #36206 - mcarton:35755, r=pnkfelix
Guillaume Gomez [Fri, 28 Oct 2016 15:05:47 +0000 (17:05 +0200)]
Rollup merge of #36206 - mcarton:35755, r=pnkfelix

Fix bad error message with `::<` in types

Fix #36116.

Before:
```rust
error: expected identifier, found `<`
  --> src/test/compile-fail/issue-36116.rs:16:52
   |
16 |     let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>);
   |                                                    ^

error: chained comparison operators require parentheses
  --> src/test/compile-fail/issue-36116.rs:16:52
   |
16 |     let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>);
   |                                                    ^^^^^^
   |
   = help: use `::<...>` instead of `<...>` if you meant to specify type arguments

error: expected expression, found `)`
  --> src/test/compile-fail/issue-36116.rs:16:57
   |
16 |     let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>);
   |                                                         ^

error: expected identifier, found `<`
  --> src/test/compile-fail/issue-36116.rs:20:17
   |
20 |     let g: Foo::<i32> = Foo { _a: 42 };
   |                 ^

error: aborting due to 5 previous errors
```

After:
```rust
error: unexpected token: `::`
  --> src/test/compile-fail/issue-36116.rs:16:50
   |
16 |     let f = Some(Foo { _a: 42 }).map(|a| a as Foo::<i32>);
   |                                                  ^^
   |
   = help: use `<...>` instead of `::<...>` if you meant to specify type arguments

error: unexpected token: `::`
  --> src/test/compile-fail/issue-36116.rs:20:15
   |
20 |     let g: Foo::<i32> = Foo { _a: 42 };
   |               ^^
   |
   = help: use `<...>` instead of `::<...>` if you meant to specify type arguments

error: aborting due to 2 previous errors
```

7 years agoAuto merge of #37196 - tamird:fix-tidy-features, r=brson
bors [Fri, 28 Oct 2016 14:01:17 +0000 (07:01 -0700)]
Auto merge of #37196 - tamird:fix-tidy-features, r=brson

tidy/features: fix checking of lang features

r? @brson

See the commit messages - the actual "fixes" here are strawmen; I'm happy to adjust them if you have suggestions.

7 years agoFix bad error message with `::<` in types
mcarton [Thu, 1 Sep 2016 23:58:44 +0000 (01:58 +0200)]
Fix bad error message with `::<` in types

7 years agoAuto merge of #37321 - nrc:lib-proc-macro, r=@alexcrichton
bors [Fri, 28 Oct 2016 10:11:56 +0000 (03:11 -0700)]
Auto merge of #37321 - nrc:lib-proc-macro, r=@alexcrichton

Split up libproc_macro_plugin

Separate the plugin code from non-plugin code to break a potential cycle in crates.

This will allow us to merge the new libproc_macro_tokens into libproc_macro.

r? @alexcrichton

7 years agoAuto merge of #37212 - srinivasreddy:libcollectionstest, r=nrc
bors [Fri, 28 Oct 2016 05:02:31 +0000 (22:02 -0700)]
Auto merge of #37212 - srinivasreddy:libcollectionstest, r=nrc

run rustfmt on libcollectionstest

7 years agotidy/features: fix checking of lang features
Tamir Duberstein [Fri, 14 Oct 2016 22:14:29 +0000 (18:14 -0400)]
tidy/features: fix checking of lang features

Removes the `STATUSES` static which duplicates truth from the pattern
match in `collect_lang_features`.

Fixes existing duplicates by renaming:
- never_type{,_impls} on `impl`s on `!`
- concat_idents{,_macro} on `macro_rules! concat_idents`

Fixes #37013.

7 years agotidy/bins: fix false positive on non checked-in binary
Tamir Duberstein [Sat, 15 Oct 2016 20:17:23 +0000 (16:17 -0400)]
tidy/bins: fix false positive on non checked-in binary

`git ls-files` now exits zero when called with a missing file; check
that the file is included in the output before reporting a checked-in
binary. Observed with git 2.10.1 and tripped by a symlink created by
tests:

src/test/run-make/issue-26006/out/time/deps/liblibc.rlib -> out/libc/liblibc.rlib

7 years agoreference: Mention --crate-type=cdylib in the Linkage section
Federico Mena Quintero [Fri, 28 Oct 2016 01:23:23 +0000 (20:23 -0500)]
reference: Mention --crate-type=cdylib in the Linkage section

7 years agoAuto merge of #37035 - petrochenkov:selfstruct, r=eddyb
bors [Fri, 28 Oct 2016 01:18:56 +0000 (18:18 -0700)]
Auto merge of #37035 - petrochenkov:selfstruct, r=eddyb

Support `Self` in struct expressions and patterns

Struct expressions and patterns generally support type aliases `Alias { field: 10 }` i.e. they already have to work with `ty::Ty` to do their job. `Self` is a type alias (when it's not a type parameter) => struct expressions and patterns should support `Self`.

Typical example:
```
impl MyStruct {
    fn new() -> Self {
        Self { a: 10, b: "Hello" }
    }
}
```

The first commit does some preparations and cleanups, see the commit message for  details.
This also fixes couple of bugs related to aliases in struct paths (fixes https://github.com/rust-lang/rust/issues/36286).

EDIT:
Since struct expressions and patterns always work with `ty::Ty` now, associated paths in them are also supported. If associated type `A::B` successfully resolves to a struct (or union) type, then `A::B { /* fields */ }` is a valid expression/pattern. This will become more important when enum variants are treated as [associated items](https://github.com/rust-lang/rust/issues/26264#issuecomment-250603946).

r? @eddyb

7 years agoSplit up libproc_macro_plugin
Nick Cameron [Fri, 21 Oct 2016 07:55:39 +0000 (20:55 +1300)]
Split up libproc_macro_plugin

Separate the plugin code from non-plugin code to break a potential cycle in crates.

This will allow us to merge the new libproc_macro_tokens into libproc_macro.

7 years agoGive variant spans used in derives the correct expansion id
Nick Cameron [Thu, 27 Oct 2016 21:49:45 +0000 (10:49 +1300)]
Give variant spans used in derives the correct expansion id

This fixes a problem in save-analysis where it mistakes a path to a variant as the variant itself.

7 years agoAuto merge of #37350 - srinivasreddy:meta_2, r=nrc
bors [Thu, 27 Oct 2016 19:51:49 +0000 (12:51 -0700)]
Auto merge of #37350 - srinivasreddy:meta_2, r=nrc

run rustfmt on librustc_metadata folder

7 years agoAddress comments + Fix rebase
Vadim Petrochenkov [Wed, 14 Sep 2016 21:51:46 +0000 (00:51 +0300)]
Address comments + Fix rebase

7 years agoSupport `Self` in struct expressions and patterns
Vadim Petrochenkov [Wed, 14 Sep 2016 21:51:46 +0000 (00:51 +0300)]
Support `Self` in struct expressions and patterns

7 years agoPreparations and cleanup
Vadim Petrochenkov [Wed, 14 Sep 2016 21:51:46 +0000 (00:51 +0300)]
Preparations and cleanup

Diagnostics for struct path resolution errors in resolve and typeck are unified.
Self type is treated as a type alias in few places (not reachable yet).
Unsafe cell is seen in constants even through type aliases.
All checks for struct paths in typeck work on type level.

7 years agoAuto merge of #37245 - goffrie:recovery, r=nrc
bors [Thu, 27 Oct 2016 14:19:16 +0000 (07:19 -0700)]
Auto merge of #37245 - goffrie:recovery, r=nrc

Recover out of an enum or struct's braced block.

If we encounter a syntax error inside of a braced block, then we should
fail by consuming the rest of the block if possible.
This implements such recovery for enums and structs.

Fixes #37113.

7 years agoAdd documentation for Read, Write impls for slices and Vec
Ulrik Sverdrup [Sat, 22 Oct 2016 10:50:00 +0000 (12:50 +0200)]
Add documentation for Read, Write impls for slices and Vec

The Write impls for &[u8] and Vec<u8> are quite different, and we need this to
be reflected in the docs.

These documentation comments will be visible on the respective type's
page in the trait impls section.

7 years agoAuto merge of #36894 - petrochenkov:deny, r=nikomatsakis
bors [Thu, 27 Oct 2016 11:06:31 +0000 (04:06 -0700)]
Auto merge of #36894 - petrochenkov:deny, r=nikomatsakis

Make sufficiently old or low-impact compatibility lints deny-by-default

Tracking issues are updated/created when necessary.
Needs crater run before proceeding.

r? @nikomatsakis

7 years agoMake sufficiently old or low-impact compatibility lints deny-by-default
Vadim Petrochenkov [Wed, 14 Sep 2016 21:51:46 +0000 (00:51 +0300)]
Make sufficiently old or low-impact compatibility lints deny-by-default

7 years agoAuto merge of #37128 - nrc:depr-attr, r=@alexcrichton
bors [Thu, 27 Oct 2016 07:51:58 +0000 (00:51 -0700)]
Auto merge of #37128 - nrc:depr-attr, r=@alexcrichton

Deprecate no_debug and custom_derive

r? @nikomatsakis

7 years agoAuto merge of #11994 - eddyb:struct-literal-field-shorthand, r=nrc
bors [Thu, 27 Oct 2016 04:47:25 +0000 (21:47 -0700)]
Auto merge of #11994 - eddyb:struct-literal-field-shorthand, r=nrc

Implement field shorthands in struct literal expressions.

Implements #37340 in a straight-forward way: `Foo { x, y: f() }` parses as `Foo { x: x, y: f() }`.
Because of the added `is_shorthand` to `ast::Field`, this is `[syntax-breaking]` (cc @Manishearth).

* [x] Mark the fields as being a shorthand (the exact same way we do it in patterns), for pretty-printing.
* [x] Gate the shorthand syntax with `#![feature(field_init_shorthand)]`.
* [x] Don't parse numeric field as identifiers.
* [x] Arbitrary field order tests.

7 years agoAdd semicolon to "Maybe a missing `extern crate foo`" message
Robin Stocker [Thu, 27 Oct 2016 04:24:08 +0000 (15:24 +1100)]
Add semicolon to "Maybe a missing `extern crate foo`" message

I had it a couple of times that I was missing the "extern crate" line
after I introduced a new dependency. So I copied the text from the
message and inserted it into the beginning of my code, only to find the
compiler complaining that I was missing the semicolon. (I forgot to add
it after the text that I had pasted.)

There's a similar message which does include the semicolon, namely
"help: you can import it into scope: `use foo::Bar;`". I think the two
messages should be consistent, so this change adds it for "extern
crate".

7 years agoRecover out of an enum or struct's braced block.
Geoffry Song [Tue, 18 Oct 2016 04:47:58 +0000 (21:47 -0700)]
Recover out of an enum or struct's braced block.

If we encounter a syntax error inside of a braced block, then we should
fail by consuming the rest of the block if possible.
This implements such recovery for enums and structs.

Fixes #37113.

7 years agoreview changes
Nick Cameron [Tue, 18 Oct 2016 05:04:28 +0000 (18:04 +1300)]
review changes

7 years agoAuto merge of #36695 - arielb1:literal-match, r=eddyb
bors [Thu, 27 Oct 2016 01:18:57 +0000 (18:18 -0700)]
Auto merge of #36695 - arielb1:literal-match, r=eddyb

Refactor match checking to use HAIR

Refactor match checking to use HAIR instead of HIR, fixing quite a few bugs in the process.

r? @eddyb

7 years agoImplement field shorthands in struct literal expressions.
Eduard Burtescu [Thu, 27 Oct 2016 00:15:13 +0000 (03:15 +0300)]
Implement field shorthands in struct literal expressions.

7 years agodeprecation message for custom derive
Nick Cameron [Tue, 11 Oct 2016 19:38:35 +0000 (08:38 +1300)]
deprecation message for custom derive

7 years agoDeprecate custom_derive
Nick Cameron [Tue, 11 Oct 2016 04:19:51 +0000 (17:19 +1300)]
Deprecate custom_derive

Has a custom deprecation since deprecating features is not supported and is a pain to implement

7 years agodeprecate no_debug
Nick Cameron [Tue, 11 Oct 2016 03:27:09 +0000 (16:27 +1300)]
deprecate no_debug

7 years agoAdd possibility of deprecating attributes
Nick Cameron [Tue, 11 Oct 2016 02:51:27 +0000 (15:51 +1300)]
Add possibility of deprecating attributes

7 years agoAuto merge of #37419 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 26 Oct 2016 21:58:16 +0000 (14:58 -0700)]
Auto merge of #37419 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #36206, #37144, #37391, #37394, #37396, #37398, #37414
- Failed merges:

7 years agoRollup merge of #37414 - thepowersgang:fix-typo, r=nrc
Guillaume Gomez [Wed, 26 Oct 2016 21:49:27 +0000 (23:49 +0200)]
Rollup merge of #37414 - thepowersgang:fix-typo, r=nrc

Fix typo in libsyntax, it was bothering me

May I present - the world's shortest diff.

7 years agoRollup merge of #37398 - zoffixznet:patch-1, r=GuillaumeGomez
Guillaume Gomez [Wed, 26 Oct 2016 21:49:27 +0000 (23:49 +0200)]
Rollup merge of #37398 - zoffixznet:patch-1, r=GuillaumeGomez

Fix typo

7 years agoRollup merge of #37396 - mikhail-m1:e0221, r=jonathandturner
Guillaume Gomez [Wed, 26 Oct 2016 21:49:27 +0000 (23:49 +0200)]
Rollup merge of #37396 - mikhail-m1:e0221, r=jonathandturner

Make error E0221 more helpful

fix #35970 as part of #35233
r? @jonathandturner

7 years agoRollup merge of #37394 - cramertj:cramertj/unused-import-with-id, r=GuillaumeGomez
Guillaume Gomez [Wed, 26 Oct 2016 21:49:27 +0000 (23:49 +0200)]
Rollup merge of #37394 - cramertj:cramertj/unused-import-with-id, r=GuillaumeGomez

Add identifier to unused import warnings

Fix #37376.

For some reason, though, I'm getting warnings with messages like "76:9: 76:16: unused import: `self::g`" instead of "unused import: `self::g`". @pnkfelix Any ideas what might be causing this?

7 years agoRollup merge of #37391 - vtduncan:vec-docs, r=GuillaumeGomez
Guillaume Gomez [Wed, 26 Oct 2016 21:49:27 +0000 (23:49 +0200)]
Rollup merge of #37391 - vtduncan:vec-docs, r=GuillaumeGomez

Broken links in Vec docs

Fixed some issues with quote/bracket nesting and made quoting more consistent.

r? @steveklabnik

7 years agoRollup merge of #37144 - eulerdisk:fix_37126, r=nrc
Guillaume Gomez [Wed, 26 Oct 2016 21:49:26 +0000 (23:49 +0200)]
Rollup merge of #37144 - eulerdisk:fix_37126, r=nrc

save_analysis: Dump data only if get_path_data doesn't fail to resolve a path.

Solves #37126

Dump data only if `get_path_data` doesn't fail to resolve a path.
`get_path_data` returns `None` when it have to deals with `Def::Err`, which is used as placeholder for a failed resolution.

Tell me if this is good enough, maybe I have to add some tests ?

r? @nrc

7 years agoadd back test for issue #6804
Ariel Ben-Yehuda [Wed, 26 Oct 2016 21:38:18 +0000 (00:38 +0300)]
add back test for issue #6804

7 years agoflatten nested slice patterns in HAIR construction
Ariel Ben-Yehuda [Wed, 26 Oct 2016 20:52:03 +0000 (23:52 +0300)]
flatten nested slice patterns in HAIR construction

nested slice patterns have the same functionality as non-nested
ones, so flatten them in HAIR construction.

Fixes #26158.

7 years agohandle mixed byte literal and byte array patterns
Ariel Ben-Yehuda [Wed, 26 Oct 2016 19:38:22 +0000 (22:38 +0300)]
handle mixed byte literal and byte array patterns

Convert byte literal pattern to byte array patterns when they are both
used together. so matching them is properly handled. I could've done the
conversion eagerly, but that could have caused a bad worst-case for
massive byte-array matches.

Fixes #18027.
Fixes #25051.
Fixes #26510.

7 years agoremove StaticInliner and NaN checking
Ariel Ben-Yehuda [Mon, 3 Oct 2016 18:39:21 +0000 (21:39 +0300)]
remove StaticInliner and NaN checking

NaN checking was a lint for a deprecated feature. It can go away.

7 years agostop using MatchCheckCtxt to hold the param-env for check_match
Ariel Ben-Yehuda [Thu, 29 Sep 2016 21:37:19 +0000 (00:37 +0300)]
stop using MatchCheckCtxt to hold the param-env for check_match

7 years agochange match checking to use HAIR
Ariel Ben-Yehuda [Sun, 25 Sep 2016 23:53:26 +0000 (02:53 +0300)]
change match checking to use HAIR

no intended functional changes

7 years agoun-break the `construct_witness` logic
Ariel Ben-Yehuda [Sat, 24 Sep 2016 17:45:59 +0000 (20:45 +0300)]
un-break the `construct_witness` logic

Fixes #35609.

7 years agosplit the exhaustiveness-checking logic to its own module
Ariel Ben-Yehuda [Sat, 24 Sep 2016 15:24:34 +0000 (18:24 +0300)]
split the exhaustiveness-checking logic to its own module

`check_match` is now left with its grab bag of random checks.

7 years agorefactor the `pat_is_catchall` logic
Ariel Ben-Yehuda [Sat, 24 Sep 2016 15:23:46 +0000 (18:23 +0300)]
refactor the `pat_is_catchall` logic

7 years agomove hair::cx::pattern to const_eval
Ariel Ben-Yehuda [Sat, 24 Sep 2016 14:45:24 +0000 (17:45 +0300)]
move hair::cx::pattern to const_eval

7 years agouse a struct abstraction in check_match
Ariel Ben-Yehuda [Sat, 24 Sep 2016 13:49:51 +0000 (16:49 +0300)]
use a struct abstraction in check_match

7 years agoremove SliceWithSubslice, only used from old trans
Ariel Ben-Yehuda [Sat, 24 Sep 2016 13:42:10 +0000 (16:42 +0300)]
remove SliceWithSubslice, only used from old trans

7 years agocomment some ugly points in check_match
Ariel Ben-Yehuda [Sat, 24 Sep 2016 13:12:37 +0000 (16:12 +0300)]
comment some ugly points in check_match

7 years agoAuto merge of #37315 - bluss:fold-more, r=alexcrichton
bors [Wed, 26 Oct 2016 18:43:32 +0000 (11:43 -0700)]
Auto merge of #37315 - bluss:fold-more, r=alexcrichton

Implement Iterator::fold for .chain(), .cloned(), .map() and the VecDeque iterators.

Chain can do something interesting here where it passes on the fold
into its inner iterators.

The lets the underlying iterator's custom fold() be used, and skips the
regular chain logic in next.

Also implement .fold() specifically for .map() and .cloned() so that any
inner fold improvements are available through map and cloned.

The same way, a VecDeque iterator fold can be turned into two slice folds.

These changes lend the power of the slice iterator's loop codegen to
VecDeque, and to chains of slice iterators, and so on.
It's an improvement for .sum() and .product(), and other uses of fold.

7 years agoAuto merge of #37312 - arthurprs:sip-smaller, r=alexcrichton
bors [Wed, 26 Oct 2016 15:15:07 +0000 (08:15 -0700)]
Auto merge of #37312 - arthurprs:sip-smaller, r=alexcrichton

Small improvement to SipHasher

Very small but constant improvement, the objective is to lower latency for u16, u32 and small strings.

CC #35735

```
âžœ  siphash-bench git:(master) âœ— sudo nice -n -20 target/release/foo-648738a54f390643 --bench | tee benches.txt
[sudo] password for arthurprs:

running 62 tests
test _same                       ... bench:           0 ns/iter (+/- 0)
test _warmup                     ... bench:           0 ns/iter (+/- 0)
test rust_siphash13::int_u16     ... bench:          12 ns/iter (+/- 1)
test rust_siphash13::int_u32     ... bench:          14 ns/iter (+/- 0)
test rust_siphash13::int_u64     ... bench:          11 ns/iter (+/- 1)
test rust_siphash13::int_u8      ... bench:          11 ns/iter (+/- 1)
test rust_siphash13::slice::_10  ... bench:          18 ns/iter (+/- 1)
test rust_siphash13::slice::_100 ... bench:          42 ns/iter (+/- 2)
test rust_siphash13::slice::_11  ... bench:          19 ns/iter (+/- 1)
test rust_siphash13::slice::_12  ... bench:          21 ns/iter (+/- 3)
test rust_siphash13::slice::_2   ... bench:          16 ns/iter (+/- 2)
test rust_siphash13::slice::_200 ... bench:          68 ns/iter (+/- 3)
test rust_siphash13::slice::_3   ... bench:          17 ns/iter (+/- 3)
test rust_siphash13::slice::_4   ... bench:          18 ns/iter (+/- 1)
test rust_siphash13::slice::_5   ... bench:          19 ns/iter (+/- 4)
test rust_siphash13::slice::_6   ... bench:          19 ns/iter (+/- 1)
test rust_siphash13::slice::_7   ... bench:          20 ns/iter (+/- 1)
test rust_siphash13::slice::_8   ... bench:          16 ns/iter (+/- 1)
test rust_siphash13::slice::_9   ... bench:          18 ns/iter (+/- 2)
test rust_siphash13::str_::_10   ... bench:          18 ns/iter (+/- 1)
test rust_siphash13::str_::_100  ... bench:          41 ns/iter (+/- 2)
test rust_siphash13::str_::_11   ... bench:          19 ns/iter (+/- 1)
test rust_siphash13::str_::_12   ... bench:          20 ns/iter (+/- 2)
test rust_siphash13::str_::_2    ... bench:          16 ns/iter (+/- 1)
test rust_siphash13::str_::_200  ... bench:          68 ns/iter (+/- 3)
test rust_siphash13::str_::_3    ... bench:          17 ns/iter (+/- 1)
test rust_siphash13::str_::_4    ... bench:          18 ns/iter (+/- 2)
test rust_siphash13::str_::_5    ... bench:          19 ns/iter (+/- 6)
test rust_siphash13::str_::_6    ... bench:          20 ns/iter (+/- 5)
test rust_siphash13::str_::_7    ... bench:          23 ns/iter (+/- 1)
test rust_siphash13::str_::_8    ... bench:          15 ns/iter (+/- 1)
test rust_siphash13::str_::_9    ... bench:          17 ns/iter (+/- 1)
test sip1b::int_u16              ... bench:          10 ns/iter (+/- 1)
test sip1b::int_u32              ... bench:           9 ns/iter (+/- 1)
test sip1b::int_u64              ... bench:          12 ns/iter (+/- 1)
test sip1b::int_u8               ... bench:           7 ns/iter (+/- 0)
test sip1b::slice::_10           ... bench:          12 ns/iter (+/- 1)
test sip1b::slice::_100          ... bench:          33 ns/iter (+/- 2)
test sip1b::slice::_11           ... bench:          13 ns/iter (+/- 0)
test sip1b::slice::_12           ... bench:          12 ns/iter (+/- 1)
test sip1b::slice::_2            ... bench:          10 ns/iter (+/- 0)
test sip1b::slice::_200          ... bench:          62 ns/iter (+/- 2)
test sip1b::slice::_3            ... bench:          10 ns/iter (+/- 1)
test sip1b::slice::_4            ... bench:           9 ns/iter (+/- 0)
test sip1b::slice::_5            ... bench:          10 ns/iter (+/- 1)
test sip1b::slice::_6            ... bench:          10 ns/iter (+/- 0)
test sip1b::slice::_7            ... bench:          11 ns/iter (+/- 0)
test sip1b::slice::_8            ... bench:          11 ns/iter (+/- 1)
test sip1b::slice::_9            ... bench:          12 ns/iter (+/- 1)
test sip1b::str_::_10            ... bench:          15 ns/iter (+/- 1)
test sip1b::str_::_100           ... bench:          37 ns/iter (+/- 3)
test sip1b::str_::_11            ... bench:          16 ns/iter (+/- 1)
test sip1b::str_::_12            ... bench:          14 ns/iter (+/- 1)
test sip1b::str_::_2             ... bench:          13 ns/iter (+/- 1)
test sip1b::str_::_200           ... bench:          67 ns/iter (+/- 5)
test sip1b::str_::_3             ... bench:          14 ns/iter (+/- 2)
test sip1b::str_::_4             ... bench:          12 ns/iter (+/- 1)
test sip1b::str_::_5             ... bench:          13 ns/iter (+/- 1)
test sip1b::str_::_6             ... bench:          13 ns/iter (+/- 0)
test sip1b::str_::_7             ... bench:          16 ns/iter (+/- 1)
test sip1b::str_::_8             ... bench:          14 ns/iter (+/- 1)
test sip1b::str_::_9             ... bench:          15 ns/iter (+/- 1)

test result: ok. 0 passed; 0 failed; 0 ignored; 62 measured

âžœ  siphash-bench git:(master) âœ— cargo benchcmp rust_siphash13:: sip1b:: benches.txt
 name         rust_siphash13:: ns/iter  sip1b:: ns/iter  diff ns/iter   diff %
 int_u16      12                        10                         -2  -16.67%
 int_u32      14                        9                          -5  -35.71%
 int_u64      11                        12                          1    9.09%
 int_u8       11                        7                          -4  -36.36%
 slice::_10   18                        12                         -6  -33.33%
 slice::_100  42                        33                         -9  -21.43%
 slice::_11   19                        13                         -6  -31.58%
 slice::_12   21                        12                         -9  -42.86%
 slice::_2    16                        10                         -6  -37.50%
 slice::_200  68                        62                         -6   -8.82%
 slice::_3    17                        10                         -7  -41.18%
 slice::_4    18                        9                          -9  -50.00%
 slice::_5    19                        10                         -9  -47.37%
 slice::_6    19                        10                         -9  -47.37%
 slice::_7    20                        11                         -9  -45.00%
 slice::_8    16                        11                         -5  -31.25%
 slice::_9    18                        12                         -6  -33.33%
 str_::_10    18                        15                         -3  -16.67%
 str_::_100   41                        37                         -4   -9.76%
 str_::_11    19                        16                         -3  -15.79%
 str_::_12    20                        14                         -6  -30.00%
 str_::_2     16                        13                         -3  -18.75%
 str_::_200   68                        67                         -1   -1.47%
 str_::_3     17                        14                         -3  -17.65%
 str_::_4     18                        12                         -6  -33.33%
 str_::_5     19                        13                         -6  -31.58%
 str_::_6     20                        13                         -7  -35.00%
 str_::_7     23                        16                         -7  -30.43%
 str_::_8     15                        14                         -1   -6.67%
 str_::_9     17                        15                         -2  -11.76%

```

from a modified hash-rs suite (preallocating maps and adding having slice/str variants)

graph version: http://imgur.com/a/DuoI4

```
âžœ  hash-rs git:(rfc-extend-hasher) âœ— cargo benchcmp sip13:: sip13opt:: benches.txt
 name                             sip13:: ns/iter      sip13opt:: ns/iter   diff ns/iter   diff %
 slice::mapcountdense_000000001   27,343 (36 MB/s)     26,401 (37 MB/s)             -942   -3.45%
 slice::mapcountdense_000000002   28,982 (69 MB/s)     26,807 (74 MB/s)           -2,175   -7.50%
 slice::mapcountdense_000000003   29,304 (102 MB/s)    27,360 (109 MB/s)          -1,944   -6.63%
 slice::mapcountdense_000000004   30,411 (131 MB/s)    25,888 (154 MB/s)          -4,523  -14.87%
 slice::mapcountdense_000000005   32,625 (153 MB/s)    27,486 (181 MB/s)          -5,139  -15.75%
 slice::mapcountdense_000000006   34,920 (171 MB/s)    27,204 (220 MB/s)          -7,716  -22.10%
 slice::mapcountdense_000000007   33,497 (208 MB/s)    28,330 (247 MB/s)          -5,167  -15.43%
 slice::mapcountdense_000000008   31,153 (256 MB/s)    28,617 (279 MB/s)          -2,536   -8.14%
 slice::mapcountdense_000000009   30,745 (292 MB/s)    29,666 (303 MB/s)          -1,079   -3.51%
 slice::mapcountdense_000000010   31,509 (317 MB/s)    29,804 (335 MB/s)          -1,705   -5.41%
 slice::mapcountdense_000000011   32,526 (338 MB/s)    30,520 (360 MB/s)          -2,006   -6.17%
 slice::mapcountdense_000000012   32,981 (363 MB/s)    28,739 (417 MB/s)          -4,242  -12.86%
 slice::mapcountdense_000000013   34,713 (374 MB/s)    30,348 (428 MB/s)          -4,365  -12.57%
 slice::mapcountdense_000000014   34,635 (404 MB/s)    29,974 (467 MB/s)          -4,661  -13.46%
 slice::mapcountdense_000000015   35,924 (417 MB/s)    30,584 (490 MB/s)          -5,340  -14.86%
 slice::mapcountdense_000000016   31,939 (500 MB/s)    30,564 (523 MB/s)          -1,375   -4.31%
 slice::mapcountdense_000000032   36,545 (875 MB/s)    34,833 (918 MB/s)          -1,712   -4.68%
 slice::mapcountdense_000000064   44,691 (1432 MB/s)   43,912 (1457 MB/s)           -779   -1.74%
 slice::mapcountdense_000000128   67,210 (1904 MB/s)   64,630 (1980 MB/s)         -2,580   -3.84%
 slice::mapcountdense_000000256   110,320 (2320 MB/s)  108,713 (2354 MB/s)        -1,607   -1.46%
 slice::mapcountsparse_000000001  29,686 (33 MB/s)     28,673 (34 MB/s)           -1,013   -3.41%
 slice::mapcountsparse_000000002  32,073 (62 MB/s)     30,519 (65 MB/s)           -1,554   -4.85%
 slice::mapcountsparse_000000003  33,184 (90 MB/s)     31,208 (96 MB/s)           -1,976   -5.95%
 slice::mapcountsparse_000000004  34,344 (116 MB/s)    30,242 (132 MB/s)          -4,102  -11.94%
 slice::mapcountsparse_000000005  34,536 (144 MB/s)    30,552 (163 MB/s)          -3,984  -11.54%
 slice::mapcountsparse_000000006  35,791 (167 MB/s)    30,813 (194 MB/s)          -4,978  -13.91%
 slice::mapcountsparse_000000007  36,773 (190 MB/s)    31,362 (223 MB/s)          -5,411  -14.71%
 slice::mapcountsparse_000000008  33,101 (241 MB/s)    32,399 (246 MB/s)            -702   -2.12%
 slice::mapcountsparse_000000009  34,025 (264 MB/s)    33,065 (272 MB/s)            -960   -2.82%
 slice::mapcountsparse_000000010  34,755 (287 MB/s)    33,152 (301 MB/s)          -1,603   -4.61%
 slice::mapcountsparse_000000011  35,682 (308 MB/s)    33,631 (327 MB/s)          -2,051   -5.75%
 slice::mapcountsparse_000000012  36,422 (329 MB/s)    32,604 (368 MB/s)          -3,818  -10.48%
 slice::mapcountsparse_000000013  37,561 (346 MB/s)    32,978 (394 MB/s)          -4,583  -12.20%
 slice::mapcountsparse_000000014  38,476 (363 MB/s)    33,376 (419 MB/s)          -5,100  -13.26%
 slice::mapcountsparse_000000015  39,202 (382 MB/s)    33,750 (444 MB/s)          -5,452  -13.91%
 slice::mapcountsparse_000000016  34,898 (458 MB/s)    33,621 (475 MB/s)          -1,277   -3.66%
 slice::mapcountsparse_000000032  39,767 (804 MB/s)    38,013 (841 MB/s)          -1,754   -4.41%
 slice::mapcountsparse_000000064  47,810 (1338 MB/s)   46,332 (1381 MB/s)         -1,478   -3.09%
 slice::mapcountsparse_000000128  64,519 (1983 MB/s)   63,322 (2021 MB/s)         -1,197   -1.86%
 slice::mapcountsparse_000000256  101,042 (2533 MB/s)  99,754 (2566 MB/s)         -1,288   -1.27%
 str_::mapcountdense_000000001    27,183 (36 MB/s)     24,007 (41 MB/s)           -3,176  -11.68%
 str_::mapcountdense_000000002    28,940 (69 MB/s)     24,574 (81 MB/s)           -4,366  -15.09%
 str_::mapcountdense_000000003    29,000 (103 MB/s)    24,687 (121 MB/s)          -4,313  -14.87%
 str_::mapcountdense_000000004    29,822 (134 MB/s)    24,377 (164 MB/s)          -5,445  -18.26%
 str_::mapcountdense_000000005    31,962 (156 MB/s)    25,184 (198 MB/s)          -6,778  -21.21%
 str_::mapcountdense_000000006    32,218 (186 MB/s)    25,020 (239 MB/s)          -7,198  -22.34%
 str_::mapcountdense_000000007    35,482 (197 MB/s)    27,705 (252 MB/s)          -7,777  -21.92%
 str_::mapcountdense_000000008    28,643 (279 MB/s)    25,563 (312 MB/s)          -3,080  -10.75%
 str_::mapcountdense_000000009    30,112 (298 MB/s)    26,773 (336 MB/s)          -3,339  -11.09%
 str_::mapcountdense_000000010    31,554 (316 MB/s)    27,607 (362 MB/s)          -3,947  -12.51%
 str_::mapcountdense_000000011    32,062 (343 MB/s)    27,770 (396 MB/s)          -4,292  -13.39%
 str_::mapcountdense_000000012    32,258 (372 MB/s)    25,612 (468 MB/s)          -6,646  -20.60%
 str_::mapcountdense_000000013    33,544 (387 MB/s)    26,908 (483 MB/s)          -6,636  -19.78%
 str_::mapcountdense_000000014    34,681 (403 MB/s)    27,267 (513 MB/s)          -7,414  -21.38%
 str_::mapcountdense_000000015    37,883 (395 MB/s)    30,226 (496 MB/s)          -7,657  -20.21%
 str_::mapcountdense_000000016    30,299 (528 MB/s)    27,960 (572 MB/s)          -2,339   -7.72%
 str_::mapcountdense_000000032    34,372 (930 MB/s)    32,736 (977 MB/s)          -1,636   -4.76%
 str_::mapcountdense_000000048    38,610 (1243 MB/s)   36,437 (1317 MB/s)         -2,173   -5.63%
 str_::mapcountdense_000000064    43,052 (1486 MB/s)   41,269 (1550 MB/s)         -1,783   -4.14%
 str_::mapcountdense_000000128    64,059 (1998 MB/s)   62,007 (2064 MB/s)         -2,052   -3.20%
 str_::mapcountdense_000000256    109,608 (2335 MB/s)  107,184 (2388 MB/s)        -2,424   -2.21%
 str_::mapcountsparse_000000001   29,155 (34 MB/s)     26,151 (38 MB/s)           -3,004  -10.30%
 str_::mapcountsparse_000000002   31,536 (63 MB/s)     27,787 (71 MB/s)           -3,749  -11.89%
 str_::mapcountsparse_000000003   32,524 (92 MB/s)     27,861 (107 MB/s)          -4,663  -14.34%
 str_::mapcountsparse_000000004   33,535 (119 MB/s)    27,585 (145 MB/s)          -5,950  -17.74%
 str_::mapcountsparse_000000005   34,239 (146 MB/s)    27,520 (181 MB/s)          -6,719  -19.62%
 str_::mapcountsparse_000000006   35,485 (169 MB/s)    27,437 (218 MB/s)          -8,048  -22.68%
 str_::mapcountsparse_000000007   39,098 (179 MB/s)    30,465 (229 MB/s)          -8,633  -22.08%
 str_::mapcountsparse_000000008   30,882 (259 MB/s)    29,215 (273 MB/s)          -1,667   -5.40%
 str_::mapcountsparse_000000009   33,375 (269 MB/s)    29,301 (307 MB/s)          -4,074  -12.21%
 str_::mapcountsparse_000000010   33,531 (298 MB/s)    29,008 (344 MB/s)          -4,523  -13.49%
 str_::mapcountsparse_000000011   34,607 (317 MB/s)    29,800 (369 MB/s)          -4,807  -13.89%
 str_::mapcountsparse_000000012   35,700 (336 MB/s)    28,380 (422 MB/s)          -7,320  -20.50%
 str_::mapcountsparse_000000013   36,692 (354 MB/s)    29,350 (442 MB/s)          -7,342  -20.01%
 str_::mapcountsparse_000000014   37,326 (375 MB/s)    29,285 (478 MB/s)          -8,041  -21.54%
 str_::mapcountsparse_000000015   41,098 (364 MB/s)    33,073 (453 MB/s)          -8,025  -19.53%
 str_::mapcountsparse_000000016   33,046 (484 MB/s)    30,717 (520 MB/s)          -2,329   -7.05%
 str_::mapcountsparse_000000032   37,471 (853 MB/s)    35,542 (900 MB/s)          -1,929   -5.15%
 str_::mapcountsparse_000000048   41,324 (1161 MB/s)   39,332 (1220 MB/s)         -1,992   -4.82%
 str_::mapcountsparse_000000064   45,858 (1395 MB/s)   43,802 (1461 MB/s)         -2,056   -4.48%
 str_::mapcountsparse_000000128   62,471 (2048 MB/s)   60,683 (2109 MB/s)         -1,788   -2.86%
 str_::mapcountsparse_000000256   101,283 (2527 MB/s)  97,655 (2621 MB/s)         -3,628   -3.58%
```

7 years agoAuto merge of #37270 - Mark-Simulacrum:smallvec-optimized-arenas, r=eddyb
bors [Wed, 26 Oct 2016 10:47:55 +0000 (03:47 -0700)]
Auto merge of #37270 - Mark-Simulacrum:smallvec-optimized-arenas, r=eddyb

Add ArrayVec and AccumulateVec to reduce heap allocations during interning of slices

Updates `mk_tup`, `mk_type_list`, and `mk_substs` to allow interning directly from iterators. The previous PR, #37220, changed some of the calls to pass a borrowed slice from `Vec` instead of directly passing the iterator, and these changes further optimize that to avoid the allocation entirely.

This change yields 50% less malloc calls in [some cases](https://pastebin.mozilla.org/8921686). It also yields decent, though not amazing, performance improvements:
```
futures-rs-test  4.091s vs  4.021s --> 1.017x faster (variance: 1.004x, 1.004x)
helloworld       0.219s vs  0.220s --> 0.993x faster (variance: 1.010x, 1.018x)
html5ever-2016-  3.805s vs  3.736s --> 1.018x faster (variance: 1.003x, 1.009x)
hyper.0.5.0      4.609s vs  4.571s --> 1.008x faster (variance: 1.015x, 1.017x)
inflate-0.1.0    3.864s vs  3.883s --> 0.995x faster (variance: 1.232x, 1.005x)
issue-32062-equ  0.309s vs  0.299s --> 1.033x faster (variance: 1.014x, 1.003x)
issue-32278-big  1.614s vs  1.594s --> 1.013x faster (variance: 1.007x, 1.004x)
jld-day15-parse  1.390s vs  1.326s --> 1.049x faster (variance: 1.006x, 1.009x)
piston-image-0. 10.930s vs 10.675s --> 1.024x faster (variance: 1.006x, 1.010x)
reddit-stress    2.302s vs  2.261s --> 1.019x faster (variance: 1.010x, 1.026x)
regex.0.1.30     2.250s vs  2.240s --> 1.005x faster (variance: 1.087x, 1.011x)
rust-encoding-0  1.895s vs  1.887s --> 1.005x faster (variance: 1.005x, 1.018x)
syntex-0.42.2   29.045s vs 28.663s --> 1.013x faster (variance: 1.004x, 1.006x)
syntex-0.42.2-i 13.925s vs 13.868s --> 1.004x faster (variance: 1.022x, 1.007x)
```

We implement a small-size optimized vector, intended to be used primarily for collection of presumed to be short iterators. This vector cannot be "upsized/reallocated" into a heap-allocated vector, since that would require (slow) branching logic, but during the initial collection from an iterator heap-allocation is possible.

We make the new `AccumulateVec` and `ArrayVec` generic over implementors of the `Array` trait, of which there is currently one, `[T; 8]`. In the future, this is likely to expand to other values of N.

Huge thanks to @nnethercote for collecting the performance and other statistics mentioned above.

7 years agoAuto merge of #36421 - TimNN:check-abis, r=alexcrichton
bors [Wed, 26 Oct 2016 04:49:59 +0000 (21:49 -0700)]
Auto merge of #36421 - TimNN:check-abis, r=alexcrichton

check target abi support

This PR checks for each extern function / block whether the ABI / calling convention used is supported by the current target.

This was achieved by adding an `abi_blacklist` field to the target specifications, listing the calling conventions unsupported for that target.

7 years agoFix typo, it bothered me
John Hodge [Wed, 26 Oct 2016 03:14:46 +0000 (11:14 +0800)]
Fix typo, it bothered me

7 years agoAdd size hint to Result's FromIterator implementation.
Mark-Simulacrum [Tue, 25 Oct 2016 00:24:24 +0000 (18:24 -0600)]
Add size hint to Result's FromIterator implementation.

7 years agoUtilize AccumulateVec to avoid heap allocations in mk_{substs, type_list, tup} calls.
Mark-Simulacrum [Tue, 25 Oct 2016 00:23:29 +0000 (18:23 -0600)]
Utilize AccumulateVec to avoid heap allocations in mk_{substs, type_list, tup} calls.

7 years agoAdd AccumulateVec, a potentially stack-allocated vector.
Mark-Simulacrum [Tue, 25 Oct 2016 00:22:59 +0000 (18:22 -0600)]
Add AccumulateVec, a potentially stack-allocated vector.

AccumulateVec is generic over the Array trait, which is currently only
implemented for [T; 8].

7 years agoAuto merge of #37361 - jseyfried:fix_crate_var_regressions, r=nrc
bors [Wed, 26 Oct 2016 00:54:13 +0000 (17:54 -0700)]
Auto merge of #37361 - jseyfried:fix_crate_var_regressions, r=nrc

Fix `$crate`-related regressions

Fixes #37345, fixes #37357, fixes #37352, and improves the `unused_extern_crates` lint.
r? @nrc

7 years agoAvoid false positive `unused_extern_crates`.
Jeffrey Seyfried [Sun, 23 Oct 2016 05:05:24 +0000 (05:05 +0000)]
Avoid false positive `unused_extern_crates`.

7 years agoSupport `use $crate;` with a future compatibility warning.
Jeffrey Seyfried [Sun, 23 Oct 2016 02:44:36 +0000 (02:44 +0000)]
Support `use $crate;` with a future compatibility warning.

7 years agoFix `$crate`-related regressions.
Jeffrey Seyfried [Sat, 22 Oct 2016 22:08:08 +0000 (22:08 +0000)]
Fix `$crate`-related regressions.

7 years agoiter: Implement .fold() for .chain()
Ulrik Sverdrup [Tue, 25 Oct 2016 13:21:49 +0000 (15:21 +0200)]
iter: Implement .fold() for .chain()

Chain can do something interesting here where it passes on the fold
into its inner iterators.

The lets the underlying iterator's custom fold() be used, and skips the
regular chain logic in next.

7 years agoAuto merge of #37111 - TimNN:sized-enums, r=nikomatsakis
bors [Tue, 25 Oct 2016 19:37:43 +0000 (12:37 -0700)]
Auto merge of #37111 - TimNN:sized-enums, r=nikomatsakis

Disallow Unsized Enums

Fixes #16812.

This PR is a potential fix for #16812, an issue which is reported [again](https://github.com/rust-lang/rust/issues/36801) and [again](https://github.com/rust-lang/rust/issues/36975), with over a dozen duplicates by now.

This PR is mainly meant to promoted discussion about the issue and the correct way to fix it.

This is a [breaking-change] since the error is now reported during wfchecking, so that even the definition of a (potentially) unsized enum will cause an error (whereas it would previously cause an ICE at trans time if the enum was used in an unsized manner).

7 years agoSmall improvement to SipHasher
arthurprs [Thu, 20 Oct 2016 22:09:59 +0000 (00:09 +0200)]
Small improvement to SipHasher

7 years agoadapt tests
Tim Neumann [Tue, 25 Oct 2016 17:56:36 +0000 (19:56 +0200)]
adapt tests

7 years agoVec docs: fix broken links and make quoting consistent
Duncan [Tue, 25 Oct 2016 01:22:54 +0000 (14:22 +1300)]
Vec docs: fix broken links and make quoting consistent

7 years agorun rustfmt on libcollectionstest
Srinivas Reddy Thatiparthy [Sun, 16 Oct 2016 10:18:22 +0000 (15:48 +0530)]
run rustfmt on libcollectionstest

7 years agorun rustfmt on librustc_metadata folder
Srinivas Reddy Thatiparthy [Sat, 22 Oct 2016 13:14:32 +0000 (18:44 +0530)]
run rustfmt on librustc_metadata folder

7 years agoAdd identifier to unused import warnings
Taylor Cramer [Tue, 25 Oct 2016 05:57:33 +0000 (22:57 -0700)]
Add identifier to unused import warnings

7 years agoFix typo
Zoffix Znet [Tue, 25 Oct 2016 14:03:55 +0000 (10:03 -0400)]
Fix typo

7 years agoiter: Implement .fold() for .cloned() and .map()
Ulrik Sverdrup [Tue, 25 Oct 2016 13:50:52 +0000 (15:50 +0200)]
iter: Implement .fold() for .cloned() and .map()

Implement .fold() specifically for .map() and .cloned() so that any
inner fold improvements are available through map and cloned.

7 years agoSpecial case .fold() for VecDeque's iterators
Ulrik Sverdrup [Tue, 25 Oct 2016 13:50:52 +0000 (15:50 +0200)]
Special case .fold() for VecDeque's iterators

7 years agoAuto merge of #37360 - jseyfried:fix_label_scope, r=nrc
bors [Tue, 25 Oct 2016 13:20:02 +0000 (06:20 -0700)]
Auto merge of #37360 - jseyfried:fix_label_scope, r=nrc

resolve: fix label scopes

Fixes #37353 (turns an ICE back into an error).
r? @nrc

7 years agoAuto merge of #37292 - jseyfried:import_macros_in_resolve, r=nrc
bors [Tue, 25 Oct 2016 06:15:59 +0000 (23:15 -0700)]
Auto merge of #37292 - jseyfried:import_macros_in_resolve, r=nrc

Process `#[macro_use]` imports in `resolve` and clean up macro loading

Groundwork macro modularization (cc #35896).
r? @nrc

7 years agoAuto merge of #37382 - jonathandturner:rollup, r=jonathandturner
bors [Mon, 24 Oct 2016 23:47:38 +0000 (16:47 -0700)]
Auto merge of #37382 - jonathandturner:rollup, r=jonathandturner

Rollup of 7 pull requests

- Successful merges: #37228, #37304, #37324, #37328, #37336, #37349, #37372
- Failed merges:

7 years agoRollup merge of #37372 - vtduncan:pathbuf-docs-link, r=steveklabnik
Jonathan Turner [Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)]
Rollup merge of #37372 - vtduncan:pathbuf-docs-link, r=steveklabnik

Link to PathBuf from the Path docs

I got stuck trying to use `Path` when `PathBuf` was what I needed. Hopefully this makes `PathBuf` and the module docs a bit easier to find for others.

r? @steveklabnik

7 years agoRollup merge of #37349 - srinivasreddy:meta_1, r=nikomatsakis
Jonathan Turner [Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)]
Rollup merge of #37349 - srinivasreddy:meta_1, r=nikomatsakis

rustfmt on metadata folder

7 years agoRollup merge of #37336 - michaelwoerister:debuginfo-type-ids, r=eddyb
Jonathan Turner [Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)]
Rollup merge of #37336 - michaelwoerister:debuginfo-type-ids, r=eddyb

debuginfo: Use TypeIdHasher for generating global debuginfo type IDs.

The only requirement for debuginfo type IDs is that they are globally unique. The `TypeIdHasher` (which is used for `std::intrinsic::type_id()` provides that, so we can get rid of some redundancy by re-using it for debuginfo. Values produced by the `TypeIdHasher` are also more stable than the current `UniqueTypeId` generation algorithm produces -- these incorporate the `NodeId`s, which is not good for incremental compilation.

@alexcrichton @eddyb : Could you take a look at the endianess adaptations that I made to the `TypeIdHasher`?

Also, are we sure that a 64 bit hash is wide enough for something that is supposed to be globally unique? For debuginfo I'm using 160 bits to make sure that we don't run into conflicts there.

7 years agoRollup merge of #37328 - michaelwoerister:stable-local-symbol-names, r=nagisa
Jonathan Turner [Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)]
Rollup merge of #37328 - michaelwoerister:stable-local-symbol-names, r=nagisa

trans: Make names of internal symbols independent of CGU translation order

Every codegen unit gets its own local counter for generating new symbol names. This makes bitcode and object files reproducible at the binary level even when incremental compilation is used.

The PR also solves a rare ICE resulting from a naming conflict between a user defined name and a generated one. E.g. try compiling the following program with 1.12.1 stable:
```rust

pub fn str7233() -> &'static str { "foo" }
```
This results in:
> error: internal compiler error: ../src/librustc_trans/common.rs:979: symbol `str7233` is already defined

Running into this is not very likely but it's also easily avoidable.

7 years agoRollup merge of #37324 - GuillaumeGomez:trait_error_message, r=jonathandturner
Jonathan Turner [Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)]
Rollup merge of #37324 - GuillaumeGomez:trait_error_message, r=jonathandturner

Improve E0277 help message

Fixes #37319.

r? @jonathandturner

7 years agoRollup merge of #37304 - GuillaumeGomez:collections_url, r=frewsxcv
Jonathan Turner [Mon, 24 Oct 2016 22:41:28 +0000 (15:41 -0700)]
Rollup merge of #37304 - GuillaumeGomez:collections_url, r=frewsxcv

Add missing urls in collections module

r? @steveklabnik

7 years agoRollup merge of #37228 - loggerhead:patch-1, r=steveklabnik
Jonathan Turner [Mon, 24 Oct 2016 22:41:28 +0000 (15:41 -0700)]
Rollup merge of #37228 - loggerhead:patch-1, r=steveklabnik

Fix a error of 'book/deref-coercions.html'

The original sentence is:

> This example has two conversions: `Rc<String>` to `String` and then `String` to `&str`.

But it should be

> This example has two conversions: `Rc<String>` to `String` and then `String` to `str`.

or

> This example has two conversions: `&Rc<String>` to `&String` and then `&String` to `&str`.

I think the latter is more clearly.

r? @steveklabnik

7 years agoadd new test case
Tim Neumann [Mon, 24 Oct 2016 19:40:43 +0000 (21:40 +0200)]
add new test case

7 years agoAuto merge of #37313 - raphlinus:fuchsia, r=alexcrichton
bors [Mon, 24 Oct 2016 20:31:29 +0000 (13:31 -0700)]
Auto merge of #37313 - raphlinus:fuchsia, r=alexcrichton

Add Fuchsia support

Adds support for the x86_64-unknown-fuchsia target, which covers the
Fuchsia operating system.

7 years agoadapt existing tests
Tim Neumann [Mon, 24 Oct 2016 18:55:56 +0000 (20:55 +0200)]
adapt existing tests

7 years agodisallow unsized enums
Tim Neumann [Wed, 12 Oct 2016 10:40:48 +0000 (12:40 +0200)]
disallow unsized enums

7 years agoAuto merge of #37365 - alexcrichton:fix-nightlies, r=brson
bors [Mon, 24 Oct 2016 15:46:28 +0000 (08:46 -0700)]
Auto merge of #37365 - alexcrichton:fix-nightlies, r=brson

Try to fix the nightlies

Touching up a few pieces after  the fix for #37280 landed.

7 years agoAdapt rmake-test to new naming scheme for internal symbols.
Michael Woerister [Mon, 24 Oct 2016 15:07:45 +0000 (11:07 -0400)]
Adapt rmake-test to new naming scheme for internal symbols.

7 years agodebuginfo: Erase regions when creating debuginfo for statics.
Michael Woerister [Mon, 24 Oct 2016 14:27:05 +0000 (10:27 -0400)]
debuginfo: Erase regions when creating debuginfo for statics.

7 years agocheck target abi support
Tim Neumann [Mon, 24 Oct 2016 09:04:04 +0000 (11:04 +0200)]
check target abi support

7 years agoLink to PathBuf from the Path docs
Duncan [Mon, 24 Oct 2016 03:12:37 +0000 (16:12 +1300)]
Link to PathBuf from the Path docs

7 years agoAuto merge of #37322 - nnethercote:CombineFields-instantiate, r=eddyb
bors [Mon, 24 Oct 2016 03:10:16 +0000 (20:10 -0700)]
Auto merge of #37322 - nnethercote:CombineFields-instantiate, r=eddyb

Use `SmallVector` in `CombineFields::instantiate`.

This avoids 4% of malloc calls when compiling
rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other
benchmarks. A small win, but an easy one.

7 years agoUse `SmallVector` in `CombineFields::instantiate`.
Nicholas Nethercote [Fri, 21 Oct 2016 09:22:28 +0000 (20:22 +1100)]
Use `SmallVector` in `CombineFields::instantiate`.

This avoids 4% of malloc calls when compiling
rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other
benchmarks. A small win, but an easy one.