Commit Graph

74166 Commits

Author SHA1 Message Date
Sebastian Dröge
1756f680b0 Fix broken links to other slice functions in chunks/chunks_mut/exact_chunk/exact_chunks_mut docs
See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492
2018-01-21 11:20:19 +02:00
bors
9368a1e3e2 Auto merge of #45684 - bjorn3:runtime_choose_trans2, r=eddyb
Allow runtime switching between trans backends

The driver callback after_llvm has been removed as it doesnt work with multiple backends.

r? @eddyb
2018-01-21 09:17:26 +00:00
bors
8d3e93beae Auto merge of #47622 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests

- Successful merges: #46938, #47193, #47508, #47510, #47532, #47535, #47559, #47568, #47573, #47578
- Failed merges:
2018-01-21 06:32:03 +00:00
bors
b85aefbc60 Auto merge of #47495 - nikomatsakis:nll-issue-47153, r=pnkfelix
remove bogus assertion and comments

The code (incorrectly) assumed that constants could not have generics
in scope, but it's not really a problem if they do.

Fixes #47153

r? @pnkfelix
2018-01-21 03:38:34 +00:00
A.J. Gardner
f7f6598083 Simplify and fix test 2018-01-20 21:22:11 -06:00
Eduard-Mihai Burtescu
51fe2fe07f rustc_trans: remove an unwrap by replacing a bool with Result. 2018-01-21 02:45:47 +02:00
A.J. Gardner
7188706c4f Teach rustc about DW_AT_noreturn and a few more DIFlags 2018-01-20 18:34:53 -06:00
Andrew Straw
4d08d054c7 fix doctests for BTreeSet to use BTreeSet (not BTreeMap)
This fixes #47624
2018-01-20 23:39:12 +01:00
Guillaume Gomez
4074893acd Rollup merge of #47578 - arthurprs:btree-doc, r=alexcrichton
Update BTreeMap recommendation

Focus on the ordering / range(instead of all) benefit as it's the most important feature.
2018-01-20 22:32:50 +01:00
Guillaume Gomez
a9672c2360 Rollup merge of #47573 - estebank:closures, r=nikomatsakis
Closure argument mismatch tweaks

 - use consistent phrasing for expected and found arguments
 - suggest changing arguments to tuple if possible
 - suggest changing single tuple argument to arguments if possible

Fix #44150.
2018-01-20 22:32:49 +01:00
Guillaume Gomez
40ba599365 Rollup merge of #47568 - EdSchouten:cloudabi-linker, r=alexcrichton
Give TargetOptions::linker a sane default value for CloudABI.

Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo
seems to make use of the TargetOptions::linker property. Make the out of
the box experience for CloudABI a bit better by using the same compiler
name as cc-rs.
2018-01-20 22:32:48 +01:00
Guillaume Gomez
ea65bad080 Rollup merge of #47559 - walinga:pr-link-fix, r=kennytm
Fix the "Github - About Pull Requests" link in CONTRIBUTING.md

Previously the text that is supposed to link to the Github Pull Requests page, instead linked to the same file (CONTRIBUTING.md).
2018-01-20 22:32:47 +01:00
Guillaume Gomez
0f84ab4a41 Rollup merge of #47535 - Manishearth:ignore-target, r=kennytm
add target/ to ignored tidy dirs

Sometimes you get a target directory from running cargo in the rust repo (the root is `src/`), and it contains generated files. Just whitelist it since it causes tidy to spew warnings uncontrollably.
2018-01-20 22:32:46 +01:00
Guillaume Gomez
b21499e768 Rollup merge of #47532 - tbu-:pr_path_oddities, r=TimNN
Add some edge cases to the documentation of `Path`

Affected methods are `starts_with` and `strip_prefix`.
2018-01-20 22:32:45 +01:00
Guillaume Gomez
5381dfb7d9 Rollup merge of #47510 - sfackler:deprecate-dns, r=alexcrichton
Deprecate std::net::lookup_host

We intended to do this quite a while ago but it snuck through.

r? @alexcrichton
2018-01-20 22:32:44 +01:00
Guillaume Gomez
d3176efa78 Rollup merge of #47508 - QuietMisdreavus:rbe-bookshelf, r=steveklabnik
add Rust By Example to the bookshelf

cc #46194

With #46196 freshly merged, we should add a link to the main docs distribution so people can find it! We discussed this at the docs team meeting today and decided to go ahead with adding it to the bookshelf.
2018-01-20 22:32:43 +01:00
Guillaume Gomez
0e270fc842 Rollup merge of #47193 - cramertj:result-opts, r=TimNN
Add transpose conversions for nested Option and Result

These impls are useful when working with combinator
methods that expect an option or a result, but you
have a `Result<Option<T>, E>` instead of an `Option<Result<T, E>>`
or vice versa.
2018-01-20 22:32:42 +01:00
Guillaume Gomez
fe811eb328 Rollup merge of #46938 - hellow554:rustdoc-kbd-style, r=GuillaumeGomez
add kbd style tag to main.css in rustdoc

Added css style for kbd tags so they actually look like keys.
Result preview and discussion was going on in #46900 .
2018-01-20 22:32:41 +01:00
Ed Schouten
e47cc69697 Add testing coverage for assigning to immutable thread-locals.
It is currently allowed to perform such assignments when not making use
of NLL. NLL already does this right, but let's add a test in place to
ensure it never regresses.
2018-01-20 21:48:55 +01:00
Esteban Küber
067405044c Fix tests by keepeing needed suggestions 2018-01-20 12:02:40 -08:00
bjorn3
a30232f9fd Remove the 'extern "C"' in the right place 2018-01-20 17:27:15 +01:00
bors
15a1e2844d Auto merge of #46980 - zackmdavis:and_the_case_of_the_needlessly_parenthesized_arguments, r=petrochenkov
in which the unused-parens lint comes to cover function and method args

Resolves #46137.
2018-01-20 15:06:41 +00:00
bors
bdda8d6115 Auto merge of #46952 - SimonSapin:nonnull, r=alexcrichton
Rename std::ptr::Shared to NonNull and stabilize it

This implements the changes proposed at https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629:

> * Rename `Shared<T>` to `NonNull<T>` and stabilize it. (Being in the `ptr` module is enough to say that it’s a pointer. I’m not very attached to this specific name though.)
> * Rename `Box<T>` methods ~~`from_unique`~~/`into_unique` to ~~`from_nonnull`~~/`into_nonnull` (or whatever names are deemed appropriate), replace `Unique<T>` with `NonNull<T>` in their signatures, and stabilize them.
> *  Replace `Unique<T>` with `NonNull<T>` in the signatures of methods of the `Alloc` trait.
> * Mark `Unique` “permanently-unstable” by replacing remaining occurrences of `#[unstable(feature = "unique", issue = "27730")]` with:
>
>   ```rust
>   #[unstable(feature = "ptr_internals", issue = "0", reason = "\
>       use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), \
>       Send, and/or Sync")]
>   ```
>
>   (Maybe the `reason` string is only useful on the struct definition.) Ideally it would be made private to some crate instead, but it needs to be used in both liballoc and libstd.
> * (Leave `NonZero` and `Zeroable` unstable for now, and subject to future bikeshedding.)
2018-01-20 12:28:13 +00:00
bjorn3
a4854e84f2 Fix ICE 2018-01-20 11:55:55 +01:00
Simon Sapin
602a445b92 Assign its own tracking issue to Box::into_raw_non_null
https://github.com/rust-lang/rust/issues/47336
2018-01-20 11:09:23 +01:00
Simon Sapin
76b686f78d Rename NonNull::empty to dangling. 2018-01-20 11:09:23 +01:00
Simon Sapin
5aeeafff49 Revert Box::into_raw_non_null to unstable 2018-01-20 11:09:23 +01:00
Simon Sapin
a1db237cd4 Preserve formatting options in Debug for NonNull/Unique 2018-01-20 11:09:23 +01:00
Simon Sapin
943a9e707c Fix some doc-comment examples for earlier API refactor
https://github.com/rust-lang/rust/pull/41064
2018-01-20 11:09:23 +01:00
Simon Sapin
12b3630f62 Rename Box::into_non_null_raw to Box::into_raw_non_null 2018-01-20 11:09:23 +01:00
Simon Sapin
8ef5e549c3 Remove Box::from_non_null_raw
Per https://github.com/rust-lang/rust/pull/46952#issuecomment-353956225
2018-01-20 11:09:23 +01:00
Simon Sapin
1772fa2aa1 Rename Box::*_nonnull_raw to *_non_null_raw 2018-01-20 11:09:23 +01:00
Simon Sapin
55c50cd8ac Stabilize std::ptr::NonNull 2018-01-20 11:09:23 +01:00
Simon Sapin
2d51e74580 Remove a deprecated (renamed) and unstable method of NonNull 2018-01-20 11:09:23 +01:00
Simon Sapin
c97c1f7dc3 Mark Unique as perma-unstable, with the feature renamed to ptr_internals. 2018-01-20 11:09:23 +01:00
Simon Sapin
a2f878a084 Replace Box::{from,into}_unique with {from,into}_nonnull_raw
Thew `_raw` prefix is included because the fact that `Box`’s ownership
semantics are "dissolved" or recreated seem more important than the exact
parameter type or return type.
2018-01-20 11:09:22 +01:00
Simon Sapin
fb03a49c25 Replace Unique<T> with NonZero<T> in Alloc trait 2018-01-20 10:55:16 +01:00
Simon Sapin
f19baf0977 Rename std::ptr::Shared to NonNull
`Shared` is now a deprecated `type` alias.

CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
2018-01-20 10:55:16 +01:00
Corey Farwell
ba5d7a66e8 Implement Debug for ptr::Shared and ptr::Unique.
Fixes https://github.com/rust-lang/rust/issues/46755.
2018-01-20 10:55:16 +01:00
Esteban Küber
7ed00caacc Closure argument mismatch tweaks
- use consistent phrasing for expected and found arguments
 - suggest changing arugments to tuple if possible
 - suggest changing single tuple argument to arguments if possible
2018-01-20 01:36:01 -08:00
ritiek
dbb6519937 NLL test for mutating &mut references 2018-01-20 11:14:03 +05:30
Josh Stone
e2f6b280ea Update DW_OP_plus to DW_OP_plus_uconst
LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`.  In the
DWARF standard, this adds two items on the expressions stack.  LLVM's
behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant
that follows the op.  The patch series starting with [D33892] switched
to the standard DWARF interpretation, so we need to follow.

[D33892]: https://reviews.llvm.org/D33892
2018-01-19 21:43:53 -08:00
Santiago Pastorino
8f2cc02bc3 Run yield-subtype test on nll mode too as a regression check 2018-01-19 21:32:43 -05:00
Santiago Pastorino
fcb9e928b7 Integrate generators to universal region setup 2018-01-19 21:32:43 -05:00
Niko Matsakis
5d259b23a4 change MIR dump format to include yield type 2018-01-19 21:31:35 -05:00
bors
816d765716 Auto merge of #46919 - michaelwoerister:new-leb128, r=sfackler
Speed up leb128 encoding and decoding for unsigned values.

Make the implementation for some leb128 functions potentially faster.

@Mark-Simulacrum, could you please trigger a perf.rlo run?
2018-01-20 02:00:13 +00:00
oberien
4a0da4cf2c Spacing 2018-01-20 00:41:21 +01:00
Mark Mansi
49431d4966 Add a bunch of doc comments 2018-01-19 16:39:54 -06:00
Mark Mansi
c4befe1710 Run rustfmt and add comments 2018-01-19 15:46:15 -06:00
Niko Matsakis
67f922bfcc
fix line 2018-01-19 16:46:07 -05:00