Commit Graph

78014 Commits

Author SHA1 Message Date
bors
f0fdaba04e Auto merge of #50767 - oli-obk:rls_clippy, r=kennytm
Don't inject clippy into the rls anymore

r? @kennytm

sorry about breaking nightlies.

The issue is that the `[patch.crates-io]` doesn't work if the versions differ. So every time we update clippy, we can only update it to the verison that rls is depending on.

I'm disabling the injection of clippy into rls for now. I'm not sure how to do this properly. We could

* add a version check, so rls only builds clippy if its dependency clippy is the same as the submodule clippy
* do something crazy like auto-patching the Cargo.toml of the rls tool repo to just use a path dependency on clippy
* build crates-io clippy instead of submodule clippy and gate clippy injection on that
    * that's somewhat automatic, and is essentially what is necessary right now, but done manually
* make clippy 0.1.* instead of 0.0.* and update patch versions for nightly updates and minor version updates for `clippy_lints` api changes.
    * not sure how semver-great this is
2018-05-15 20:18:13 +00:00
bors
27acb9b3c0 Auto merge of #50769 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests

Successful merges:

 - #49767 (Rewrite docs for `std::ptr`)
 - #50399 (save-analysis: handle aliasing imports a bit more nicely)
 - #50594 (Update the man page with additional --print options)
 - #50613 (Migrate the toolstate update bot to rust-highfive)
 - #50632 (Add minification process)
 - #50685 (ci: Add Dockerfile for dist-sparc64-linux)
 - #50691 (rustdoc: Add support for pub(restricted))
 - #50712 (Improve eager type resolution error message)
 - #50720 (Add “Examples” section header in f32/f64 doc comments.)
 - #50733 (Hyperlink DOI against preferred resolver)
 - #50745 (Uncapitalize "You")

Failed merges:
2018-05-15 13:14:08 +00:00
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
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
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
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
steveklabnik
647b1add7f Update stdsimd module to include a19ca1cd91 2018-05-14 12:32:04 -04: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
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
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
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
Dan Robertson
cdd61396c9
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.
2018-05-14 01:28:15 +00:00
Corey Farwell
2c4b152356 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-13 15:54:40 -04:00
Alex Burka
e857c1b790 restore feature for stage0 2018-05-13 19:51:33 +00:00
Alex Burka
e6f7cf7e75 remove stray ui stderr 2018-05-13 19:51:32 +00:00
Alex Burka
394945ee36 stabilize :lifetime 2018-05-13 19:51:32 +00:00
bors
9fae153746 Auto merge of #49835 - da-x:literal-fragment-pr, r=petrochenkov
Macros: Add a 'literal' fragment specifier

See: https://github.com/rust-lang/rust/issues/35625

```rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```

ToDo:

* [x] Feature gate
* [x] Basic tests
* [x] Tests for range patterns
* [x] Tests for attributes
* [x] Documentation
* [x] Fix for `true`/`false`
* [x] Fix for negative number literals
2018-05-13 17:07:38 +00:00
Dan Aloni
37ed2ab910 Macros: Add a 'literal' fragment specifier
Implements RFC 1576.

See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md

Changes are mostly in libsyntax, docs, and tests. Feature gate is
enabled for 1.27.0.

Many thanks to Vadim Petrochenkov for following through code reviews
and suggestions.

Example:

````rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```
2018-05-13 19:17:02 +03:00
leonardo.yvens
87890561f3 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 to where we at some point in the past 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-13 13:02:34 -03:00
csmoe
c4e99dd85d Revert "mark applicability"
This reverts commit a880971128.
2018-05-13 22:56:37 +08:00
csmoe
a880971128 mark applicability 2018-05-13 21:10:15 +08:00
bors
3e955a0581 Auto merge of #50704 - kennytm:rollup, r=kennytm
Rollup of 8 pull requests

Successful merges:

 - #50624 (fs::write: Add example writing a &str)
 - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten)
 - #50644 (AppVeyor: Read back trace from crash dump on failure.)
 - #50661 (Ignore non .rs files for tidy libcoretest)
 - #50663 (rustc: Allow an edition's feature on that edition)
 - #50667 (rustc: Only suggest deleting `extern crate` if it works)
 - #50670 (rustc: Include semicolon when removing `extern crate`)
 - #50678 (Update openbsd targets)

Failed merges:
2018-05-13 11:32:21 +00:00
kennytm
98ce5053df
Rollup merge of #50678 - semarie:openbsd-targets, r=sanxiyn
Update openbsd targets

- add a new target `aarch64-unknown-openbsd`
- update `i686-unknown-openbsd` to use lld with clang, in order to correctly link binaries with `i128`
2018-05-13 17:27:07 +08:00
kennytm
b0d3170485
Rollup merge of #50670 - alexcrichton:remove-extern-crate-correct-span, r=Manishearth
rustc: Include semicolon when removing `extern crate`

Currently the lint for removing `extern crate` suggests removing `extern crate`
most of the time, but the rest of the time it suggest replacing it with `use
crate_name`. Unfortunately though when spliced into the original code you're
replacing

    extern crate foo;

with

    use foo

which is syntactically invalid! This commit ensure that the trailing semicolon
is included in rustc's suggestion to ensure that the code continues to compile
afterwards.
2018-05-13 17:20:31 +08:00
kennytm
ededa9dcd5
Rollup merge of #50667 - alexcrichton:no-remove-extern-crate-unless-works, r=Manishearth
rustc: Only suggest deleting `extern crate` if it works

This commit updates one of the edition lints to only suggest deleting `extern
crate` if it actually works. Otherwise this can yield some confusing behavior
with rustfix specifically where if you accidentally deny the `rust_2018_idioms`
lint in the 2015 edition it's suggesting features that don't work!
2018-05-13 17:20:30 +08:00
kennytm
34cec066d9
Rollup merge of #50663 - alexcrichton:no-removed-error, r=Manishearth
rustc: Allow an edition's feature on that edition

This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes #50662
2018-05-13 17:20:28 +08:00
kennytm
0cf7be217d
Rollup merge of #50661 - varkor:libcoretest-ignore-non-rs, r=alexcrichton
Ignore non .rs files for tidy libcoretest

Previously, any file would be read, which is both unnecessary, and causes issues if irrelevant non-Unicode files were read (e.g. `.DS_STORE`).
2018-05-13 17:20:27 +08:00