Commit Graph

58719 Commits

Author SHA1 Message Date
Alex Crichton
2d71be5780 Rollup merge of #37067 - jseyfried:expand_derives_last, r=alexcrichton
macros: expand `#[derive]`s after other attribute macros and improve intra-`#[derive]` ordering

Fixes https://github.com/serde-rs/serde/issues/577.
cc #35900
r? @alexcrichton
2016-10-12 14:07:56 -07:00
Alex Crichton
920f10950a Rollup merge of #37066 - nrc:stderr, r=alexcrichton
Error monitor should emit error to stderr instead of stdout

We are pretty consistent about emitting to stderr, except for when there is actually an error, in which case we emit to stdout. This seems a bit backwards. This PR just changes that exception to emit to stderr. This is useful for the RLS since the LS protocol uses stdout (grrr).

r? @alexcrichton
2016-10-12 14:07:56 -07:00
Alex Crichton
f05bd1b41d Rollup merge of #37064 - nnethercote:read_str, r=eddyb
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-12 14:07:56 -07:00
Alex Crichton
a0ad6616fc Rollup merge of #37056 - Mark-Simulacrum:fix-bool-comparison, r=bluss
Add comparison operators to boolean const eval.

I think it might be worth adding tests here, but since I don't know how or where to do that, I have not done so yet. Willing to do so if asked and given an explanation as to how.

Fixes #37047.
2016-10-12 14:07:55 -07:00
Alex Crichton
5ac7f4fc31 Rollup merge of #37050 - frewsxcv:librustdoc, r=alexcrichton
librustdoc refactoring and cleanup.
2016-10-12 14:07:55 -07:00
Alex Crichton
4e65489e77 Rollup merge of #37049 - srinivasreddy:librustc_lint, r=nrc
run rustfmt on librustc_lint folder
2016-10-12 14:07:55 -07:00
Alex Crichton
65fc3ef1f4 Rollup merge of #37023 - jseyfried:fix_extern_crate_back_compat, r=nrc
Fix importing inaccessible `extern crate`s (with a warning)

Fixes #36747, fixes #37020, and fixes #37021.
r? @nrc
2016-10-12 14:07:55 -07:00
Alex Crichton
9d70ff384f Rollup merge of #36995 - nrc:stable, r=@nikomatsakis
stabilise ?, attributes on stmts, deprecate Reflect

r? @nikomatsakis
2016-10-12 14:07:55 -07:00
Alex Crichton
d13b102c54 Rollup merge of #36991 - wesleywiser:fixme_1, r=arielb1
Move IdxSetBuf and BitSlice to rustc_data_structures

Resolves a FIXME
2016-10-12 14:07:54 -07:00
est31
87cbfb455f Change color and make ? bold 2016-10-12 22:45:41 +02:00
bors
9cb01365ee Auto merge of #36762 - achanda:sockaddr_type, r=alexcrichton
Add two functions to check type of SockAddr

These can be used to determine the type of the underlying IP
address

r? @alexcrichton
2016-10-12 11:28:53 -07:00
Srinivas Reddy Thatiparthy
5457c35ece
run rustfmt on libcore/num folder 2016-10-12 23:57:46 +05:30
Niko Matsakis
b486a8757c add test case for changing private methods 2016-10-12 14:18:03 -04:00
Srinivas Reddy Thatiparthy
6a738c6a8a
run rustfmt on liblog 2016-10-12 23:45:03 +05:30
Srinivas Reddy Thatiparthy
ca397681bb
run rustfmt on librand 2016-10-12 23:40:25 +05:30
Alex Burka
1eb36b80a4 book: remove backticks in Type Aliases header
Fix #37116.
2016-10-12 13:44:08 -04:00
Felix S. Klock II
0562654608 Some tests to check that lifetime parametric fn's do not trip up LLVM. 2016-10-12 19:29:50 +02:00
Felix S. Klock II
f166930dfa Inject bitcast if types mismatch when building a store instruction. 2016-10-12 19:26:06 +02:00
Alex Crichton
091b547122 Rollup merge of #36831 - michaelwoerister:ich-updates, r=nikomatsakis
incr.comp.: Minor refactoring and update to struct ICH test case

r? @nikomatsakis
2016-10-12 10:15:26 -07:00
Alex Crichton
76fb6e7761 Rollup merge of #36762 - achanda:sockaddr_type, r=alexcrichton
Add two functions to check type of SockAddr

These can be used to determine the type of the underlying IP
address

r? @alexcrichton
2016-10-12 10:15:25 -07:00
Guillaume Gomez
96a8bae3da add missing urls for BufWriter and BufReader 2016-10-12 18:27:04 +02:00
Felix S. Klock II
fa7f69cdaa tests for #[may_dangle] attribute. 2016-10-12 18:24:23 +02:00
Felix S. Klock II
e185cd5190 Fix bug in test for E0199 and add test for E0198.
In particular, as far as I can tell from the error diagnostics, the
former test for E0199 was actually a test for E0198, and there was no
test for E0198.

(I am assuming that one of my previous changes to the `unsafe impl`
checking fixed a latent bug in how these two cases were
differentiated.)
2016-10-12 18:23:23 +02:00
Felix S. Klock II
9a649c328c Require destructors using #[may_dangle] to use unsafe impl. 2016-10-12 18:23:20 +02:00
Felix S. Klock II
97e4143558 Fix ICE by injecting bitcasts if types mismatch when building invokes or calls. 2016-10-12 17:36:50 +02:00
arthurprs
c435821d16 Cache conscious hashmap table 2016-10-12 17:07:09 +02:00
bors
acb50e3481 Auto merge of #36737 - srinivasreddy:check, r=nrc
Run rustfmt on librustc_typeck/check/ folder
2016-10-12 05:29:09 -07:00
Tobias Bucher
744aecf793 Remove unnecessary unsafe block 2016-10-12 13:06:55 +02:00
Tim Neumann
7badc32005 normalize tuple pair types 2016-10-12 12:20:10 +02:00
bors
a29c49f5cc Auto merge of #37095 - petrochenkov:metactor, r=alexcrichton
Temporary fix for metadata decoding for struct constructors

Same as https://github.com/rust-lang/rust/pull/37078, but for nightly.
Ideally, metadata lookup functions should "just work" for constructor ids, but this fixes the issue as well.

Fixes https://github.com/rust-lang/rust/issues/37026
r? @alexcrichton
2016-10-11 23:36:29 -07:00
Adam Perry
70569b3d2d Using a type alias of Slice<Kind<'tcx>> to intern Substs<'tcx>.
Fixing now incorrect Hash impl for TransItem.
Using as_ptr() rather than a pointer cast for string formatting.
Fixing Borrow and Lift impls for Substs.
Move usages of tcx.mk_substs to Substs::new iterator-based version.
2016-10-11 22:12:13 -07:00
est31
6a89b8fd0a rustdoc: color the question mark operator
The idea was proposed by eddyb in: https://github.com/rust-lang/rust/issues/31436#issuecomment-247426582
2016-10-12 05:39:57 +02:00
Matthew Piziak
db1e85d092 remove erroneous semicolons 2016-10-11 20:17:52 -04:00
bors
0b2c356420 Auto merge of #37090 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 9 pull requests

- Successful merges: #36679, #36699, #36997, #37040, #37060, #37065, #37072, #37073, #37081
- Failed merges:
2016-10-11 13:29:02 -07:00
Vadim Petrochenkov
f5827d08d9 Temporary fix for metadata decoding for struct constructors 2016-10-11 23:04:29 +03:00
Matthew Piziak
dba66788bd replace MIN/MAX constants with min_value/max_value functions
MIN and MAX were breaking the build for me. min_value and max_value do not.
2016-10-11 15:59:04 -04:00
Nick Cameron
79b5177378 Review changes 2016-10-12 08:40:23 +13:00
Nick Cameron
14c62f91b7 Deprecate Reflect
[tracking issue](https://github.com/rust-lang/rust/issues/27749)
2016-10-12 08:40:22 +13:00
Nick Cameron
a94f5934cd Stabilise attributes on statements.
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag.

cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
2016-10-12 08:40:22 +13:00
Nick Cameron
9bc6d26092 Stabilise ?
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-12 08:40:22 +13:00
Florian Hartwig
63ee8d0bbc Specialize Vec::extend to Vec::extend_from_slice 2016-10-11 19:45:09 +02:00
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