Commit Graph

48241 Commits

Author SHA1 Message Date
bors
15e7824f1c Auto merge of #29712 - Toby-S:patch-1, r=steveklabnik
Adds `Example` sections to the rest of the integer methods.

cc @steveklabnik
2015-11-12 18:00:27 +00:00
bors
098ea17556 Auto merge of #29757 - dotdash:mir_simplify_cfg, r=nikomatsakis
For now, this pass does some easy transformations, like eliminating
empty blocks that just jump to another block, some trivial
conversion of If terminators into Gotos and removal of dead blocks.

r? @nikomatsakis
2015-11-12 15:48:34 +00:00
Antti Keränen
39c50f74e1 Add feature gate test for #[fundamental] attribute 2015-11-12 16:05:56 +02:00
Björn Steinbrink
a4e5c0fe84 Add a MIR pass to simplify the control flow graph
For now, this pass does some easy transformations, like eliminating
empty blocks that just jump to another block, some trivial
conversion of If terminators into Gotos and removal of dead blocks.
2015-11-12 14:39:23 +01:00
bors
8c9c9513cf Auto merge of #29544 - Ryman:reduce_doc_warnings, r=steveklabnik
Did this alphabetically, so I didn't see [how `std` was doing things](https://dxr.mozilla.org/rust/source/src/libstd/lib.rs#215) till I was nearly finished. If you prefer to add crate-level-whitelists like std instead of test-level, I can rebase with that strategy.

A number of these commits can probably be dropped as the crates don't have much to test, and are deprecated. Let me know which if any to drop! (can also squash after review if desired)

r? @steveklabnik
2015-11-12 13:07:45 +00:00
bors
0bd708461b Auto merge of #29770 - ollie27:assert_eq_unsized, r=alexcrichton
`format_args!` doesn't support none Sized types so we should just pass it the references to `left_val` and `right_val`.

The following works:
```rust
assert!([1, 2, 3][..] == vec![1, 2, 3][..])
```
So I would expect this to as well:
```rust
assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])
```
But it fails with "error: the trait `core::marker::Sized` is not implemented for the type `[_]` [E0277]"
I don't know if this change will have any nasty side effects I don't understand.
2015-11-12 10:38:48 +00:00
Oliver Schneider
8488eebe9c remove bool -> int conversion in const evaluator
the const evaluator has a bool constant value, no need to use integers
2015-11-12 11:30:04 +01:00
Barosl Lee
0b510641d3 Improve the detailed error message for E0432
The command-line error message for E0432 does mention the possibility of
missing the `extern crate` declaration, but the detailed error message
for it doesn't.

Fixes #29517.
2015-11-12 18:11:55 +09:00
bors
afd4a5420c Auto merge of #29795 - Manishearth:rollup, r=Manishearth
- Successful merges: #29776, #29785, #29786, #29787
- Failed merges:
2015-11-12 08:02:43 +00:00
Manish Goregaokar
d1d573d8a8 Fixup #29785 2015-11-12 13:20:48 +05:30
Manish Goregaokar
4f655382c8 Fixup #29776 2015-11-12 13:20:16 +05:30
Manish Goregaokar
8844190801 Rollup merge of #29787 - dbrgn:docs-fix, r=steveklabnik
Fix usage of wrong article in `Result` docs.

This is my first rust PR, if something about the process is wrong let me know.

As this is a documentation change, I believe the correct highfive line to use is the following:

r? @steveklabnik
2015-11-12 13:18:51 +05:30
Manish Goregaokar
a8b6697a32 Rollup merge of #29786 - steveklabnik:stage0fix, r=brson 2015-11-12 13:18:51 +05:30
Manish Goregaokar
5b55b8d2e5 Rollup merge of #29785 - steveklabnik:doc_prelude, r=nikomatsakis
This mostly brings them in line with existing linking convention, but
also has some minor re-wording.

The text at the top has been re-focused, by starting out with what the
prelude does, rather than starting from injecting std.

Also, it now mentions that other preludes exist.

Part of https://github.com/rust-lang/rust/issues/29369
2015-11-12 13:18:51 +05:30
Manish Goregaokar
b7f6d7239b Rollup merge of #29776 - nikomatsakis:mir-29740, r=nrc
In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to #29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.

~~Note that this builds on https://github.com/rust-lang/rust/pull/29763 which will hopefully land soon. So ignore the first few commits.~~ landed now

r? @Aatch since he's been reviewing the other commits in this series
2015-11-12 13:18:51 +05:30
Alexander Bulaev
8ce9c19b5b Remove impls for cases considered niche 2015-11-12 10:40:02 +03:00
Kevin Butler
5ae1937129 trpl: add a small section outlining doctest configuration 2015-11-12 05:17:11 +00:00
Kevin Butler
8e23e2fbcb libtest: deny warnings in doctests 2015-11-12 05:17:07 +00:00
Kevin Butler
c0fc402ab6 libterm: deny warnings in doctests 2015-11-12 05:17:02 +00:00
Kevin Butler
d64e551248 libsyntax: deny warnings in doctests 2015-11-12 05:16:57 +00:00
Kevin Butler
a17f81b4b7 libserialize: deny warnings in doctests 2015-11-12 05:16:53 +00:00
Kevin Butler
7ee329ac6e librustc_unicode: deny warnings in doctests 2015-11-12 05:16:48 +00:00
Kevin Butler
a715dd52e7 librbml: deny warnings in doctests 2015-11-12 05:16:43 +00:00
Kevin Butler
86c55e7d99 librand: deny warnings in doctests 2015-11-12 05:16:38 +00:00
Kevin Butler
d28d000ef9 liblog: deny warnings in doctests 2015-11-12 05:16:34 +00:00
Kevin Butler
ac36e10e2f libgraphviz: deny warnings in doctests 2015-11-12 05:16:29 +00:00
Kevin Butler
82ad9738b3 libgetopts: deny warnings in doctests 2015-11-12 05:16:24 +00:00
Kevin Butler
e3976cda64 libfmt_macros: deny warnings in doctests 2015-11-12 05:16:20 +00:00
Kevin Butler
0226fa17cc libflate: deny warnings in doctests 2015-11-12 05:16:14 +00:00
Kevin Butler
82784cb89d libcore: deny warnings in doctests 2015-11-12 05:16:08 +00:00
Kevin Butler
bbf964afea libcollections: deny warnings in doctests 2015-11-12 05:15:55 +00:00
Kevin Butler
89a8203898 libarena: deny warnings in doctests 2015-11-12 05:15:29 +00:00
Kevin Butler
7dbff09e57 liballoc: deny warnings in doctests 2015-11-12 05:15:08 +00:00
bors
3bd622f94c Auto merge of #29764 - nrc:stats, r=nikomatsakis
Emits loc, and node count - before and after expansion.

E.g.,

```
rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
Lines of code:             32060
Pre-expansion node count:  120205
Post-expansion node count: 482749
```

r? @nikomatsakis
2015-11-12 04:06:48 +00:00
bors
35decad781 Auto merge of #29616 - nagisa:mir-repeat, r=nikomatsakis
r? @nikomatsakis

I went ahead and replaced repeat count with a `Constant`, because it cannot be non-constant to the best of my knowledge.
2015-11-12 02:24:06 +00:00
Niko Matsakis
a5e3625a55 ignore pretty since it dies for some mysterious reason I can't be
bothered to track down for a regresson test. /me hopes no one notices
2015-11-11 18:54:54 -05:00
bors
cc30948720 Auto merge of #29748 - petrochenkov:issue29746, r=nrc
Closes https://github.com/rust-lang/rust/issues/29746
2015-11-11 23:31:51 +00:00
Simonas Kazlauskas
e4e880df37 Const-eval array element repetition count 2015-11-12 01:30:17 +02:00
Danilo Bargen
9b5b0cd9b9 Fix article in Result.map and Result.map_err documentation 2015-11-12 00:02:56 +01:00
Vadim Petrochenkov
fba1926a2f Fix hygiene regression in patterns 2015-11-12 01:49:23 +03:00
Oliver Middleton
780581e8a1 Add test for assert_eq! with none Sized types 2015-11-11 22:08:20 +00:00
Steve Klabnik
f42af6464a Fix import warnings for stage0 2015-11-11 17:01:52 -05:00
Steve Klabnik
a1b24768a6 Clean up the prelude docs
This mostly brings them in line with existing linking convention, but
also has some minor re-wording.

The text at the top has been re-focused, by starting out with what the
prelude does, rather than starting from injecting std.

Also, it now mentions that other preludes exist.

Part of https://github.com/rust-lang/rust/issues/29369
2015-11-11 17:00:09 -05:00
Niko Matsakis
662232c8f6 Rewrite match algorithm to avoid massive blowup in generated code for
large matches that fallback to Eq. When we encounter a case where the
test being performed does not inform the candidate at all, we just stop
testing the candidates at that point, rather than adding the candidate
to both outcomes. The former behavior was not WRONG, but it generated a
lot of code, whereas this new behavior degenerates to an if-else-if
tree.

Fixes #29740.
2015-11-11 16:38:58 -05:00
bors
b8eaa1605a Auto merge of #29778 - Manishearth:rollup, r=Manishearth
- Successful merges: #29677, #29772, #29775, #29777
- Failed merges:
2015-11-11 20:39:49 +00:00
Manish Goregaokar
26705657e4 Fixup tidy 2015-11-12 02:08:37 +05:30
Nick Cameron
f7dc917ba4 Add -Zinput-stats
Emits loc, and node count - before and after expansion.

E.g.,

```
rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
Lines of code:             32060
Pre-expansion node count:  120205
Post-expansion node count: 482749
```
2015-11-12 09:23:37 +13:00
Kyle Mayes
8c88308c68 libsyntax: Add more quasiquoting macros 2015-11-11 15:19:01 -05:00
Manish Goregaokar
98b5285703 Rollup merge of #29777 - Manishearth:const_irrefutable_diag, r=eddyb
None
2015-11-12 00:59:31 +05:30
Manish Goregaokar
3ef3fd96cf Rollup merge of #29775 - arcnmx:raw-c_char, r=alexcrichton
It's a bit strange to expect users of `libstd` to require the use of an external crates.io crate to work with standard types. This commit encourages the use `os::raw::c_char` instead, although users are certainly free to use `libc::c_char` if they wish; the test still exists to ensure the two types are identical (though the reported bug only exists on platforms that are not officially tested).

Fixes #29774
2015-11-12 00:59:30 +05:30