Commit Graph

76239 Commits

Author SHA1 Message Date
Josh Triplett
39fe29bf0c src/libcore/ptr.rs: Fix documentation for size of Option<NonNull<T>>
Seems more useful to say that it has the same size as `*mut T`.
2018-03-29 09:46:16 +02:00
bors
361509320c Auto merge of #49291 - tejom:check-for-known-but-incorrect-attributes, r=petrochenkov
Check for known but incorrect attributes

fixes #43988

- Change nested_visit_map so it will recursively check functions

- Add visit_stmt and visit_expr for impl Visitor for CheckAttrVisitor and check for incorrect
inline and repr attributes on staements and expressions

- Add regression test for issue #43988
2018-03-29 03:13:11 +00:00
bors
1e652bda20 Auto merge of #49458 - cramertj:stable-underscore-lt, r=nikomatsakis
Stabilize underscore lifetimes

r? @nikomatsakis
2018-03-29 00:41:15 +00:00
Taylor Cramer
e6e6bd27d5 Stabilize underscore lifetimes 2018-03-29 00:27:50 +02:00
bors
d52c44ea8d Auto merge of #49460 - kennytm:rollup, r=kennytm
Rollup of 12 pull requests

- Successful merges: #49243, #49329, #49364, #49400, #49405, #49427, #49428, #49429, #49439, #49442, #49444, #49452
- Failed merges:
2018-03-28 22:18:13 +00:00
bors
e5277c1457 Auto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, r=GuillaumeGomez
Remove hidden `foo` functions from doc examples; use `Termination` trait.

Fixes https://github.com/rust-lang/rust/issues/49233.

Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
2018-03-28 18:11:44 +00:00
kennytm
30560bb99a
Rollup merge of #49452 - frewsxcv:frewsxcv-vec-cap-len, r=dtolnay
Clarify "length" wording in `Vec::with_capacity`.

Fixes https://github.com/rust-lang/rust/issues/49448.
2018-03-28 17:55:20 +02:00
kennytm
03de75e7c6
Rollup merge of #49444 - rust-lang:oli-obk-patch-1, r=Mark-Simulacrum
Delete leftover librustc_const_eval

Probably accidentally reintroduced in a rebase/merge

fixes #49440

r? @Mark-Simulacrum
2018-03-28 17:55:19 +02:00
kennytm
5dc80dc31f
Rollup merge of #49442 - GuillaumeGomez:text-overlap, r=QuietMisdreavus
Fix text overlap

Fixes #49006.

r? @QuietMisdreavus
2018-03-28 17:55:17 +02:00
kennytm
1a89250356
Rollup merge of #49439 - GuillaumeGomez:trait-impl-collapse, r=QuietMisdreavus
Fix trait implementation not collapsing docs

r? @QuietMisdreavus
2018-03-28 17:55:16 +02:00
kennytm
611ceef28d
Rollup merge of #49429 - GuillaumeGomez:fix-collapse-toggle-insertion, r=QuietMisdreavus
Fix collapse toggle insertions on impl with docs

Just went through this one randomly... When an impl has docs, the collapse toggle isn't generated. This fixes it.

r? @QuietMisdreavus
2018-03-28 17:55:14 +02:00
kennytm
294f041f13
Rollup merge of #49428 - cuviper:llvm6-target_feature, r=alexcrichton
Enable target_feature on any LLVM 6+

In `LLVMRustHasFeature()`, rather than using `MCInfo->getFeatureTable()`
that is specific to Rust's LLVM fork, we can use this in LLVM 6:

    /// Check whether the subtarget features are enabled/disabled as per
    /// the provided string, ignoring all other features.
    bool checkFeatures(StringRef FS) const;

Now rustc using external LLVM can also have `target_feature`.

r? @alexcrichton
2018-03-28 17:55:13 +02:00
kennytm
6ca14660af
Rollup merge of #49427 - Manishearth:rustdoc-impl-trait-extern, r=GuillaumeGomez
Correctly handle impl trait in external items in rustdoc

fixes #49373

r? @QuietMisdreavus
2018-03-28 17:55:12 +02:00
kennytm
c17ab378e9
Rollup merge of #49405 - GuillaumeGomez:search-appearance, r=QuietMisdreavus
Fix search appearance

Fixes #49377.

r? @QuietMisdreavus

And a screenshot:

<img width="1016" alt="screen shot 2018-03-27 at 10 33 01" src="https://user-images.githubusercontent.com/3050060/37956373-7b522852-31ab-11e8-8915-7e20064b5edd.png">
2018-03-28 17:55:10 +02:00
kennytm
010fb40b44
Rollup merge of #49400 - Diggsey:shrink-to, r=joshtriplett
Implement `shrink_to` method on collections

Fixes #49385
2018-03-28 17:55:09 +02:00
kennytm
0214304b5a
Rollup merge of #49364 - wesleywiser:incr_handle_load_failure, r=michaelwoerister
[incremental] Don't panic if decoding the cache fails

If the cached data can't be loaded from disk, just issue a warning to
the user so they know why compilation is taking longer than usual but
don't fail the entire compilation since we can recover by ignorning the
on disk cache.

In the same way, if the disk cache can't be deserialized (because it has
been corrupted for some reason), report the issue as a warning and
continue without failing the compilation. `Decodable::decode()` tends to
panic with various errors like "entered unreachable code" or "index out
of range" if the input data is corrupted. Work around this by catching
panics from the `decode()` calls and continuing without the cached data.

Fixes #48847
2018-03-28 17:55:08 +02:00
kennytm
4285e1cad4
Rollup merge of #49329 - canarysnort01:fix-no-pie, r=pnkfelix
don't pass -no-pie to gnu ld

fixes #48884
2018-03-28 17:55:07 +02:00
kennytm
43f56ce131
Rollup merge of #49243 - murarth:stabilize-retain, r=BurntSushi
Stabilize method `String::retain`

Closes #43874
2018-03-28 17:55:05 +02:00
bors
1169541e17 Auto merge of #49394 - cramertj:stable-match-bindings, r=nikomatsakis
Stabilize match_default_bindings

This includes a submodule update to rustfmt
in order to allow a stable feature declaration.

r? @nikomatsakis

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

Many of the tests this PR touches are merely testing the current lack of desired future behavior around https://github.com/rust-lang/rust/issues/44849 and https://github.com/rust-lang/rust/issues/44848 (cc @tschottdorf). I noticed the bullets for those items were checked on the tracking issue-- I've unchecked them, as they don't appear to have been completed and I don't see any comments indicating that we don't want to pursue them further. Still, I think it's fine to stabilize the current behavior, as I think expanding it in the future should be backwards-compatible.
2018-03-28 15:31:29 +00:00
bors
d87c19db6d Auto merge of #49019 - phil-opp:target-spec, r=pnkfelix
Introduce a TargetTriple enum to support absolute target paths

This PR replaces target triple strings with a `TargetTriple` enum, which represents either a target triple or a path to a JSON target file. The path variant is used if the `--target` argument has a `.json` extension, else the target triple variant is used.

The motivation of this PR is support for absolute target paths to avoid the need for setting the `RUST_TARGET_PATH` environment variable (see rust-lang/cargo#4905 for more information). For places where some kind of triple is needed (e.g. in the sysroot folder), we use the file name (without extension).

For compatibility, we keep the old behavior of searching for a file named `$(target_triple).json` in `RUST_TARGET_PATH` for non-official target triples.
2018-03-28 12:56:09 +00:00
Wesley Wiser
49fd71bea7 [incremental] Don't panic if decoding the cache fails
If the cached data can't be loaded from disk, just issue a warning to
the user so they know why compilation is taking longer than usual but
don't fail the entire compilation since we can recover by ignorning the
on disk cache.

In the same way, if the disk cache can't be deserialized (because it has
been corrupted for some reason), report the issue as a warning and
continue without failing the compilation. `Decodable::decode()` tends to
panic with various errors like "entered unreachable code" or "index out
of range" if the input data is corrupted. Work around this by catching
panics from the `decode()` calls when joining the thread and continuing
without the cached data.

Fixes #48847
2018-03-28 08:30:09 -04:00
Corey Farwell
0d15a3ee54 Clarify "length" wording in Vec::with_capacity. 2018-03-28 14:10:18 +02:00
Guillaume Gomez
51f26acaea Fix text overlap 2018-03-28 13:25:43 +02:00
Corey Farwell
e9dcec070d Remove hidden foo functions from doc examples; use Termination trait.
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-28 13:15:05 +02:00
Taylor Cramer
3c65f53620 Stabilize match_default_bindings
This includes a submodule update to rustfmt
in order to allow a stable feature declaration.
2018-03-28 11:13:13 +02:00
Oliver Schneider
7038236da9
Delete leftover librustc_const_eval
Probably accidentally reintroduced in a rebase/merge
2018-03-28 10:49:45 +02:00
bors
bcffdf1b6d Auto merge of #49383 - nox:scalarpair, r=eddyb
Allow niche-filling dataful variants to be represented as a ScalarPair

r? @eddyb
2018-03-28 08:01:22 +00:00
Guillaume Gomez
884153a257 Fix trait implementation not collapsing docs 2018-03-28 09:51:18 +02:00
bors
e58df0d8c5 Auto merge of #49304 - sinkuu:impl_trait_rustdoc, r=QuietMisdreavus
Rustdoc support for universal_impl_trait

Hides type parameters synthesized by `impl Trait`-in-argument-position, and enables links to trait names.

<img alt="before" src="https://user-images.githubusercontent.com/7091080/37831646-a61413c6-2ee9-11e8-8ec2-a6137956d922.png" width="450"/>
↓
<img alt="after" src="https://user-images.githubusercontent.com/7091080/37831657-b2ff0ae6-2ee9-11e8-8797-fdad904782bf.png" width="450"/>

Fixes #49309
2018-03-28 05:29:57 +00:00
bors
59ec9bfc66 Auto merge of #49406 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

- Successful merges: #48639, #49223, #49333, #49369, #49381, #49395, #49399, #49401, #49417, #49202, #49426
- Failed merges:
2018-03-28 02:41:28 +00:00
Manish Goregaokar
33dceaa244 rustdoc: Add test for foreign impl trait with bounds 2018-03-27 23:57:03 +02:00
Manish Goregaokar
6a547b4f61 rustdoc: Handle explicit ?Sized on foreign impl Trait 2018-03-27 23:56:48 +02:00
Manish Goregaokar
32446f8db3 rustdoc: Remove Sized bounds when cleaning foreign impl Trait 2018-03-27 23:56:32 +02:00
Manish Goregaokar
ac655d25c7 rustdoc: Include associated type bounds when cleaning foreign impl traits 2018-03-27 23:56:30 +02:00
Manish Goregaokar
37fa6f8b12 rustdoc: Don't use into_iter() when cleaning impl Trait 2018-03-27 23:56:06 +02:00
Guillaume Gomez
8be26a2ca0 Fix collapse toggle insertions on impl with docs 2018-03-27 22:49:55 +02:00
Josh Stone
a93a4d259a Enable target_feature on any LLVM 6+
In `LLVMRustHasFeature()`, rather than using `MCInfo->getFeatureTable()`
that is specific to Rust's LLVM fork, we can use this in LLVM 6:

    /// Check whether the subtarget features are enabled/disabled as per
    /// the provided string, ignoring all other features.
    bool checkFeatures(StringRef FS) const;

Now rustc using external LLVM can also have `target_feature`.
2018-03-27 12:27:45 -07:00
kennytm
605ea7c31f
Rollup merge of #49426 - lukaslueg:patch-1, r=kennytm
Update CONTRIBUTING.md

The current link is a 404, just link to the main repo page
2018-03-28 03:03:39 +08:00
kennytm
19fe9d1181
Rollup merge of #49407 - WiSaGaN:patch-1, r=alexcrichton
Add back 1.24.1 release notes
2018-03-28 03:03:21 +08:00
lukaslueg
f513fbdf36
Update CONTRIBUTING.md
The current link is a 404, just link to the main repo page
2018-03-27 20:56:15 +02:00
matthew
4957a40d13 Add extra test for expressions and fix typo in message 2018-03-27 08:39:15 -07:00
kennytm
0873974290
Rollup merge of #49417 - TimNN:fix-ios, r=alexcrichton
Update compiler-rt with fix for 32bit iOS ARM
2018-03-27 23:20:27 +08:00
bors
9c9424de51 Auto merge of #49202 - csmoe:trait_engine, r=nikomatsakis
Introduce trait engine

address #48895 step 1: introduce trait engine
2018-03-27 14:31:43 +00:00
Tim Neumann
5b1a60062c Update compiler-rt with fix for 32bit iOS ARM 2018-03-27 15:32:06 +02:00
bors
3efe61c825 Auto merge of #49305 - SimonSapin:fallible, r=sfackler
Stabilize TryFrom / TryInto, and tweak impls for integers

Fixes https://github.com/rust-lang/rust/issues/33417 (tracking issue)

----

This adds:

* `impl From<u16> for usize`
* `impl From<i16> for isize`
* `impl From<u8> for isize`

… replacing corresponding `TryFrom<Error=!>` impls. (`TryFrom` still applies through the generic `impl<T, U> TryFrom<U> for T where T: From<U>`.) Their infallibility is supported by the C99 standard which (indirectly) requires pointers to be at least 16 bits.

The remaining `TryFrom` impls that define `type Error = !` all involve `usize` or `isize`. This PR changes them to use `TryFromIntError` instead, since having a return type change based on the target is a portability hazard.

Note: if we make similar assumptions about the *maximum* bit size of pointers (for all targets Rust will ever run on in the future), we could have similar `From` impls converting pointer-sized integers to large fixed-size integers. RISC-V considers the possibility of a 128-bit address space (RV128), which would leave only `impl From<usize> for u128` and `impl From<isize> for u128`. I [found](https://www.cl.cam.ac.uk/research/security/ctsrd/pdfs/20171017a-cheri-poster.pdf) some [things](http://www.csl.sri.com/users/neumann/2012resolve-cheri.pdf) about 256-bit “capabilities”, but I don’t know how relevant that would be to Rust’s `usize` and `isize` types.

I chose conservatively to make no assumption about the future there. Users making their portability decisions and using something like `.try_into().unwrap()`.

----

Since this feature already went through FCP in the tracking issue https://github.com/rust-lang/rust/issues/33417, this PR also proposes **stabilize** the following items:

* The `convert::TryFrom` trait
* The `convert::TryFrom` trait
* `impl<T> TryFrom<&[T]> for &[T; $N]` (for `$N` up to 32)
* `impl<T> TryFrom<&mut [T]> for &mut [T; $N]` (for `$N` up to 32)
* The `array::TryFromSliceError` struct, with impls of `Debug`, `Copy`, `Clone`, and `Error`
* `impl TryFrom<u32> for char`
* The `char::CharTryFromError` struct, with impls of `Copy`, `Clone`, `Debug`, `PartialEq`, `Eq`, `Display`, and `Error`
* Impls of `TryFrom` for all (?) combinations of primitive integer types where `From` isn’t implemented.
* The `num::TryFromIntError` struct, with impls of `Debug`, `Copy`, `Clone`, `Display`, `From<!>`, and `Error`

Some minor remaining questions that I hope can be resolved in this PR:

* Should the impls for error types be unified?
* ~Should `TryFrom` and `TryInto` be in the prelude? `From` and `Into` are.~ (Yes.)
2018-03-27 11:50:10 +00:00
kennytm
b4bc2b0cf8
Rollup merge of #49401 - alercah:format, r=cramertj
Add missing '?' to format grammar.
2018-03-27 10:47:54 +02:00
kennytm
2d05bde0b7
Rollup merge of #49399 - ehuss:termcolor-update, r=alexcrichton
Fix diagnostic colors on Windows 10 console.

This updates termcolor to pick up BurntSushi/ripgrep#867.

Fixes #49322.
2018-03-27 10:47:53 +02:00
kennytm
5eb4689d1f
Rollup merge of #49395 - petrochenkov:obsolete, r=alexcrichton
libsyntax: Remove obsolete.rs

This little piece of infra is obsolete (ha-ha) and is unlikely to be used in the future, even if new obsolete syntax appears.
2018-03-27 10:47:51 +02:00
Wangshan Lu
6313997e3e
Add back 1.24.1 release notes 2018-03-27 16:47:50 +08:00
kennytm
1c45f6c051
Rollup merge of #49381 - withoutboats:str_unicode, r=SimonSapin
Add is_whitespace and is_alphanumeric to str.

The other methods from `UnicodeStr` are already stable inherent
methods on str, but these have not been included.

r? @SimonSapin
2018-03-27 10:47:50 +02:00