Commit Graph

78410 Commits

Author SHA1 Message Date
Guillaume Gomez
4066d2235d
Rollup merge of #50745 - kraai:patch-1, r=kennytm
Uncapitalize "You"
2018-05-15 14:27:06 +02:00
Guillaume Gomez
8902fc2687
Rollup merge of #50733 - katrinleinweber:patch-secure-DOI, r=kennytm
Hyperlink DOI against preferred resolver

Hello :-)  The DOI foundation recommends [this new, secure resolver](https://www.doi.org/doi_handbook/3_Resolution.html#3.8). Accordingly, this PR updates a DOI link.
2018-05-15 14:27:05 +02:00
Guillaume Gomez
9c4843ff91
Rollup merge of #50720 - frewsxcv:frewsxcv-examples, r=QuietMisdreavus
Add “Examples” section header in f32/f64 doc comments.

This is recommend by [RFC 0505] and as far as I know, the only primitive
types without this heading.

[RFC 0505]: c892139be6/text/0505-api-comment-conventions.md (using-markdown)
2018-05-15 14:27:04 +02:00
Guillaume Gomez
7c7941dc26
Rollup merge of #50712 - leodasvacas:improve-eager-resolution-error-message, r=estebank
Improve eager type resolution error message

This PR improves the span of eager resolution type errors referring to indexing and field access to use the base span rather than the whole expression.

Also a "note: type must be known at this point" is added where in the past we emitted the "type must be known at this context" error, so that early failures can be differentiated and will hopefully be less surprising.

Fixes #50692 (or at least does the best we can for the moment)

r? @estebank
2018-05-15 14:27:02 +02:00
Guillaume Gomez
6dc4971cf8
Rollup merge of #50691 - ollie27:rustdoc_pub_restricted, r=QuietMisdreavus
rustdoc: Add support for pub(restricted)

This is useful when using `--document-private-items`.

r? @QuietMisdreavus
2018-05-15 14:27:01 +02:00
Guillaume Gomez
eb83606b86
Rollup merge of #50685 - glaubitz:sparc64-linux, r=alexcrichton
ci: Add Dockerfile for dist-sparc64-linux

This addresses https://github.com/rust-lang/rust/issues/47903.
2018-05-15 14:27:00 +02:00
Guillaume Gomez
934e37aeb4
Rollup merge of #50632 - GuillaumeGomez:minification, r=ollie27
Add minification process

r? @QuietMisdreavus
2018-05-15 14:26:59 +02:00
Guillaume Gomez
91c648b9c1
Rollup merge of #50613 - kennytm:update-toolstate-with-highfive, r=alexcrichton
Migrate the toolstate update bot to rust-highfive

Rationale: Only members of the rust-lang organization can mention its teams. That means #50434 has no effect if we are still using @kennytm-githubbot.
2018-05-15 14:26:57 +02:00
Guillaume Gomez
30c0b56e8f
Rollup merge of #50594 - sanxiyn:man-print, r=steveklabnik
Update the man page with additional --print options

`\:` is a `groff` for `<wbr>` to get better line breaking.
2018-05-15 14:26:56 +02:00
Guillaume Gomez
d4bd85d68e
Rollup merge of #50399 - nrc:alias, r=eddyb
save-analysis: handle aliasing imports a bit more nicely

r? @eddyb
2018-05-15 14:26:55 +02:00
Guillaume Gomez
7a9eb836a9
Rollup merge of #49767 - ecstatic-morse:ptr-docs, r=steveklabnik
Rewrite docs for `std::ptr`

This PR attempts to resolve #29371.

This is a fairly major rewrite of the `std::ptr` docs, and deserves a fair bit of scrutiny. It adds links to the GNU libc docs for various instrinsics, adds internal links to types and functions referenced in the docs, adds new, more complex examples for many functions, and introduces a common template for discussing unsafety of functions in `std::ptr`.

All functions in `std::ptr` (with the exception of `ptr::eq`) are unsafe because they either read from or write to a raw pointer. The "Safety" section now informs that the function is unsafe because it dereferences a raw pointer and requires that any pointer to be read by the function points to "a valid vaue of type `T`".

Additionally, each function imposes some subset of the following conditions on its arguments.

* The pointer points to valid memory.
* The pointer points to initialized memory.
* The pointer is properly aligned.

These requirements are discussed in the "Undefined Behavior" section along with the  consequences of using functions that perform bitwise copies without requiring `T: Copy`. I don't love my new descriptions of the consequences of making such copies. Perhaps the old ones were good enough?

Some issues which still need to be addressed before this is merged:
- [ ] The new docs assert that `drop_in_place` is equivalent to calling `read` and discarding the value. Is this correct?
- [ ] Do `write_bytes` and `swap_nonoverlapping` require properly aligned pointers?
- [ ] The new example for `drop_in_place` is a lackluster.
- [ ] Should these docs rigorously define what `valid` memory is? Or should is that the job of the reference? Should we link to the reference?
- [ ] Is it correct to require that pointers that will be read from refer to "valid values of type `T`"?
- [x] I can't imagine ever using `{read,write}_volatile` with non-`Copy` types.  Should I just link to {read,write} and say that the same issues with non-`Copy` types apply?
- [x] `write_volatile` doesn't link back to `read_volatile`.
- [ ] Update docs for the unstable [`swap_nonoverlapping`](https://github.com/rust-lang/rust/issues/42818)
- [ ] Update docs for the unstable [unsafe pointer methods RFC](https://github.com/rust-lang/rfcs/pull/1966)

Looking forward to your feedback.

r? @steveklabnik
2018-05-15 14:26:54 +02:00
Matthew Jasper
dc8ce4c139 Update existing tests for trivial bounds changes 2018-05-15 11:43:59 +01:00
Matthew Jasper
9b0dfe184e Add tests for trivial bounds 2018-05-15 11:43:59 +01:00
Matthew Jasper
dabb820b00 Add trivial bounds lint 2018-05-15 11:43:59 +01:00
Matthew Jasper
27183a9030 Feature gate trivial bounds 2018-05-15 11:43:57 +01:00
Matthew Jasper
d0ec8ea1cc Implement RFC 2056 - trivial constraints 2018-05-15 11:37:33 +01:00
bors
eca0da5985 Auto merge of #50351 - varkor:vestigial-never-conversion, r=nikomatsakis
Remove vestigial diverging !-coercion

Such conversions are no longer permitted. Fixes #50350.

r? @nikomatsakis
2018-05-15 10:34:45 +00:00
Oliver Schneider
0370c38895
Don't inject clippy into the rls anymore 2018-05-15 11:34:24 +02:00
Nick Cameron
a10577ca53 save-analysis: handle aliasing imports a bit more nicely 2018-05-15 20:34:17 +12:00
bors
0b17da2d7b Auto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton
Update stdsimd module

to include a19ca1cd91
2018-05-15 08:19:06 +00:00
bors
d5ecf70fd6 Auto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27
Rustdoc improvements

Fixes #50658. (last commit)

A lot of small improvements.

r? @QuietMisdreavus
2018-05-15 05:39:35 +00:00
bors
d711dc9d57 Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth
Ensure derive(PartialOrd) is no longer accidentally exponential

Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572.

Closes #49505.

r? @Manishearth (sorry for changing it again so soon!)

Close #50755
2018-05-15 03:14:46 +00:00
bors
308b7b05c3 Auto merge of #50705 - oli-obk:clippy, r=kennytm
Update clippy

r? @Manishearth

@bors p=1
2018-05-15 00:35:47 +00:00
Vadim Petrochenkov
d1b027421e Turn deprecation lint legacy_imports into a hard error 2018-05-15 02:25:04 +03:00
John Paul Adrian Glaubitz
df2bbf7960 ci: Add Dockerfile for dist-sparc64-linux 2018-05-15 00:19:30 +02:00
bors
ac5c0848d3 Auto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov
typeck: Save the index of private fields

Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.

Fixes: #50493
2018-05-14 20:46:09 +00:00
QuietMisdreavus
10ac995024 drop unnecessary "warning" from warning text 2018-05-14 15:34:52 -05:00
Taylor Cramer
a74e1686d9 Add implementation of Extend for () 2018-05-14 11:50:44 -07:00
bors
935a2f12b2 Auto merge of #50735 - eddyb:issue-50731, r=nikomatsakis
rustc: don't trip an assertion for enums with present but uninhabited variants.

Fixes #50731.

r? @nikomatsakis
2018-05-14 18:04:11 +00:00
QuietMisdreavus
bb6224bc84 add ui test for rustdoc's deprecated attributes 2018-05-14 12:38:27 -05:00
QuietMisdreavus
9415adcd8a deprecate #![doc(no_default_passes, passes, plugins)] 2018-05-14 12:38:27 -05:00
steveklabnik
647b1add7f Update stdsimd module to include a19ca1cd91 2018-05-14 12:32:04 -04:00
QuietMisdreavus
c3fd12ff4e tidy 2018-05-14 11:03:22 -05:00
QuietMisdreavus
6bc1db0255 replace error/warning println with structured diag 2018-05-14 11:03:22 -05:00
QuietMisdreavus
3566ea853a factor out rustdoc's error message handler 2018-05-14 11:03:22 -05:00
kennytm
2ccf71c3b2
Migrate the toolstate update bot to rust-highfive 2018-05-14 22:34:53 +08:00
Matt Kraai
120cd2cfd6
Uncapitalize "You" 2018-05-14 07:15:48 -07:00
Oliver Schneider
3a5b13ad36
Bump clippy 2018-05-14 16:11:57 +02:00
Nicholas Nethercote
f46b888f73 Remove LazyBTreeMap.
It was introduced in #50240 to avoid an allocation when creating a new
BTreeMap, which gave some speed-ups. But then #50352 made that the
default behaviour for BTreeMap, so LazyBTreeMap is no longer necessary.
2018-05-14 22:27:45 +10:00
bors
cb1ce7ddf8 Auto merge of #50385 - durka:stabilize-macro-lifetime, r=petrochenkov
stabilize macro_lifetime_matcher

This stabilizes `:lifetime` which has completed FCP in #34303.
2018-05-14 12:24:45 +00:00
gnzlbg
50c4506329 Switch Vec from doubling size on growth to using RawVec's reserve
On growth, Vec does not require to exactly double its size for correctness,
like, for example, VecDeque does.

Using reserve instead better expresses this intent. It also allows to reuse
Excess capacity on growth and for better growth-policies to be provided by
RawVec.
2018-05-14 13:58:28 +02:00
Tobias Bucher
6d1da82329 Don't unconditionally set CLOEXEC twice on every fd we open on Linux
Previously, every `open64` was accompanied by a `ioctl(…, FIOCLEX)`,
because some old Linux version would ignore the `O_CLOEXEC` flag we pass
to the `open64` function.

Now, we check whether the `CLOEXEC` flag is set on the first file we
open – if it is, we won't do extra syscalls for every opened file. If it
is not set, we fall back to the old behavior of unconditionally calling
`ioctl(…, FIOCLEX)` on newly opened files.

On old Linuxes, this amounts to one extra syscall per process, namely
the `fcntl(…, F_GETFD)` call to check the `CLOEXEC` flag.

On new Linuxes, this reduces the number of syscalls per opened file by
one, except for the first file, where it does the same number of
syscalls as before (`fcntl(…, F_GETFD)` to check the flag instead of
`ioctl(…, FIOCLEX)` to set it).
2018-05-14 13:20:39 +02:00
John-John Tedro
f73c4a4768 env: remove unwrap in examples in favor of try op 2018-05-14 12:56:18 +02:00
bors
7bfa20b8b0 Auto merge of #50648 - nox:volatile-store, r=eddyb
Fix volatile_store and nontemporal_store

Fixes #50371.
2018-05-14 10:00:41 +00:00
Eduard-Mihai Burtescu
29b4c7b9e0 rustc: don't trip an assertion for enums with present but uninhabited variants. 2018-05-14 12:23:12 +03:00
bors
8f39dbae8c Auto merge of #50703 - semarie:openbsd-libcompiler_builtins, r=alexcrichton
update libcompiler_builtins

let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.

see https://github.com/rust-lang-nursery/compiler-builtins/pull/241 for related PR

note this PR brings some other changes (on `floatdisf`/`floatundisf`) with compiler-builtins update.

r? @alexcrichton
2018-05-14 07:28:48 +00:00
Katrin Leinweber
703ecebe02
Hyperlink DOI against preferred resolver
https://www.doi.org/doi_handbook/3_Resolution.html#3.8
2018-05-14 07:17:56 +02:00
bors
76027ed2ad Auto merge of #50694 - leodasvacas:fix-impl-trait-self-substitution, r=petrochenkov
Fix self referential impl Trait substitutions

A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov
2018-05-14 04:56:56 +00:00
Nicholas Nethercote
e913d69211 Remove StringReader::col.
It only has a single use, within code handling indented block comments.
We can replace that with the new `FileMap::col_pos()`, which computes
the col position (BytePos instead of CharPos) based on the record of the
last newline char (which we already record).

This is actually an improvement, because
`trim_whitespace_prefix_and_push_line()` was using `col`, which is a
`CharPos`, as a slice index, which is a byte/char confusion.
2018-05-14 14:41:34 +10:00
bors
4468e3ea3e Auto merge of #50675 - csmoe:var_span, r=oli-obk
Reduce span highlighted code in unused_variables lint

Fixes #50472
- [X] reduce var span
- [ ] mark applicable

Before:
```
mut unused_mut_var
^^^^^^^^^^^^^^^^^^
```
After:
```
mut unused_mut_var
    ^^^^^^^^^^^^^^
```
2018-05-14 02:24:13 +00:00