Commit Graph

85090 Commits

Author SHA1 Message Date
Pietro Albini
c4723b3673
Rollup merge of #55291 - kazcw:master, r=nikomatsakis
Update stdsimd submodule

Fixes a SSE2 bug. (#55249)
2018-10-25 14:31:17 +02:00
Pietro Albini
539ee06a68
Rollup merge of #55285 - integer32llc:release-notes-improvements, r=Aaronepower
Do some copy editing on the release notes

I was reading through the release notes to find something and noticed
some small grammatical and consistency issues.

I'm happy to revert any of these changes if folks disagree with them!
2018-10-25 14:31:16 +02:00
Pietro Albini
555df0f44f
Rollup merge of #55282 - sinkuu:redundant_clone, r=estebank
Remove redundant clone
2018-10-25 14:31:14 +02:00
Pietro Albini
4f14bfdc73
Rollup merge of #55269 - matthiaskrgr:typos_oct, r=zackmdavis
fix typos in various places
2018-10-25 14:31:13 +02:00
Pietro Albini
88341a9939
Rollup merge of #55254 - rust-lang:clean-two-dots, r=GuillaumeGomez
Correct trailing ellipsis in name_from_pat

r? @GuillaumeGomez
2018-10-25 14:31:12 +02:00
Pietro Albini
f46ee0482f
Rollup merge of #55253 - zackmdavis:some_suggestion, r=pnkfelix
only issue "variant of the expected type" suggestion for enums

This suggestion (introduced in pull-request #43178 / eac74104) was being issued for one-field-struct expected types (in which case it is misleading and outright wrong), even though it was only intended for one-field enum-variants (most notably, `Some`).

Add a conditional to adhere to the original intent. (It would be possible to generalize to structs, but not obviously net desirable.) This adds a level of indentation, so the diff here is going to be
easier to read in [ignore-whitespace mode](https://github.com/rust-lang/rust/commit/b0d3d3b9?w=1).

Resolves #55250.

r? @pnkfelix
2018-10-25 14:31:10 +02:00
Pietro Albini
823244ac04
Rollup merge of #55251 - NieDzejkob:master, r=TimNN
Fix a typo in the documentation of RangeInclusive
2018-10-25 14:31:08 +02:00
Pietro Albini
f740b8a4de
Rollup merge of #55247 - peterjoel:peterjoel-prim-char-doc-example, r=joshtriplett
Clarified code example in char primitive doc

The example was not as clear as it could be because it was making an assumption about the structure of the data in order to multiply the number of elements in the slice by the item size. This change demonstrates the idea more straightforwardly, without needing a calculation, by just comparing the size of the slices.
2018-10-25 14:31:07 +02:00
Pietro Albini
c4e51a2c52
Rollup merge of #55245 - matthiaskrgr:clippy, r=nikomatsakis
submodules: update clippy from 5afdf8b7 to b1d03437

Just a routine update.

Changes:
````
new_ret_no_self: add sample from #3313 to Known Problems section.
Support multiline comments and hopefully fix panic
Check for comments in collapsible ifs
Resolve ICE in needless range loop lint
RIIR update_lints: Update changelog links
Rename if_let_redundant_pattern_matching to redundant_pattern_matching
Add lint for redundant pattern matching for explicit return boolean
Fix issue #3322: reword help message for len_zero
Simplify manual_memcpy suggestion in some cases
Fix dogfood
Update known problems for unnecessary_fold
RIIR update_lints: Replace lint count in README.md
Rename `active_lints` to `usable_lints`
Add comment on WalkDir vs. fs::read_dir
sort_by -> sort_by_key
Some more documentation for clippy_dev
Use `WalkDir` to also gather from subdirectories
Avoid linting `boxed_local` on trait implementations.
Website: Make lint categories linkable
Restore clippy_dummy's placeholder name
Swap order of methods in `needless_range_loop` suggestion in some cases
Revert "Exclude pattern guards from unnecessary_fold lint"
Exclude pattern guards from unnecessary_fold lint
````
2018-10-25 14:31:05 +02:00
Pietro Albini
49eb443b3b
Rollup merge of #55200 - octronics:gh51430, r=kennytm
Documents `From` implementations for `Stdio`

This PR solves part of #51430 by adding a basic summary and an example to each `impl From` inside `process` module (`ChildStdin`, `ChildStdout`, `ChildStderr`, `File`).

It does not document if the conversions allocate memory and how expensive they are.
2018-10-25 14:31:04 +02:00
Pietro Albini
f50e285e30
Rollup merge of #55173 - estebank:suggest-static, r=oli-obk
Suggest appropriate syntax on missing lifetime specifier in return type

Suggest using `'static` when a lifetime is missing in the return type
with a structured suggestion instead of a note.

Fix #55170.
2018-10-25 14:31:03 +02:00
Pietro Albini
6dfeb7602f
Rollup merge of #55138 - zackmdavis:the_paren_trap, r=pnkfelix
in which unused-parens suggestions heed what the user actually wrote

Aaron Hill pointed out that unnecessary parens around a macro call (paradigmatically, `format!`) yielded a suggestion of hideous macro-expanded code. `span_to_snippet` is fallable as far as the type system is concerned, so the pretty-printing can live on in the oft-neglected `else` branch.

Resolves #55109.
2018-10-25 14:31:01 +02:00
Pietro Albini
f81e47f85e
Rollup merge of #54977 - estebank:macro-arg-parse, r=pnkfelix
Accept `Option<Box<$t:ty>>` in macro argument

Given the following code, compile successfuly:

```
macro_rules! test {
    (
        fn fun() -> Option<Box<$t:ty>>;
    ) => {
        fn fun(x: $t) -> Option<Box<$t>>
        { Some(Box::new(x)) }
    }
}

test! {
    fn fun() -> Option<Box<i32>>;
}
```

Fix #25274.
2018-10-25 14:31:00 +02:00
Pietro Albini
699f591a16
Rollup merge of #54965 - chathaway-codes:update-tcp-stream-docs, r=GuillaumeGomez
update tcp stream documentation

A small styling issue that seemed inconsistent here when compared to other places (such as https://doc.rust-lang.org/beta/std/net/struct.TcpListener.html).
2018-10-25 14:30:59 +02:00
Pietro Albini
3bcfa07021
Rollup merge of #53931 - iirelu:keyword-docs, r=steveklabnik
Gradually expanding libstd's keyword documentation

I'm working on adding new keywords to the documentation and refreshing the incomplete older ones, and I'm hoping that I can eventually add all the standalone-usable keywords after a bunch of incremental work. It would be cool to see the keywords section of std's docs be a definitive reference as to what each keyword means when you see it, and that's what I'm aiming towards with this work.

I'm far from a Rust expert so there will inevitably be things to fix in this, also I'm not sure if this should be a bunch of quickly-merged PRs or one gradually-updated PR that gets merged once it's done.
2018-10-25 14:30:58 +02:00
Pietro Albini
18f7d41a65
Rollup merge of #53507 - phungleson:fix-impl-from-for-waker, r=cramertj
Add doc for impl From for Waker

As part of issue #51430 (cc @skade).

The impl is very simple, so not sure if we need to go into any details.
2018-10-25 14:30:56 +02:00
bors
365b9001e5 Auto merge of #54658 - petrochenkov:experelude, r=nikomatsakis
Add `extern crate` items to extern prelude

With this patch each `extern crate orig_name as name` item adds name `name` into the extern prelude, as if it was passed with `--extern`.

What changes this causes in practice?
Almost none! After all, `--extern` passed from Cargo was supposed to replace `extern crate` items in source, so if some code has `extern crate` item (or had it on 2015 edition), then it most likely uses `--extern` as well...

... with exception of a few important cases.

- Crates using `proc_macro`. `proc_macro` is not passed with `--extern` right now and is therefore not in extern prelude.
Together with 2018 edition import behavior this causes problems like https://github.com/rust-lang/rust/issues/54418, e.g.
    ```rust
    extern crate proc_macro;
    use proc_macro::TokenStream;
    ```
    doesn't work.
It starts working after this patch.

- `#[no_std]` crates using `std` conditionally, like @aturon described in https://github.com/rust-lang/rust/issues/53166#issuecomment-425219286, and still wanting to write `std` instead of `crate::std`. This PR covers that case as well.
This allows us to revert placing `std` into the extern prelude unconditionally, which was, I think, a [bad idea](https://github.com/rust-lang/rust/issues/53166#issuecomment-425117829).

- Later `extern crate` syntax can be extended to support adding an alias to some local path to extern prelude, as it may be required for resolving https://github.com/rust-lang/rust/issues/54647.

Notes:
- Only `extern crate` items from the root module added to the prelude, mostly because this behavior for items from inner modules would look very strange, rather than for technical reasons.
This means you can opt out from the prelude additions with something like
    ```rust
    mod inner {
        pub(crate) extern crate foo;
    }
    use inner::foo;
    ```
- I haven't updated logic for 2018 import canaries to work fully correctly with this. The cases where it matters are pretty exotic (the `extern crate` item must be "sufficiently macro expanded") and I'd rather spend the time on eliminating the canaries entirely.
2018-10-25 09:18:17 +00:00
OCTronics
0b82e03a88 Documents From implementations for Stdio
Add a basic summary and an example to From `ChildStdin`, `ChildStdout`,
`ChildStderr`, `File` implementations.
2018-10-24 22:02:32 +02:00
Vadim Petrochenkov
d1e337bded Prohibit macro-expanded extern crate items shadowing crates passed with --extern 2018-10-24 01:33:35 +03:00
Son
35391326a6 Update comment based on suggestion. 2018-10-24 09:28:04 +11:00
Vadim Petrochenkov
7976aa32a9 Minor doc improvements 2018-10-24 00:14:50 +03:00
Vadim Petrochenkov
faefc83a7a Feature gate extern prelude additions from extern crate items
Fix rustdoc and fulldeps tests
2018-10-24 00:14:50 +03:00
Vadim Petrochenkov
0f625ac48d Add extern crate items to extern prelude 2018-10-24 00:14:50 +03:00
iirelu
320ec8137e Hopefully fix compile error
This was added in the fortnight this PR spent stale. I'm hoping this
one-liner fixes it.
2018-10-23 22:27:02 +02:00
bors
f99911a4a0 Auto merge of #55229 - nikomatsakis:issue-54692-closure-signatures, r=MatthewJasper
enforce user annotations in closure signatures

Not *quite* ready yet but I'm opening anyway. Still have to finish running tests locally.

Fixes #54692
Fixes #54124

r? @matthewjasper
2018-10-23 17:44:19 +00:00
Kaz Wesley
3d9231c453 Update stdsimd submodule
Fixes a SSE2 bug.
2018-10-23 09:51:02 -07:00
Niko Matsakis
4394c83cb7 type_check/mod.rs: rustfmt 2018-10-23 10:57:06 -04:00
Niko Matsakis
1371cd27d0 check the self type is well-formed
This fixes `issue-28848.rs` -- it also handles another case that the
AST region checker gets wrong (`wf-self-type.rs`).  I don't actually
think that this is the *right way* to be enforcing this constraint --
I think we should probably do it more generally, perhaps by editing
`predicates_of` for the impl itself. The chalk-style implied bounds
setup ought to fix this.
2018-10-23 10:32:46 -04:00
Matthias Krüger
4972beaf65 fix typos in various places 2018-10-23 15:56:25 +02:00
Carol (Nichols || Goulding)
8d6ee8f54a
Do some copy editing on the release notes
I was reading through the release notes to find something and noticed
some small grammatical and consistency issues.
2018-10-23 07:53:48 -04:00
bors
d74b40205f Auto merge of #55281 - alexcrichton:revert-demote, r=petrochenkov
Revert "rustc: Fix (again) simd vectors by-val in ABI"

This reverts commit 3cc8f738d4.
2018-10-23 10:56:41 +00:00
bors
7cfe5de214 Auto merge of #55113 - mockersf:master, r=estebank
#45829 when a renamed import conflict with a previous import

Fix the suggestion when a renamed import conflict.

It check if the snipped contains `" as "`, and if so uses everything before for the suggestion.
2018-10-23 08:17:18 +00:00
Shotaro Yamada
fda3326a5a Remove redundant clone 2018-10-23 17:13:59 +09:00
Alex Crichton
086f5a55be Revert "rustc: Fix (again) simd vectors by-val in ABI"
This reverts commit 3cc8f738d4.
2018-10-23 00:59:14 -07:00
bors
d570b36cd9 Auto merge of #54778 - scottmcm:stabilize-ihle, r=pnkfelix
Stabilize impl_header_lifetime_elision in 2015

~~This is currently blocked on https://github.com/rust-lang/rust/issues/54902; it should be good after that~~

It's already stable in 2018; this finishes the stabilization.

FCP completed (https://github.com/rust-lang/rust/issues/15872#issuecomment-417953153), proposal (https://github.com/rust-lang/rust/issues/15872#issuecomment-412759783).

Tracking issue: https://github.com/rust-lang/rust/issues/15872
Usage examples (from libcore): https://github.com/rust-lang/rust/pull/54687
2018-10-23 04:05:50 +00:00
bors
979fb16db9 Auto merge of #55231 - zackmdavis:determinate, r=oli-obk
pick a reference issue for absolute-paths future incompatibility info

It would be kind of embarrassing to ship with the "issue TBD" message!
2018-10-23 01:24:26 +00:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
dd91c8fc5a [review comments] modify test and clean up code
Co-Authored-By: estebank <esteban@kuber.com.ar>
2018-10-22 14:56:03 -07:00
Esteban Küber
d0bd69a2d5 review comments 2018-10-22 14:56:02 -07:00
Esteban Küber
e1e52eb5a0 Suggest appropriate syntax on missing lifetime specifier in return type
Suggest using `'static` when a lifetime is missing in the return type
with a structured suggestion instead of a note.
2018-10-22 14:54:29 -07:00
Niko Matsakis
64b5599352 stop reporting "unsatisfied lifetime bounds" errors after the first
In particular, after the first for a given region variable. This
suppresses a lot of duplicate errors.
2018-10-22 11:41:46 -04:00
Niko Matsakis
2921fbaaa8 flesh out closure-substs test 2018-10-22 10:04:47 -04:00
Niko Matsakis
0afccbb654 fix incremental test 2018-10-22 10:04:47 -04:00
Niko Matsakis
dbbdce51dc add regression test for #54124
Fixes #54124
2018-10-22 10:04:47 -04:00
Niko Matsakis
3a17880539 start enforcing closure types 2018-10-22 10:04:47 -04:00
Niko Matsakis
e0871ed318 record supplied sig of closure 2018-10-22 10:04:47 -04:00
Niko Matsakis
a8f3d6dafc convert user-provided signatures into def-id 2018-10-22 10:04:47 -04:00
Niko Matsakis
167b460961 add a table to track user-provided signatures 2018-10-22 10:00:32 -04:00
François Mockers
8fe6688fcf better dummy span detection and remove redundant branch 2018-10-22 09:08:09 +02:00
bors
a66dc8a148 Auto merge of #55224 - kryptan:master, r=matthewjasper
Use a keyword in raw identifier example

That's a very small documentation fix. The text says "you can now use keywords as identifiers" but example didn't use a keyword and would work without raw identifiers.
2018-10-22 03:41:28 +00:00
bors
5481485670 Auto merge of #55126 - GuillaumeGomez:improve-search-tabs, r=QuietMisdreavus
improve search tabs look

Fixes #55056.

![screenshot from 2018-10-16 19-06-48](https://user-images.githubusercontent.com/3050060/47034247-1e08b280-d177-11e8-9c1e-c7320af9b561.png)

![screenshot from 2018-10-16 19-09-39](https://user-images.githubusercontent.com/3050060/47034255-2365fd00-d177-11e8-8686-4765d3e56ff5.png)

With this, I think it'll be more obvious.

cc @memoryruins

r? @QuietMisdreavus
2018-10-22 01:04:52 +00:00