Commit Graph

73137 Commits

Author SHA1 Message Date
Guillaume Gomez
35d15554bd Rollup merge of #47216 - SergioBenitez:doc-fix, r=Mark-Simulacrum
Clarify appending behavior of 'io::Read::read_to_string()'.

A simple doc clarification.
2018-01-06 02:13:36 +01:00
Guillaume Gomez
b3104178d6 Rollup merge of #47202 - GuillaumeGomez:fix-defocus, r=QuietMisdreavus
Fix search bar defocus

Fixes #47134.

r? @QuietMisdreavus
2018-01-06 02:13:35 +01:00
Guillaume Gomez
21b9822390 Rollup merge of #47173 - dotdash:cleanup, r=michaelwoerister
Remove some outdated LLVM-related code

Ticks two boxes on #46437
2018-01-06 02:13:34 +01:00
Guillaume Gomez
5624ac7c47 Rollup merge of #47165 - mbrubeck:args, r=alexcrichton
[unix] Don't clone command-line args on startup

Fixes part of #47164 and simplifies the `args` code on non-Apple Unix platforms.

Note: This could change behavior for programs that use both `std::env::args` *and* unsafe code that mutates `argv` directly.  However, these programs already behave differently on different platforms.  The new behavior on non-Apple platforms is closer to the existing behavior on Apple platforms.
2018-01-06 02:13:33 +01:00
Guillaume Gomez
67e3a2bb2c Rollup merge of #46987 - frewsxcv:frewsxcv-current-exe, r=QuietMisdreavus
Minor rewrite of env::current_exe docs; clarify symlinks.

- Update example in ‘security’ section to use hard links, like the
  linked securityvulns.com example.
- Weaken language on symbolic links – indicate behavior is
  platform-specific

Fixes https://github.com/rust-lang/rust/issues/43617.
2018-01-06 02:13:32 +01:00
bors
b98fd524ec Auto merge of #47142 - sdroege:trusted-random-access-chunks, r=kennytm
Implement TrustedRandomAccess for slice::{Chunks, ChunksMut, Windows}

As suggested by @bluss in https://github.com/rust-lang/rust/issues/47115#issuecomment-354888334
2018-01-05 14:17:04 +00:00
Sergio Benitez
d301da55f8 Clarify appending behavior of 'io::Read::read_to_string()'. 2018-01-05 04:24:12 -08:00
bors
dd582ac38e Auto merge of #47214 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests

- Successful merges: #47030, #47033, #47110, #47149, #47150, #47160, #47162, #47182, #47198, #47199
- Failed merges:
2018-01-05 10:07:47 +00:00
kennytm
3fcb995759 Rollup merge of #47199 - alexcrichton:stable-no-dev, r=kennytm
rustbuild: Don't allow stable bootstrap from dev

I forgot to update the bootstrap compiler for the 1.23.0 release so let's make
sure it doesn't happen again!
2018-01-05 17:22:13 +08:00
kennytm
71c8e106e3 Rollup merge of #47198 - dzamlo:patch-2, r=frewsxcv
Fix an error in std::process documentation
2018-01-05 17:22:12 +08:00
kennytm
1fea75192e Rollup merge of #47182 - aheart:master, r=steveklabnik
Equivalent example for ? operator

The example with the ? operator in the documentation for try! macro was missing file.write_all.
Now all three examples are consistent.
2018-01-05 17:22:11 +08:00
kennytm
ff2f328d7e Rollup merge of #47162 - stjepang:cleanup-btreeset, r=alexcrichton
Remove `T: Ord` bound from `BTreeSet::{is_empty, len}`

This change makes the API for `BTreeSet` more consistent with `BTreeMap`, where `BTreeMap::{is_empty, len}` don't require `T: Ord` either.

Also, it reduces the number of `impl`s for `BTreeSet`, making the generated documentation look much cleaner. Closes #47138.

cc @rust-lang/libs
2018-01-05 17:22:10 +08:00
kennytm
a5dd5fe007 Rollup merge of #47160 - rust-lang:steveklabnik-patch-1, r=alexcrichton
This isn't in Rust 1.23

r? @alexcrichton
2018-01-05 17:22:09 +08:00
kennytm
5a5b16ad06 Rollup merge of #47150 - dtolnay:join, r=jseyfried
Return None from Span::join if in different files

Fixes #47148. r? @abonander
2018-01-05 17:22:08 +08:00
kennytm
2ac50febbd Rollup merge of #47149 - dtolnay:spans, r=jseyfried
Span::resolved_at and Span::located_at to combine behavior of two spans

Proc macro spans serve two mostly unrelated purposes: controlling name resolution and controlling error messages. It can be useful to mix the name resolution behavior of one span with the line/column error message locations of a different span.

In particular, consider the case of a trait brought into scope within the def_site of a custom derive. I want to invoke trait methods on the fields of the user's struct. If the field type does not implement the right trait, I want the error message to underline the corresponding struct field.

Generating the method call with the def_site span is not ideal -- it compiles and runs but error messages sadly always point to the derive attribute like we saw with Macros 1.1.

```
  |
4 | #[derive(HeapSize)]
  |          ^^^^^^^^
```

Generating the method call with the same span as the struct field's ident or type is not correct -- it shows the right underlines but fails to resolve to the trait in scope at the def_site.

```
  |
7 |     bad: std:🧵:Thread,
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
```

The correct span for the method call is one that combines the def_site's name resolution with the struct field's line/column.

```rust
field.span.resolved_at(Span::def_site())

// equivalently
Span::def_site().located_at(field.span)
```

Adding both because which one is more natural will depend on context.

Addresses https://github.com/rust-lang/rust/issues/38356#issuecomment-354947143. r? @jseyfried
2018-01-05 17:22:07 +08:00
kennytm
26d129ce39 Rollup merge of #47110 - EdSchouten:cloudabi-tls, r=kennytm
Use the right TLS model for CloudABI.

CloudABI doesn't do dynamic linking. For this reason, there is no need
to handle any other TLS model than local-exec. CloudABI's C library
doesn't provide a __tls_get_addr() function to do Dynamic TLS.

By forcing local-exec to be used here, we ensure that we don't generate
function calls to __tls_get_addr().
2018-01-05 17:22:06 +08:00
kennytm
016f7f49c2 Rollup merge of #47033 - EdSchouten:cloudabi-oom, r=kennytm
Disable printing of error message on file descriptor 2 on CloudABI.

As CloudABI is a capability-based runtime environment, file descriptors
are the mechanism that grants rights to a process. These file
descriptors may be passed into processes on startup using a utility
called cloudabi-run. Unlike the POSIX shell, cloudabi-run does not
follow the UNIX model where file descriptors 0, 1 and 2 represent stdin,
stdout and stderr. There can be arbitrary many (or few) file descriptors
that can be provided. For this reason, CloudABI's C library also doesn't
define STD*_FILENO. liblibc should also not declare these.

Disable the code in liballoc_system that tries to print error messages
over file descriptor 2. For now, let's keep this function quiet. We'll
see if we can think of some other way to log this in the future.
2018-01-05 17:22:05 +08:00
kennytm
63c8e0c86b Rollup merge of #47030 - ollie27:stab, r=alexcrichton
Correct a few stability attributes

* The extra impls for `ManuallyDrop` were added in #44310 which was only stabilised in 1.22.0.
* The impls for `SliceIndex` were stabilised in #43373 but as `RangeInclusive` and `RangeToInclusive` are still unstable the impls should remain unstable.
* The `From` impls for atomic integers were added in #45610 but most atomic integers are still unstable.
* The `shared_from_slice2` impls were added in #45990 but they won't be stable until 1.24.0.
* The `Mutex` and `RwLock` impls were added in #46082 but won't be stable until 1.24.0.
2018-01-05 17:22:04 +08:00
bors
8a11b8cdd7 Auto merge of #46907 - varkor:contrib-8, r=nagisa
Allow non-alphabetic underscores in camel case

Certain identifiers, such as `X86_64`, cannot currently be unambiguously represented in camel case (`X8664`, `X86_64`, `X8_664`, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under `#[forbid(non_camel_case_types)]`. Fixes #34633 and fixes #41621.
2018-01-05 05:20:23 +00:00
bors
5e66887fed Auto merge of #46739 - arielb1:simple-loops, r=nikomatsakis
[needs perf run] Try to improve LLVM pass ordering

Fixes #45466
2018-01-05 02:31:19 +00:00
Guillaume Gomez
eea860f84c Fix search bar defocus 2018-01-05 01:14:10 +01:00
Matt Brubeck
91c3eee173 [unix] Don't clone command-line args on startup 2018-01-04 15:11:39 -08:00
Alex Crichton
0e795a2106 rustbuild: Don't allow stable bootstrap from dev
I forgot to update the bootstrap compiler for the 1.23.0 release so let's make
sure it doesn't happen again!
2018-01-04 13:14:15 -08:00
Loïc Damien
8fc4a24062
Fix an error in std::process documentation 2018-01-04 22:01:57 +01:00
bors
8e7a609e63 Auto merge of #46916 - michaelwoerister:generate-dead-code-plz, r=alexcrichton
Generate code for unused const- and inline-fns if -Clink-dead-code is specified.

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

r? @alexcrichton
2018-01-04 14:04:27 +00:00
aheart
922f0618d1
Make examples equivalent
The example with the ? operator was missing file.write_all
2018-01-04 15:55:01 +02:00
bors
4cd918c4ca Auto merge of #47147 - projektir:to_ptr_cast, r=eddyb
Force appropriate extension when converting from int to ptr #43291

Fixes #43291.

Looking for feedback if I've missed something and/or need to add more tests.

@eddyb @retep998 @nagisa @oli-obk
2018-01-04 09:54:15 +00:00
Sebastian Dröge
b69c124255 Fix potential overflow in TrustedRandomAccess impl for slice::{Chunks,ChunksMut} 2018-01-04 11:34:05 +02:00
Michael Woerister
238ed47d29 Generate code for const- and inline-fns if -Clink-dead-code is specified. 2018-01-04 10:12:20 +01:00
Björn Steinbrink
7e522b2f0e Simplify LLVMRustModuleCost() 2018-01-04 08:57:14 +01:00
Björn Steinbrink
493c29d35a Remove unused function LLVMRustGetValueContext()
Refs #46437
2018-01-04 08:57:14 +01:00
Björn Steinbrink
d7bbd3042c Remove outdated LLVMRustBuildLandingPad() wrapper
The function was added as a wrapper to handle compatibility with older
LLVM versions that we no longer support, so it can be removed.

Refs #46437
2018-01-04 08:57:14 +01:00
bors
78f24d86b8 Auto merge of #47124 - estebank:loan-paths, r=nikomatsakis
Reword reason for move note

On move errors, when encountering an enum variant, be more ambiguous and do not refer to the type on the cause note, to avoid referring to `(maybe as std::prelude::v1::Some).0`, and instead refer to `the value`.

Sidesteps part of the problem with #41962:

```
error[E0382]: use of partially moved value: `maybe`
 --> file.rs:5:30
  |
5 |         if let Some(thing) = maybe {
  |                     -----    ^^^^^ value used here after move
  |                     |
  |                     value moved here
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0`
 --> file.rs:5:21
  |
5 |         if let Some(thing) = maybe {
  |                     ^^^^^ value moved here in previous iteration of loop
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error: aborting due to 2 previous errors
```

Previous discussion: #44360

r? @arielb1
2018-01-04 05:52:39 +00:00
bors
608aae904b Auto merge of #47132 - cramertj:impl-trait-camel-case, r=nikomatsakis
Limit style lint to non-synthetic generic params

Fix https://github.com/rust-lang/rust/issues/46959

r? @nikomatsakis
2018-01-04 03:12:39 +00:00
Esteban Küber
a4d46b3d87 Tweak to mir borrow in a loop diagnostic 2018-01-03 14:13:32 -08:00
Esteban Küber
e027f5a99e Add mir test, review comments 2018-01-03 13:55:40 -08:00
bors
0a3761e63e Auto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakis
NLL fixes

First, introduce pre-statement effects to dataflow to fix #46875. Edge dataflow effects might make that redundant, but I'm not sure of the best way to integrate them with liveness etc., and if this is a hack, this is one of the cleanest hacks I've seen.

And I want a small fix to avoid the torrent of bug reports.

Second, fix linking of projections to fix #46974

r? @pnkfelix
2018-01-03 21:06:21 +00:00
Stjepan Glavina
6076cf6f4e Remove T: Ord bound from BTreeSet::{is_empty, len} 2018-01-03 20:00:11 +01:00
Ed Schouten
05949b09a8 Explain why local-exec is used by CloudABI. 2018-01-03 18:32:41 +01:00
Steve Klabnik
50989cd98d
This is an unstable feature 2018-01-03 12:05:57 -05:00
bors
d96cc6e286 Auto merge of #47127 - EdSchouten:cloudabi-tests, r=kennytm
First cut at getting some part of the test suite working for CloudABI

I am currently working on creating a Docker container for automated CI for CloudABI. Here are some of the trivial changes that need to land to make tests pass.
2018-01-03 17:00:24 +00:00
Steve Klabnik
47e18e0db7
This isn't in Rust 1.23 2018-01-03 11:58:42 -05:00
Ed Schouten
3ca407e24b Restore a FIXME that was removed by one of my previous changes.
Requested by: kennytm
2018-01-03 15:40:37 +01:00
Sebastian Dröge
3f29e2b495 Fix compilation of TrustedRandomAccess impl for slice::Chunks
https://github.com/rust-lang/rust/pull/47113 renamed the private size
field to chunk_size for consistency.
2018-01-03 15:05:18 +02:00
Sebastian Dröge
a56a3fc85f Add unit test for zipping slice::{Chunks, ChunksMut, Windows} iterators
For testing if the TrustedRandomAccess implementation works.
2018-01-03 15:05:18 +02:00
Sebastian Dröge
48f2f71185 Implement TrustedRandomAccess for slice::{Chunks, ChunksMut, Windows} 2018-01-03 15:05:18 +02:00
bors
8d1a30289e Auto merge of #46913 - Eh2406:master, r=eddyb
CStore switch FxHashMap to IndexVec

This is a first attempt to fix #46876.
2018-01-03 12:59:52 +00:00
bors
b107f720e5 Auto merge of #47151 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #47104, #47107, #47113, #47117, #47118, #47121, #47125, #47134, #47145
- Failed merges:
2018-01-03 10:07:39 +00:00
kennytm
b416119472 Rollup merge of #47145 - frewsxcv:frewsxcv-linewriter-error, r=QuietMisdreavus
Document when LineWriter flushes; document errors for into_inner.

Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-03 16:58:04 +08:00
kennytm
08501bd983 Rollup merge of #47134 - Sogomn:master, r=QuietMisdreavus
Defocus search bar in rustdoc pages

rust-lang/rfcs#2265
2018-01-03 16:58:03 +08:00