Commit Graph

85475 Commits

Author SHA1 Message Date
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
Marc-Antoine Perennou
bbc3cd4378 rustbuild: fix remap-debuginfo when building a release
Fallback to the release number as we can't get the
git commit sha as we're not in a git repository.

Fixes #55341

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-10-25 10:31:44 +02: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
Esteban Küber
f8818cbf8f Fix incorrect semicolon suggestion 2018-10-24 12:52:24 -07:00
Steve Klabnik
569228a45e
Fix link to macros chapter
We're gonna link to nightly as this didn't make it into the corresponding stable.
2018-10-24 15:33:48 -04: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
Esteban Küber
1ab45ec7e3 Point to macro def span instead of whole body 2018-10-24 11:34:23 -07:00
Masaki Hara
1c4864708f Remove license headers from unsized-locals tests. 2018-10-24 23:27:17 +09:00
Masaki Hara
4fd895a6b8 Add autoderef tests for by-value trait objects. 2018-10-24 23:18:15 +09:00
Masaki Hara
b3dce87a86 Move compile-fail/unsized-locals under ui as per #44844. 2018-10-24 22:55:40 +09:00
Masaki Hara
e568e98063 Move codegen_llvm::common::ty_fn_sig into rustc::ty::Instance. 2018-10-24 21:59:07 +09:00
Masaki Hara
06b6b1c790 Make declare_fn accept PolyFnSig instead of Ty. 2018-10-24 21:59:07 +09:00
Masaki Hara
2075316064 Include InstanceDef's discriminant in the symbol hash. 2018-10-24 21:59:07 +09:00
Masaki Hara
609cc26d31 Ensure virtual call receiver PassMode. 2018-10-24 21:59:07 +09:00
Masaki Hara
7c965e3e65 Prefer Move over Copy when dereferencing rvalue objects. 2018-10-24 21:59:07 +09:00
Masaki Hara
7ccf661524 Reflect by-value object safety in the unstable book. 2018-10-24 21:59:07 +09:00
Masaki Hara
4ce35fdd34 Add tests for unsized-locals. 2018-10-24 21:59:07 +09:00
Masaki Hara
5eceab02ec Implement by-value trait object method call. 2018-10-24 21:59:07 +09:00
Masaki Hara
f2ef005d1d Resolve to Instance::VtableShim when necessary. 2018-10-24 21:59:07 +09:00
Masaki Hara
250979c0ae Implement vtable shim generation. 2018-10-24 21:59:07 +09:00
Masaki Hara
1fb085511e Make declare_fn aware of vtable shims. 2018-10-24 21:59:06 +09:00
Masaki Hara
fe3f606cda Add ty_fn_sig_vtable for getting adjusted signature for vtable shims. 2018-10-24 21:59:06 +09:00
Masaki Hara
824315a722 Distinguish vtable shims in symbol paths. 2018-10-24 21:59:06 +09:00
Masaki Hara
6fd914a1af Add vtable-shim helper methods for Instance. 2018-10-24 21:59:06 +09:00
Masaki Hara
0ad4c6f850 Add InstanceDef::VtableShim. 2018-10-24 21:59:06 +09:00
Alex Crichton
3c25f80f85 ci: Move global credentials to web configuration
This commit moves a number of our encrypted credentials stored in
configuration files in this repository to env vars on the web UI. This
will hopefully make it easier to rotate credentials in the future as
well as quickly change them if the need arises. (quicker than landing a
PR that is).

This also updates the travis deployment process to always use the `aws`
command line tool which we're already installing on Linux and should
enable us to avoid all `dpl` gem issues as well as have greater control
over what's going where.
2018-10-24 05:42:33 -07: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
Esteban Küber
8227a938a4 Point at macro definition when no rules expect token 2018-10-23 21:44:46 -07:00
Josh Stone
f2443a9b20 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-23 15:38:31 -07: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
Esteban Küber
ad144ac3c1 Modify invalid macro in expression context diagnostic 2018-10-23 10:07:34 -07:00
Esteban Küber
8544db0faa Add macro call span when lacking any other span in diagnostic 2018-10-23 10:07:11 -07: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