Commit Graph

85124 Commits

Author SHA1 Message Date
Michael Woerister
5dedf0cead CI: Set codegen-units-std=1 for dist builds. 2018-10-26 15:07:03 +02:00
Michael Woerister
9e51b57fdd Make configure.py handle numeric arguments for --set a little better. 2018-10-26 15:07:03 +02:00
Michael Woerister
b8f977a8a7 bootstrap: Allow for build libstd to have its own codegen-unit setting. 2018-10-26 15:07:03 +02:00
bors
82239b04dc Auto merge of #55362 - ehuss:releases-cargo-new-edition, r=Mark-Simulacrum
Remove `cargo new --edition` from release notes.

This was removed at the last minute (#55315, https://github.com/rust-lang/cargo/pull/6216).
Apologies for not catching this.
2018-10-26 02:58:28 +00:00
bors
7b0735a832 Auto merge of #54145 - nrc:save-path-segments, r=petrochenkov
Keep resolved defs in path prefixes and emit them in save-analysis

Closes https://github.com/nrc/rls-analysis/issues/109

r? @eddyb or @petrochenkov
2018-10-26 00:04:29 +00:00
Eric Huss
19c4e36486 Remove cargo new --edition from release notes. 2018-10-25 13:57:56 -07:00
Nick Cameron
6dd5bb18d7 more reviewer changes 2018-10-26 09:50:51 +13:00
Nick Cameron
63ac2aae51 Fix tests and assertions; add some comments 2018-10-26 09:50:51 +13:00
Nick Cameron
59cb1705d7 rebasing and reviewer changes
Primarily refactoring `(Ident, Option<NodeId>)` to `Segment`
2018-10-26 09:50:51 +13:00
Nick Cameron
8ac3272610 save-analysis: handle missing field names
FIxes https://github.com/rust-lang-nursery/rls/issues/1031
2018-10-26 09:48:44 +13:00
Nick Cameron
cdcbdfdf0a Fix tests and rustdoc 2018-10-26 09:48:44 +13:00
Nick Cameron
c480386391 dump refs for path segments in save-analysis
Requires adding path segments to the hir map
2018-10-26 09:48:44 +13:00
Nick Cameron
609d0bd8ac dump data for prefix path segments 2018-10-26 09:48:44 +13:00
Nick Cameron
c2bb7cadf2 save-analysis: remove hacky, unnecessary code now that we have spans for every ident 2018-10-26 09:48:44 +13:00
Nick Cameron
b49da276b3 Store a resolved def on hir::PathSegment 2018-10-26 09:48:44 +13:00
Nick Cameron
fc67d8fac4 Give each PathSegment a NodeId 2018-10-26 09:48:44 +13:00
bors
4bd4e4130e Auto merge of #54490 - wesleywiser:rewrite_it_in_mir, r=oli-obk
Rewrite the `UnconditionalRecursion` lint to use MIR

Part of #51002

r? @eddyb
2018-10-25 20:40:31 +00:00
bors
8ec22e7ec7 Auto merge of #55347 - pietroalbini:rollup, r=pietroalbini
Rollup of 22 pull requests

Successful merges:

 - #53507 (Add doc for impl From for Waker)
 - #53931 (Gradually expanding libstd's keyword documentation)
 - #54965 (update tcp stream documentation)
 - #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
 - #55138 (in which unused-parens suggestions heed what the user actually wrote)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55200 (Documents `From` implementations for `Stdio`)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #55247 (Clarified code example in char primitive doc)
 - #55251 (Fix a typo in the documentation of RangeInclusive)
 - #55253 (only issue "variant of the expected type" suggestion for enums)
 - #55254 (Correct trailing ellipsis in name_from_pat)
 - #55269 (fix typos in various places)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)
 - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs)
 - #55306 (Regression test for #54478.)
 - #55328 (Fix doc for new copysign functions)
 - #55340 (Operands no longer appear in places)
 - #55345 (Remove is_null)
 - #55348 (Update RELEASES.md after destabilization of non_modrs_mods)

Failed merges:

r? @ghost
2018-10-25 14:40:22 +00:00
Pietro Albini
ea5aad66b4
Rollup merge of #55348 - pietroalbini:backport-stable-notes, r=pietroalbini
Backports the release notes update from stable to master.

r? @ghost
2018-10-25 16:00:39 +02:00
Pietro Albini
7a39bc452b
Update RELEASES.md after destabilization of non_modrs_mods 2018-10-25 15:54:31 +02:00
Pietro Albini
5443f7b017
Rollup merge of #55345 - RalfJung:no-null, r=oli-obk
Remove is_null

It was confusingly named (`is_zero` would have been better, as someone pointed out somewhere but I forgot who or where), and it didn't even reliably test for "is this value 0 at run-time" because out-of-bounds pointers *can* be 0.

It's not used in rustc, and miri only really needs `is_null_ptr` and `to_bytes() == 0`, so let's just kill this method.

r? @oli-obk
2018-10-25 14:31:24 +02:00
Pietro Albini
83906ec6ad
Rollup merge of #55340 - RalfJung:operand-docs, r=oli-obk
Operands no longer appear in places

Fix an outdated comment.
2018-10-25 14:31:22 +02:00
Pietro Albini
401ee42893
Rollup merge of #55328 - raphlinus:copysign_typo, r=joshtriplett
Fix doc for new copysign functions

Thanks to @LukasKalbertodt for catching this. Addresses a comment raised in #55169 after it was merged.
2018-10-25 14:31:21 +02:00
Pietro Albini
b3e57dbdf6
Rollup merge of #55306 - pnkfelix:issue-54478-regression-test-jemalloc-ctl, r=nikomatsakis
Regression test for #54478.

This is a regression test for #54478.

I confirmed that it fails on:
rustdoc 1.30.0-beta.12 (96a229824 2018-10-04)
and passes on:
rustdoc 1.31.0-nightly (f99911a4a 2018-10-23)

Fix #54478
2018-10-25 14:31:20 +02:00
Pietro Albini
1220e1354a
Rollup merge of #55296 - cuviper:rustdoc-ui-backtrace, r=nikomatsakis
Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs

This UI test is sensitive to backtrace output, so it should make sure
that backtraces are not enabled by the environment.
2018-10-25 14:31:18 +02:00
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
3476ac0bee Auto merge of #55323 - nikomatsakis:nll-ICE-55219-and-55241, r=pnkfelix
introduce type-op for user-type ascription in NLL

Handle user-type ascription in a type operator, which gives us a lot more flexibility around the order in which we resolve things.

r? @pnkfelix

Fixes #55219
Fixes #55241
2018-10-25 12:00:50 +00:00
Ralf Jung
cbe6b2298a Remove is_null
It was confusingly named (`is_zero` would have been better), and it didn't even
reliably test for "is this value 0 at run-time" because out-of-bounds pointers
*can* be 0.
2018-10-25 11:39:54 +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
Ralf Jung
431b254ffb Operands no longer appear in places 2018-10-25 08:58:12 +02:00
Raph Levien
538f65eb61 Fix doc for new copysign functions
Thanks to @LukasKalbertodt for catching this. Addresses a comment
raised in #55169 after it was merged.
2018-10-24 15:19:23 -07: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
Niko Matsakis
62f0fc5112 port the relate-types code from NLL type-check into a type-op
Add regression tests for #55219 and #55241

Also another test where a duplicate-like error appears to have been
suppressed; I'm not 100% sure why this output changes, though I could
imagine that some duplicate suppression is enabled by this PR.
2018-10-24 15:12:50 -04:00
Niko Matsakis
7c8887ccbf introduce (but do not use) ascribe_user_type goal
Lots of annoying boilerplate.
2018-10-24 15:12:40 -04:00
Felix S. Klock II
be2075c661 This is a regression test for #54478.
I confirmed that it fails on:
rustdoc 1.30.0-beta.12 (96a229824 2018-10-04)
and passes on:
rustdoc 1.31.0-nightly (f99911a4a 2018-10-23)
2018-10-24 12:19:47 +02:00