Commit Graph

74791 Commits

Author SHA1 Message Date
bors
928435305a Auto merge of #48052 - eddyb:deggregate, r=nikomatsakis
rustc_mir: handle all aggregate kinds in, and always run, the deaggregator.

This helps with removing`Rvalue::Aggregate` from the MIR, and with enabling more optimizations.
r? @nikomatsakis
2018-02-23 02:21:06 +00:00
Niko Matsakis
0a5f4aebb1 move test to the proper directory and test #[bench] 2018-02-22 20:16:30 -05:00
Niko Matsakis
a0562ec369 delete this test file: it also appears as
src/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs
2018-02-22 20:16:06 -05:00
varkor
8b2037c6fe Introduce UnpackedKind
This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker should catch more potential issues.
2018-02-23 01:13:54 +00:00
Niko Matsakis
e0ed88df3d add test for fn main() -> ! 2018-02-22 20:10:36 -05:00
Niko Matsakis
067c2e3d03 handle #[bench] functions better 2018-02-22 20:09:10 -05:00
Niko Matsakis
31f66a060c reset default binding mode when we pass through a & pattern
Fixes #46688.
2018-02-22 19:47:03 -05:00
Santiago Pastorino
6a74615fe3
Run rustfmt over bitvec.rs and region_infer/values.rs 2018-02-22 21:27:52 -03:00
Santiago Pastorino
aa3409c898
Fix typo otherwies -> otherwise 2018-02-22 21:27:52 -03:00
Santiago Pastorino
ff9eb56c6e
Use Sparse bitsets instead of dense ones for NLL results
Fixes #48170
2018-02-22 21:27:26 -03:00
Niko Matsakis
8f35141fba remove tokenstream 2018-02-22 18:26:01 -05:00
bors
5de90898de Auto merge of #48343 - Mark-Simulacrum:release-step, r=kennytm
Update nightly to 1.26.0 and bootstrap from beta.
2018-02-22 23:25:39 +00:00
Santiago Pastorino
e5d79c4bc7
Move word type and word size usage to constants & make it of 128 bits 2018-02-22 20:15:53 -03:00
Niko Matsakis
5f1e78f19a move Termination trait to std::process 2018-02-22 17:57:08 -05:00
Niko Matsakis
e446f706a8 put the "unit test" logic into libtest
Also make `std::termination` module public and rename feature.

The lib feature needs a different name from the language feature.
2018-02-22 17:56:24 -05:00
Niko Matsakis
0625d4c282 begin crate-relative paths with crate 2018-02-22 17:31:37 -05:00
Niko Matsakis
1eab1b19a3 support unit tests with return values that implement Terminaton
Extend `Termination` trait with a method to determine what happens
with a unit test.

This commit incorporates work by Bastian Köcher <git@kchr.de>.
2018-02-22 17:31:37 -05:00
Vadim Petrochenkov
98eb4ddbce Fix parsing of extern paths in types and poly-traits 2018-02-23 00:54:30 +03:00
Matt Brubeck
311fbc9265 [docs] Minor wording changes to drain_filter docs
The docs currently say, "If the closure returns false, it will try
again, and call the closure on the next element."  But this happens
regardless of whether the closure returns true or false.
2018-02-22 12:05:30 -08:00
Anthony Deschamps
e88fe1d519 Small grammar fix to docs for String::new(). 2018-02-22 14:21:54 -05:00
toidiu
4d8b251835
update tracking issue for nll
Point to the new tracing issue for nll
2018-02-22 09:13:44 -05:00
bors
b1f8e6fb06 Auto merge of #48399 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 12 pull requests

- Successful merges: #47379, #47833, #48106, #48198, #48314, #48325, #48335, #48352, #48354, #48360, #48382, #48397
- Failed merges:
2018-02-22 11:25:16 +00:00
Tatsuyuki Ishi
5a2bec9f45 impl_or_trait_obligations: deduplicate obligations 2018-02-22 18:40:49 +09:00
Tatsuyuki Ishi
619ad716d1 Fix exponential blowup on nested types 2018-02-22 18:40:49 +09:00
Tatsuyuki Ishi
93e6b0d643 Remove needless dedup from projection 2018-02-22 16:57:39 +09:00
Tatsuyuki Ishi
0e26bb7287 Revert "Implement Ord as necessary"
This reverts commit c6772b4dcb.
2018-02-22 16:57:39 +09:00
QuietMisdreavus
8872e7b593 add test for issue 48414 ICE 2018-02-21 19:58:20 -06:00
QuietMisdreavus
bca3b31ab9 proper early-bail condition 2018-02-21 19:57:48 -06:00
QuietMisdreavus
ef30a8fd1c track extern traits being inlined 2018-02-21 18:33:42 -06:00
QuietMisdreavus
d98449d110 manually release cx.external_traits while building the new trait 2018-02-21 17:44:49 -06:00
steveklabnik
ef48e0f2b9 Update the book to promote second edition
This updates the book repository, but mostly to include
https://github.com/rust-lang/book/pull/1180

TL;DR: the second edition is close enough to done that we should
universally recommend it over the first edition.
2018-02-21 14:26:09 -05:00
Eduard-Mihai Burtescu
713b05f072 rustc_data_structures: add missing #[inline]. 2018-02-21 19:21:26 +02:00
Guillaume Gomez
24c17cb1a8
Rollup merge of #48397 - ordovicia:pow_doc, r=GuillaumeGomez
Take 2^5 as examples in document of pow()

Fixes #48396 by taking 2^5 as examples.
2018-02-21 16:29:57 +01:00
Guillaume Gomez
c118d37ac4
Rollup merge of #48382 - GuillaumeGomez:fix-rustdoc-test-panic, r=estebank
Fix rustdoc test ICE

Fixes #48377.

r? @QuietMisdreavus
2018-02-21 16:29:56 +01:00
Guillaume Gomez
d9f5eeb57e
Rollup merge of #48360 - redcape:redcape-count-doc-fix, r=cramertj
Fix count usize link typo in docs

The docs point to isize when the link should be going to usize instead. Fix the doc.
2018-02-21 16:29:55 +01:00
Guillaume Gomez
d6e649a631
Rollup merge of #48354 - m0ppers:add-read-until-link, r=aidanhs
Add missing link for read_line

Seems I found a missing link 🔗

https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#errors-2
2018-02-21 16:29:54 +01:00
Guillaume Gomez
37463272a7
Rollup merge of #48352 - JakubAdamWieczorek:mailmap, r=petrochenkov
Update .mailmap with my real name

Good morning, the Rust team!

Once upon a time I was a modest-scale contributor. Sadly, various turbulences made me step away from my participation in the project. It's great to see how far it's gone.

I would appreciate it if you accepted this small change to the .mailmap file so that it shows my real name as back then I was using an alias. If doubts arise if I am the same person, I will be happy to provide further evidence. :)

Kind regards.
2018-02-21 16:29:53 +01:00
Guillaume Gomez
fe1293f8a9
Rollup merge of #48335 - Manishearth:shortcut-links, r=QuietMisdreavus
Implement implied shortcut links for intra-rustdoc-links

cc https://github.com/rust-lang/rust/issues/43466

Needs https://github.com/google/pulldown-cmark/pull/126

r? @QuietMisdreavus
2018-02-21 16:29:52 +01:00
Guillaume Gomez
27c6ff5c7c
Rollup merge of #48325 - frewsxcv:frewxcv-ignore, r=steveklabnik
Mark doc examples w/ `extern` blocks as `ignore`.

Fixes https://github.com/rust-lang/rust/issues/48218.
2018-02-21 16:29:51 +01:00
Guillaume Gomez
cb618ea195
Rollup merge of #48314 - frewsxcv:frewsxcv-broken-link, r=GuillaumeGomez
Fix broken documentation link.

None
2018-02-21 16:29:50 +01:00
Guillaume Gomez
ad83b47802
Rollup merge of #48198 - csmoe:inform_type_annotations, r=estebank
inform user where to give a type annotation

should resolve #47777
previous pull request https://github.com/rust-lang/rust/pull/47982 was closed because of a mistaken rebase.
r? @estebank
2018-02-21 16:29:48 +01:00
Guillaume Gomez
f0343cbd1f
Rollup merge of #48106 - QuietMisdreavus:teleporting-crates, r=GuillaumeGomez
rustdoc: move manual "extern crate" statements outside automatic "fn main"s in doctests

Gated on https://github.com/rust-lang/rust/pull/48095 - I based the branch atop that so i could show off the change in one of its tests, the actual change in this PR is just the last commit

There are a handful of unfortunate assumptions in the way rustdoc processes `extern crate` statements in doctests:

1. In the absence of an `extern crate` statement in the test, if the test also uses the local crate name, it will automatically insert an `extern crate cratename;` statement into the test.
2. If the doctest *does* include an `extern crate` statement, rustdoc will not automatically insert one, on the assumption that doing so would introduce a duplicate import.
3. If a doctest does not have the substring `fn main` outside a comment, rustdoc will wrap the whole doctest in a generated `fn main` so it can be compiled.

In short, whenever you write a doctest like this...

```rust
//! extern crate my_crate;
//! my_crate::some_cool_thing();
```

...rustdoc will turn it into (something like) this:

```rust
fn main() {
extern crate my_crate;
my_crate::some_cool_thing();
}
```

This creates issues when compiled, because now `my_crate` isn't even properly in scope! This forces people who want to have multiple crates in their doctests (or an explicit `extern crate` statement) to also manually include their own `fn main`, so rustdoc doesn't put their imports in the wrong place.

This PR just taps into another processing step rustdoc does to doctests: Whenever you add an `#![inner_attribute]` to the beginning of a doctest, rustdoc will actually splice those out and put it before the generated `fn main`. Now, we can just do the same with `extern crate`s at the beginning, too, and get a much nicer experience.

Now, the above example will be converted into this:

```rust
extern crate my_crate;
fn main() {
my_crate::some_cool_thing();
}
```
2018-02-21 16:29:47 +01:00
Guillaume Gomez
aec653536c
Rollup merge of #47833 - Aaron1011:final_auto_trait, r=GuillaumeGomez
Generate documentation for auto-trait impls

A new section is added to both both struct and trait doc pages.

On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync.

![Auto trait implementations for Cloned](https://i.imgur.com/XtTV6IJ.png)

On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library.

![Auto trait implementors for Send](https://i.imgur.com/3GRBpTy.png)

Synthesized impls for a particular auto trait ('synthetic impls') take generic bounds into account. For example, a type
```rust
struct Foo<T>(T)
```
 will have 'impl<T> Send for Foo<T> where T: Send' generated for it.

Manual implementations of auto traits are also taken into account. If we have
the following types:

```rust
struct Foo<T>(T)
struct Wrapper<T>(Foo<T>)
unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow
```

Then Wrapper will have the following impl generated:
```rust
impl<T> Send for Wrapper<T>
```
reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold

Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls:

![A ridiculous demonstration type](https://i.imgur.com/TkZMWuN.png)

However, if a type can *never* implement a particular auto trait (e.g. `struct MyStruct<T>(*const T)`), then a negative impl will be generated (in this case, `impl<T> !Send for MyStruct<T>`)

All of this means that a user should be able to copy-paste a syntheticimpl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
2018-02-21 16:29:46 +01:00
Guillaume Gomez
2a32060fb6
Rollup merge of #47379 - da-x:master, r=sfackler
Derive std::cmp::Reverse as Copy or Clone

If the type parameter is Copy or Clone, then `Reverse` should be too.
2018-02-21 16:29:45 +01:00
Hidehito Yabuuchi
7e51e7ddd6 Take 2^5 as examples in document of pow() (fixes #48396)
Current document takes 2^4, which is equal to 4^2.
This example is not very helpful for those unfamiliar with math words in English and thus rely on example codes.
2018-02-21 22:34:45 +09:00
Artyom Pavlov
a33c1da861
typo fix 2018-02-21 09:59:28 +03:00
Esteban Küber
20bc72e693 Handle custom diagnostic for &str + String 2018-02-20 22:46:51 -08:00
boats
5949d8b2d7
Fix internal references to bad_style in test code. 2018-02-20 15:57:16 -08:00
boats
21e2a5e8d8
Fix filepath in lint test. 2018-02-20 14:44:39 -08:00
boats
6fe5f42e37
Fix carets. 2018-02-20 13:38:46 -08:00