Commit Graph

73935 Commits

Author SHA1 Message Date
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
Niko Matsakis
67f922bfcc
fix line 2018-01-19 16:46:07 -05:00
Niko Matsakis
9d629c641e
add ERROR annotation 2018-01-19 16:45:54 -05:00
Esteban Küber
6f9ecaa7cf Tweak wording and spans of closure lifetime errors 2018-01-19 13:28:43 -08:00
varkor
c4d0bb398b Fix tidy error 2018-01-19 21:00:35 +00:00
varkor
768cbbcd9e Fix type inhabitedness check for arrays
Arrays of uninhabited types were considered to also be uninhabited if
their length had not been evaluated, causing unsoundness.
2018-01-19 19:58:46 +00:00
bjorn3
82ac9f7532 Hopefully fix the 32bit SEGV 2018-01-19 20:27:52 +01:00
bjorn3
cc4deb2767 Just forget the DynamicLibrary after getting a hot plugged backend 2018-01-19 20:27:52 +01:00
bjorn3
a09aebee21 Remove accidential libloading dependency 2018-01-19 20:27:51 +01:00
bjorn3
c0444242ef Fix ICE 2018-01-19 20:27:36 +01:00
bjorn3
77dec3b03a Remove use of RUSTC_COMPILETEST env var 2018-01-19 20:27:36 +01:00
bjorn3
d2c53f8b4d Add missing licenses 2018-01-19 20:27:36 +01:00
bjorn3
4ef16d7466 Fix hotplug backend and add test 2018-01-19 20:27:36 +01:00
bjorn3
ace502a107 Fix review comments 2018-01-19 20:27:35 +01:00
bjorn3
2d241f66fe Cleanup hot plug codegen backend code 2018-01-19 20:27:35 +01:00
bjorn3
9315ed45c5 Hot plug rustc_trans 2018-01-19 20:27:33 +01:00
bjorn3
6dffaa9175 Hide even more of rustc_trans 2018-01-19 20:27:12 +01:00
bjorn3
bd2e808180 Fix rustc_driver test.rs 2018-01-19 20:27:12 +01:00
bjorn3
2af0f0dddf Hide more stuff from rustc_trans 2018-01-19 20:27:12 +01:00
bjorn3
af0f17386f Fix rustc_driver test.rs 2018-01-19 20:27:12 +01:00
bjorn3
74c92c5562 Allow runtime switching between trans backends 2018-01-19 20:27:10 +01:00
Alex Crichton
06913a5b1d Automaticaly calculate beta prerelease numbers
This is a forward-port of:

* 9426dda83d7a928d6ced377345e14b84b0f11c21
* cbfb9858951da7aee22d82178405306fca9decb1

from the beta branch which is used to automatically calculate the beta number
based on the number of merges to the beta branch so far.
2018-01-19 08:57:01 -08:00
Pieter Penninckx
81e6840ff4 Small improvements to the documentation of VecDeque. 2018-01-19 16:51:46 +01:00
Arthur Silva
fdf444da76 Update BTreeMap recommendation
Focus on the ordering/range benefit.
2018-01-19 15:40:58 +01:00
Niko Matsakis
297595532c
s/foo/main/ 2018-01-19 08:24:06 -05:00