]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agosave-analysis: handle function types in bounds
Nick Cameron [Wed, 1 Nov 2017 04:59:06 +0000 (17:59 +1300)]
save-analysis: handle function types in bounds

This special cases the function type sugar in paths and deals with traits bounds as just the path parts. That required refactoring the path collector to distinguish between variable decls and references in patterns, basically just to please the borrow checker.

cc https://github.com/nrc/rls-analysis/issues/37

6 years agoAuto merge of #45597 - DSpeckhals:rustfmt-update, r=nrc
bors [Sun, 29 Oct 2017 21:25:12 +0000 (21:25 +0000)]
Auto merge of #45597 - DSpeckhals:rustfmt-update, r=nrc

tools: Update rustfmt and re-enable testing

This allows rustfmt and the RLS to test and compile again.

6 years agoUpdate rustfmt again
Dustin Speckhals [Sun, 29 Oct 2017 19:16:02 +0000 (15:16 -0400)]
Update rustfmt again

6 years agoAuto merge of #45616 - fhartwig:ptr-docs, r=dtolnay
bors [Sun, 29 Oct 2017 18:44:16 +0000 (18:44 +0000)]
Auto merge of #45616 - fhartwig:ptr-docs, r=dtolnay

Fix references to zero_memory and copy_memory in ptr docs

Fixes #45606

6 years agoMerge branch 'master' into rustfmt-update
Dustin Speckhals [Sun, 29 Oct 2017 17:27:06 +0000 (13:27 -0400)]
Merge branch 'master' into rustfmt-update

6 years agoAuto merge of #45611 - Manishearth:lint-generics, r=petrochenkov
bors [Sun, 29 Oct 2017 15:22:38 +0000 (15:22 +0000)]
Auto merge of #45611 - Manishearth:lint-generics, r=petrochenkov

Add generics to LateContext

Fixes clippy breakage from https://github.com/rust-lang/rust/pull/44766 as discussed in https://github.com/rust-lang-nursery/rust-clippy/pull/2140#issuecomment-336973875

r? @nikomatsakis

6 years agoFix references to zero_memory and copy_memory in ptr docs
Florian Hartwig [Sun, 29 Oct 2017 14:40:09 +0000 (15:40 +0100)]
Fix references to zero_memory and copy_memory in ptr docs

6 years agoUpdate clippy
Manish Goregaokar [Sun, 29 Oct 2017 09:27:34 +0000 (05:27 -0400)]
Update clippy

6 years agoAuto merge of #45295 - Technius:docs/process, r=steveklabnik
bors [Sun, 29 Oct 2017 06:24:20 +0000 (06:24 +0000)]
Auto merge of #45295 - Technius:docs/process, r=steveklabnik

Improve std::process module docs

Addresses part of #29370

I've changed the first `cat` example to a "Hello World" example involving echo, and I've also added another example showing how to pipe output. I'm still working on the module-level description.

For now, I'd like feedback on the examples.

r? @steveklabnik

6 years agoAdd no_run to process examples involving unix commands
Bryan Tan [Sun, 29 Oct 2017 03:24:49 +0000 (20:24 -0700)]
Add no_run to process examples involving unix commands

6 years agoAuto merge of #45554 - integer32llc:update-book, r=steveklabnik
bors [Sun, 29 Oct 2017 02:16:24 +0000 (02:16 +0000)]
Auto merge of #45554 - integer32llc:update-book, r=steveklabnik

Update the book for a fix to the print button

Fixes #45552.

Brings in recent improvements in the text that we've made recently as well.

r? @steveklabnik

6 years agoUpdate the book for a fix to the print button
Carol (Nichols || Goulding) [Thu, 26 Oct 2017 18:49:12 +0000 (14:49 -0400)]
Update the book for a fix to the print button

Fixes #45552.

6 years agoAuto merge of #45580 - kennytm:sdkmanager, r=alexcrichton
bors [Sat, 28 Oct 2017 23:40:31 +0000 (23:40 +0000)]
Auto merge of #45580 - kennytm:sdkmanager, r=alexcrichton

ci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.

* SDK tools is upgraded to 27.0.0.

* Stopped using the deprecated `android` tool, instead use the recommended `sdkmanager` and `avdmanager`.

* NDK is upgrade to r15c.

    The r15 series [dropped support for android-9](https://github.com/android-ndk/ndk/wiki/Changelog-r15) (2.3 / Gingerbread), the minimal supported version is now android-14 (4.0 / Ice Cream Sandwich).

r? @alexcrichton

(WIP, haven't confirmed if the change really works yet)

6 years agoci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.
kennytm [Fri, 27 Oct 2017 19:14:25 +0000 (03:14 +0800)]
ci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.

* SDK tools is upgraded to 27.0.0.
   - Refactored to use `sdkmanager`/`avdmanager` instead of the deprecated
     `android` tool.

* The Java version used by Android SDK is downgraded to OpenJDK-8, in order
  to download the SDK through HTTPS.

* NDK is upgrade to r15c.
   - Dropped support for android-9 (2.3 / Gingerbread), the minimal
     supported version is now android-14 (4.0 / Ice Cream Sandwich).
   - Changed the default Android compiler from GCC to clang.
   - For details of change introduced by NDK r15, see
     https://github.com/android-ndk/ndk/wiki/Changelog-r15.

6 years agoAdd generics field to LateContext
Manish Goregaokar [Sat, 28 Oct 2017 21:19:07 +0000 (17:19 -0400)]
Add generics field to LateContext

6 years agoAuto merge of #45540 - virgil-palanciuc:master, r=estebank
bors [Sat, 28 Oct 2017 21:01:07 +0000 (21:01 +0000)]
Auto merge of #45540 - virgil-palanciuc:master, r=estebank

Avoid repetition on “use of unstable library feature 'rustc_private'”

This PR fixes the error by only emitting it when the span contains a real file (is not inside a macro) - and making sure it's emitted only once per span.
The first check was needed because spans-within-macros seem to differ a lot and "fixing" them to the real location is not trivial (and the method that does this is private to another module). It also feels like there always will be an error on import, with the real file name, so not sure there's a point to re-emit the same error at macro use.

Fix #44953.

6 years agofixed tidy error
Virgil Palanciuc [Sat, 28 Oct 2017 19:38:15 +0000 (22:38 +0300)]
fixed tidy error

6 years agoUpdate rustfmt
Dustin Speckhals [Sat, 28 Oct 2017 17:46:43 +0000 (13:46 -0400)]
Update rustfmt

This allows rustfmt and the RLS to test and compile again.

6 years agoimplemented code review
Virgil Palanciuc [Sat, 28 Oct 2017 17:39:00 +0000 (20:39 +0300)]
implemented code review

6 years agoAuto merge of #45489 - oli-obk:json_diagnostics, r=petrochenkov
bors [Sat, 28 Oct 2017 16:15:17 +0000 (16:15 +0000)]
Auto merge of #45489 - oli-obk:json_diagnostics, r=petrochenkov

Fix a quadradic duplication in json for multi-suggestions

r? @petrochenkov

6 years agoAuto merge of #44295 - plietar:extern-types, r=arielb1
bors [Sat, 28 Oct 2017 13:34:12 +0000 (13:34 +0000)]
Auto merge of #44295 - plietar:extern-types, r=arielb1

Implement RFC 1861: Extern types

A few notes :

- Type parameters are not supported. This was an unresolved question from the RFC. It is not clear how useful this feature is, and how variance should be treated. This can be added in a future PR.

- `size_of_val` / `align_of_val` can be called with extern types, and respectively return 0 and 1. This differs from the RFC, which specified that they should panic, but after discussion with @eddyb on IRC this seems like a better solution.
If/when a `DynSized` trait is added, this will be disallowed statically.

- Auto traits are not implemented by default, since the contents of extern types is unknown. This means extern types are `!Sync`, `!Send` and `!Freeze`. This seems like the correct behaviour to me.
Manual `unsafe impl Sync for Foo` is still possible.

- This PR allows extern type to be used as the tail of a struct, as described by the RFC :
```rust
extern {
    type OpaqueTail;
}

#[repr(C)]
struct FfiStruct {
    data: u8,
    more_data: u32,
    tail: OpaqueTail,
}
```

However this is undesirable, as the alignment of `tail` is unknown (the current PR assumes an alignment of 1). Unfortunately we can't prevent it in the general case as the tail could be a type parameter :
```rust
#[repr(C)]
struct FfiStruct<T: ?Sized> {
    data: u8,
    more_data: u32,
    tail: T,
}
```

Adding a `DynSized` trait would solve this as well, by requiring tail fields to be bound by it.

- Despite being unsized, pointers to extern types are thin and can be casted from/to integers. However it is not possible to write a `null<T>() -> *const T` function which works with extern types, as I've explained here : https://github.com/rust-lang/rust/issues/43467#issuecomment-321678621

- Trait objects cannot be built from extern types. I intend to support it eventually, although how this interacts with `DynSized`/`size_of_val` is still unclear.

- The definition of `c_void` is unmodified

6 years agoAuto merge of #45589 - kennytm:rollup, r=kennytm
bors [Sat, 28 Oct 2017 09:42:38 +0000 (09:42 +0000)]
Auto merge of #45589 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

- Successful merges: #45421, #45449, #45505, #45535, #45549, #45574, #45585
- Failed merges:

6 years agoRollup merge of #45585 - frewsxcv:frewsxcv-diagnostic, r=kennytm
kennytm [Sat, 28 Oct 2017 07:56:25 +0000 (15:56 +0800)]
Rollup merge of #45585 - frewsxcv:frewsxcv-diagnostic, r=kennytm

Remove 'future Rust version' code block in diagnostic text.

Fixes https://github.com/rust-lang/rust/issues/43780.

6 years agoRollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnik
kennytm [Sat, 28 Oct 2017 07:56:24 +0000 (15:56 +0800)]
Rollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnik

Fixed rustc_on_unimplemented example in Unstable Book

I saw [this](https://doc.rust-lang.org/beta/unstable-book/language-features/on-unimplemented.html) example and it seemed wrong. This fixes the example to emit an error message that makes more sense.

6 years agoRollup merge of #45549 - steveklabnik:remove-just, r=QuietMisdreavus
kennytm [Sat, 28 Oct 2017 07:56:23 +0000 (15:56 +0800)]
Rollup merge of #45549 - steveklabnik:remove-just, r=QuietMisdreavus

Remove 'just' in diagnostics

This is better writing

6 years agoRollup merge of #45535 - topecongiro:bootstrap-exit-code, r=kennytm
kennytm [Sat, 28 Oct 2017 07:56:22 +0000 (15:56 +0800)]
Rollup merge of #45535 - topecongiro:bootstrap-exit-code, r=kennytm

Return 0 as an exit status when no subcommand is given to bootstrap

Running `./x.py` emits usage and error messages when no subcommand is given:
```
Usage: x.py <subcommand> [options] [<paths>...]

Subcommands:
    build       Compile either the compiler or libraries
    test        Build and run some test suites
    bench       Build and run some benchmarks
    doc         Build documentation
    clean       Clean out build directories
    dist        Build distribution artifacts
    install     Install distribution artifacts

To learn more about a subcommand, run `./x.py <subcommand> -h`

failed to run: /home/topecongiro/rust/build/bootstrap/debug/bootstrap
```
IMHO the last line is unnecessary. This PR removes it by changing the return code of `bootstrap` to 0 when no sub command is given.

6 years agoRollup merge of #45505 - spk:use-expect-instead-unwrap, r=kennytm
kennytm [Sat, 28 Oct 2017 07:56:21 +0000 (15:56 +0800)]
Rollup merge of #45505 - spk:use-expect-instead-unwrap, r=kennytm

Use expect for current_dir on librustc/session mod

Reference bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871638

Like described on the reference bug report:

~~~
$ mkdir dir
$ cd dir
$ rm -rf ../dir
$ RUST_BACKTRACE=1 rustc -C target-cpu=help
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', src/libcore/result.rs:837
stack backtrace:
   1:     0x7f7d23970dda - <unknown>
   2:     0x7f7d2398305f - <unknown>
   3:     0x7f7d2397f8a5 - <unknown>
   4:     0x7f7d2397ffc7 - std::panicking::rust_panic_with_hook::h109e116a3a861224
   5:     0x7f7d2397fe54 - <unknown>
   6:     0x7f7d2397fd79 - std::panicking::begin_panic_fmt::h26713cea9bce3ab0
   7:     0x7f7d2397fd07 - rust_begin_unwind
   8:     0x7f7d239cb41d - core::panicking::panic_fmt::hcfbb59eeb7f27f75
   9:     0x7f7d20be63d3 - <unknown>
  10:     0x7f7d20d6ebcc - rustc::session::build_session_::h7a3559f2373a5d05
  11:     0x7f7d20d6dd7e - rustc::session::build_session_with_codemap::h68bc7bcd2f34eee4
  12:     0x7f7d20d6d72c - rustc::session::build_session::h437fda3c327a8bde
  13:     0x7f7d23d26030 - <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::no_input::h8047df7741757d1c
  14:     0x7f7d23d21d27 - rustc_driver::run_compiler::hafe7bbfedf95a825
  15:     0x7f7d23c57378 - <unknown>
  16:     0x7f7d2398ae0a - __rust_maybe_catch_panic
  17:     0x7f7d23c76fa8 - <unknown>
  18:     0x7f7d2397eb74 - <unknown>
  19:     0x7f7d1ed4f493 - start_thread
  20:     0x7f7d23645afe - __clone
  21:                0x0 - <unknown>
~~~

With this patch this will give instead:

~~~
error: Current directory is invalid: No such file or directory (os error 2)
~~~

6 years agoRollup merge of #45449 - frewsxcv:frewsxcv-udp-nonblocking, r=sfackler
kennytm [Sat, 28 Oct 2017 07:56:20 +0000 (15:56 +0800)]
Rollup merge of #45449 - frewsxcv:frewsxcv-udp-nonblocking, r=sfackler

Improve docs for UdpSocket::set_nonblocking.

Closes https://github.com/rust-lang/rust/issues/44050.

6 years agoRollup merge of #45421 - QuietMisdreavus:update-pulldown, r=steveklabnik
kennytm [Sat, 28 Oct 2017 07:56:19 +0000 (15:56 +0800)]
Rollup merge of #45421 - QuietMisdreavus:update-pulldown, r=steveklabnik

rustdoc: update pulldown + fix spurious rendering difference around footnotes

fixes #45420

6 years agoAuto merge of #45566 - cuviper:option-checking, r=alexcrichton
bors [Sat, 28 Oct 2017 07:08:52 +0000 (07:08 +0000)]
Auto merge of #45566 - cuviper:option-checking, r=alexcrichton

configure.py: fix --disable-option-checking and extra config paths

- indexing 'option-checking' out of `known_args` had a type error
- when option checking is disabled, don't error on duplicate args, just take the last
- add config.toml stubs for datadir, infodir, and localstatedir (which were already accepted, but broken)

---

This fixes a regression from 1.21 to beta, when the configure script was rewritten in python.

6 years agoAuto merge of #45503 - thombles:tk/i44339-v5, r=petrochenkov
bors [Sat, 28 Oct 2017 03:02:17 +0000 (03:02 +0000)]
Auto merge of #45503 - thombles:tk/i44339-v5, r=petrochenkov

Improve diagnostics when list of tokens has incorrect separators

Make `parse_seq_to_before_tokens` more resilient to error conditions. Where possible it is better if it can consume up to the final bracket before returning. This change improves the diagnostics in a couple of situations:

```
struct S(pub () ()); // omitted separator
use std::{foo. bar}; // used a similar but wrong separator
```

Fixes #44339
r? @petrochenkov

6 years agoRemove 'future Rust version' code block in diagnostic text.
Corey Farwell [Sat, 28 Oct 2017 02:49:56 +0000 (22:49 -0400)]
Remove 'future Rust version' code block in diagnostic text.

Fixes https://github.com/rust-lang/rust/issues/43780.

6 years agoMove type_has_metadata to trans_utils
Paul Liétar [Fri, 27 Oct 2017 21:36:18 +0000 (23:36 +0200)]
Move type_has_metadata to trans_utils

6 years agofix rebase
Paul Liétar [Fri, 27 Oct 2017 20:58:17 +0000 (22:58 +0200)]
fix rebase

6 years agoUndo changes to core::ptr
Paul Liétar [Thu, 5 Oct 2017 00:12:59 +0000 (02:12 +0200)]
Undo changes to core::ptr

6 years agoImplement RFC 1861: Extern types
Paul Lietar [Sun, 3 Sep 2017 18:53:58 +0000 (19:53 +0100)]
Implement RFC 1861: Extern types

6 years agoAuto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrum
bors [Fri, 27 Oct 2017 18:00:32 +0000 (18:00 +0000)]
Auto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrum

Bump to 1.23 and update bootstrap

This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies

6 years agoFix tidy error line longer than 100 chars
Laurent Arnoud [Fri, 27 Oct 2017 17:31:33 +0000 (19:31 +0200)]
Fix tidy error line longer than 100 chars

6 years agoQuit immediately when current directory is invalid
Laurent Arnoud [Fri, 27 Oct 2017 17:14:03 +0000 (19:14 +0200)]
Quit immediately when current directory is invalid

Thanks-to: @kennytm
6 years agoUpdate license exceptions.
kennytm [Fri, 27 Oct 2017 14:12:51 +0000 (22:12 +0800)]
Update license exceptions.

The `zircon` crates have been renamed as `fuchsia-zircon`.

6 years agoAuto merge of #45570 - nrc:manifest-no-rls, r=alexcrichton
bors [Fri, 27 Oct 2017 15:03:47 +0000 (15:03 +0000)]
Auto merge of #45570 - nrc:manifest-no-rls, r=alexcrichton

Don't fail to build a manifest if a tarball is missing

This is guesswork because I can't test build_manifest nor do I know what is actually causing the error to begin with. My hypothesis is that when we try to find the version from the RLS tarball and the tarball is not there, then we panic. I attempt to fix this by making the version string optional, then not adding the RLS package, rename, and extension component if the version is missing.

In theory, this should fix the broken nightlies.

r? @alexcrichton

6 years agoAuto merge of #45531 - steveklabnik:fix-unstable-book-formatting, r=kennytm
bors [Fri, 27 Oct 2017 11:16:27 +0000 (11:16 +0000)]
Auto merge of #45531 - steveklabnik:fix-unstable-book-formatting, r=kennytm

Fix formatting in unstable book's attr-literals section

6 years agoFixed rustc_on_unimplemented example in Unstable Book
Nadav Zingerman [Fri, 27 Oct 2017 09:42:44 +0000 (12:42 +0300)]
Fixed rustc_on_unimplemented example in Unstable Book

6 years agoAuto merge of #45353 - wesleywiser:untracked_queries, r=michaelwoerister
bors [Fri, 27 Oct 2017 08:34:45 +0000 (08:34 +0000)]
Auto merge of #45353 - wesleywiser:untracked_queries, r=michaelwoerister

[incremental] Add support for eval always queries

Part of #45238

6 years agoDon't fail to build a manifest if a tarball is missing
Nick Cameron [Fri, 27 Oct 2017 05:46:16 +0000 (18:46 +1300)]
Don't fail to build a manifest if a tarball is missing

6 years agoAuto merge of #45524 - alexcrichton:improve-park-unpark, r=dtolnay
bors [Fri, 27 Oct 2017 02:19:16 +0000 (02:19 +0000)]
Auto merge of #45524 - alexcrichton:improve-park-unpark, r=dtolnay

std: Optimize thread park/unpark implementation

This is an adaptation of alexcrichton/futures-rs#597 for the standard library.
The goal here is to avoid locking a mutex on the "fast path" for thread
park/unpark where you're waking up a thread that isn't sleeping or otherwise
trying to park a thread that's already been notified. Mutex performance varies
quite a bit across platforms so this should provide a nice consistent speed
boost for the fast path of these functions.

6 years agoReturn 0 when ./x.py has no subcommand
topecongiro [Wed, 25 Oct 2017 21:03:07 +0000 (06:03 +0900)]
Return 0 when ./x.py has no subcommand

6 years agoconfig.toml: Add stubs for recognized-but-unused install paths
Josh Stone [Thu, 26 Oct 2017 23:30:17 +0000 (16:30 -0700)]
config.toml: Add stubs for recognized-but-unused install paths

... specifically `datadir`, `infodir`, and `localstatedir`.  These were
already accepted by `configure.py`, but it didn't have any place to put
the values.

6 years agoconfigure.py: fix --disable-option-checking
Josh Stone [Thu, 26 Oct 2017 22:56:59 +0000 (15:56 -0700)]
configure.py: fix --disable-option-checking

Getting the value of this argument needs another level of indexing,
as `known_args` are stored in `{dict}[list](opt, value)` form.

Also, when option-checking is disabled, let this bypass the check that
options are only passed once, and just apply the last value.

6 years agoAuto merge of #45523 - alexcrichton:improve-libbacktrace, r=sfackler
bors [Thu, 26 Oct 2017 23:48:16 +0000 (23:48 +0000)]
Auto merge of #45523 - alexcrichton:improve-libbacktrace, r=sfackler

std: Disable usage of mmap allocator in libbacktrace

This is sort of a long overdue change from the investigation in #29293
and #37477. The released binaries of rustc don't have debug information and so
don't actively suffer this problem but this can hit local development of rustc
and also larger programs compiled against libstd generating backtraces.

The main purpose of the mmap allocator in libacktrace is to be usable from a
signal handler, but we don't do that, so the normal allocator using malloc/free
should work well for us.

6 years agoSwitch several crate-wide queries to use eval_always
Wesley Wiser [Mon, 23 Oct 2017 23:08:08 +0000 (19:08 -0400)]
Switch several crate-wide queries to use eval_always

Closes #45238

6 years agoHandle eval_always queries in force()
Wesley Wiser [Mon, 23 Oct 2017 22:10:29 +0000 (18:10 -0400)]
Handle eval_always queries in force()

Part of #45238

6 years agoAllow declaring a DepNode as eval_always
Wesley Wiser [Mon, 23 Oct 2017 22:07:21 +0000 (18:07 -0400)]
Allow declaring a DepNode as eval_always

Part of #45238

6 years ago[incremental] Add support for eval always queries
Wesley Wiser [Wed, 18 Oct 2017 02:50:33 +0000 (22:50 -0400)]
[incremental] Add support for eval always queries

Part of #45238

6 years agoBump to 1.23 and update bootstrap
Alex Crichton [Sat, 14 Oct 2017 15:20:03 +0000 (08:20 -0700)]
Bump to 1.23 and update bootstrap

This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies

6 years agoAuto merge of #45522 - michaelwoerister:fix-stable-hasher-cross, r=arielb1
bors [Thu, 26 Oct 2017 20:58:08 +0000 (20:58 +0000)]
Auto merge of #45522 - michaelwoerister:fix-stable-hasher-cross, r=arielb1

Fix 32- vs 64-bit platform instability in StableHasher.

This might already be enough to fix issue https://github.com/rust-lang/rust/issues/45500.

r? @alexcrichton

6 years agoAuto merge of #45519 - michaelwoerister:dedup-errors, r=arielb1
bors [Thu, 26 Oct 2017 18:16:15 +0000 (18:16 +0000)]
Auto merge of #45519 - michaelwoerister:dedup-errors, r=arielb1

Don't emit the same compiler diagnostic twice.

This PR makes the compiler filter out diagnostic messages that have already been emitted during the same compilation session.

6 years agorelax restriction - allow errors to be emmitted within macro spans, as long as the...
Virgil Palanciuc [Thu, 26 Oct 2017 16:34:39 +0000 (09:34 -0700)]
relax restriction - allow errors to be emmitted within macro spans, as long as the same error message has not been used before (i.e. use the None as the span key, for errors that occur within macros)

6 years agoUse expect for current_dir on librustc/session mod
Laurent Arnoud [Tue, 24 Oct 2017 20:07:50 +0000 (22:07 +0200)]
Use expect for current_dir on librustc/session mod

6 years agoAuto merge of #45380 - dotdash:arg_copies, r=arielb1
bors [Thu, 26 Oct 2017 14:14:15 +0000 (14:14 +0000)]
Auto merge of #45380 - dotdash:arg_copies, r=arielb1

Avoid unnecessary copies of arguments that are simple bindings

Initially MIR differentiated between arguments and locals, which
introduced a need to add extra copies assigning the argument to a
local, even for simple bindings. This differentiation no longer exists,
but we're still creating those copies, bloating the MIR and LLVM IR we
emit.

Additionally, the current approach means that we create debug info for
both the incoming argument (marking it as an argument), and then
immediately shadow it a local that goes by the same name. This can be
confusing when using e.g. "info args" in gdb, or when e.g. a debugger
with a GUI displays the function arguments separately from the local
variables, especially when the binding is mutable, because the argument
doesn't change, while the local variable does.

6 years agoImprove docs for UdpSocket::set_nonblocking.
Corey Farwell [Sun, 22 Oct 2017 13:27:26 +0000 (09:27 -0400)]
Improve docs for UdpSocket::set_nonblocking.

Closes https://github.com/rust-lang/rust/issues/44050.

6 years agoRemove 'just' in diagnostics
steveklabnik [Thu, 26 Oct 2017 13:27:20 +0000 (09:27 -0400)]
Remove 'just' in diagnostics

This is better writing

6 years agoAdd comments to clarify function argument ownership
Björn Steinbrink [Wed, 25 Oct 2017 11:04:59 +0000 (13:04 +0200)]
Add comments to clarify function argument ownership

6 years agoAvoid unnecessary copies of arguments that are simple bindings
Björn Steinbrink [Wed, 11 Oct 2017 18:49:36 +0000 (20:49 +0200)]
Avoid unnecessary copies of arguments that are simple bindings

Initially MIR differentiated between arguments and locals, which
introduced a need to add extra copies assigning the argument to a
local, even for simple bindings. This differentiation no longer exists,
but we're still creating those copies, bloating the MIR and LLVM IR we
emit.

Additionally, the current approach means that we create debug info for
both the incoming argument (marking it as an argument), and then
immediately shadow it a local that goes by the same name. This can be
confusing when using e.g. "info args" in gdb, or when e.g. a debugger
with a GUI displays the function arguments separately from the local
variables, especially when the binding is mutable, because the argument
doesn't change, while the local variable does.

6 years agoUpdate some comments about StableHasher.
Michael Woerister [Thu, 26 Oct 2017 09:10:07 +0000 (11:10 +0200)]
Update some comments about StableHasher.

6 years agoAuto merge of #45488 - oli-obk:ctfe_resolve, r=eddyb
bors [Thu, 26 Oct 2017 07:04:33 +0000 (07:04 +0000)]
Auto merge of #45488 - oli-obk:ctfe_resolve, r=eddyb

Resolve types properly in const eval

r? @eddyb

cc @arielb1

6 years agoAuto merge of #45464 - sinkuu:ice_44851, r=jseyfried
bors [Thu, 26 Oct 2017 04:32:16 +0000 (04:32 +0000)]
Auto merge of #45464 - sinkuu:ice_44851, r=jseyfried

Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor`

Fixes #44851.

6 years agoAuto merge of #45096 - DSpeckhals:update-rls-data-for-save-analysis, r=alexcrichton
bors [Thu, 26 Oct 2017 00:58:52 +0000 (00:58 +0000)]
Auto merge of #45096 - DSpeckhals:update-rls-data-for-save-analysis, r=alexcrichton

Update rls-data for save analysis

rls-data: 0.10 -> 0.11

This will allow for more fine-grained save analysis for enum variants (tuple and struct).

The first commit updates rls-data, and makes the changes to dump_visitor. The second commit updates the rls submodule, and removes "members" that were deleted from that update in src/Cargo.toml.

Note, that when building the project, rustfmt-nightly was updated in Cargo.lock. If these changes should be excluded, I can revert it.

cc/ @nrc

6 years agoAdd FIXME
sinkuu [Thu, 26 Oct 2017 00:28:25 +0000 (09:28 +0900)]
Add FIXME

6 years agofix #44953 - The “use of unstable library feature 'rustc_private'” error is very...
Virgil Palanciuc [Wed, 25 Oct 2017 23:56:13 +0000 (16:56 -0700)]
fix #44953 - The “use of unstable library feature 'rustc_private'” error is very repetitive

6 years agoAuto merge of #45532 - kennytm:rollup, r=kennytm
bors [Wed, 25 Oct 2017 22:21:44 +0000 (22:21 +0000)]
Auto merge of #45532 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

- Successful merges: #45059, #45212, #45398, #45483, #45496, #45508, #45526
- Failed merges:

6 years agoRollup merge of #45526 - alexcrichton:test-more-asm, r=aturon
kennytm [Wed, 25 Oct 2017 19:02:54 +0000 (03:02 +0800)]
Rollup merge of #45526 - alexcrichton:test-more-asm, r=aturon

ci: Test more asmjs again

This was accidentally added in #45352, forgot to back it out!

6 years agoRollup merge of #45508 - bgermann:master, r=alexcrichton
kennytm [Wed, 25 Oct 2017 19:02:53 +0000 (03:02 +0800)]
Rollup merge of #45508 - bgermann:master, r=alexcrichton

Disable jemalloc for sparcv9-sun-solaris

Similar to #36994, rust programs segfault on SPARC64 Solaris machines.

6 years agoRollup merge of #45496 - kennytm:bootstrap-fix-extension-check, r=alexcrichton
kennytm [Wed, 25 Oct 2017 19:02:52 +0000 (03:02 +0800)]
Rollup merge of #45496 - kennytm:bootstrap-fix-extension-check, r=alexcrichton

rustbuild: Fix `no output generated` error for next bootstrap cargo.

Due to rust-lang/cargo#4570, a `*.dll.lib` file is uplifted when building dynamic libraries on Windows. The current bootstrap code does not understand files with multiple extensions, and will instead assume `xxxx.dll` is the file name. This caused a `no output generated` error because it tries to search for `xxxx.dll-hash.lib` inside the `deps/` folder, while it should check for `xxxx-hash.dll.lib` instead.

This PR is blocking #45285, see https://github.com/rust-lang/rust/pull/45285#issuecomment-338454149 and the rest of the comments for detail.

6 years agoRollup merge of #45483 - mbrubeck:hash, r=alexcrichton
kennytm [Wed, 25 Oct 2017 19:02:51 +0000 (03:02 +0800)]
Rollup merge of #45483 - mbrubeck:hash, r=alexcrichton

Implement Hash for raw pointers to unsized types

This is useful for some niche cases, like a hash table of slices or trait objects where the key is the raw pointer.  Example use case: https://docs.rs/by_address

6 years agoRollup merge of #45398 - integer32llc:reassignment, r=arielb1
kennytm [Wed, 25 Oct 2017 19:02:50 +0000 (03:02 +0800)]
Rollup merge of #45398 - integer32llc:reassignment, r=arielb1

Correct misspelling in error text: re-assignment => reassignment

[reassignment is the correct spelling](https://www.thefreedictionary.com/reassignment) rather than re-assignment; this error message looks silly in the book next to text trying to be grammatically correct :-/

Will this cause any stability/backcompat type issues?

6 years agoRollup merge of #45212 - GuillaumeGomez:sidebar-fixed, r=QuietMisdreavus
kennytm [Wed, 25 Oct 2017 19:02:49 +0000 (03:02 +0800)]
Rollup merge of #45212 - GuillaumeGomez:sidebar-fixed, r=QuietMisdreavus

Limit the sidebar height

The sidebar is now fixed, which means its scrolling is independent of the main page now.

r? @rust-lang/docs

6 years agoRollup merge of #45059 - tmccombs:pid, r=alexcrichton
kennytm [Wed, 25 Oct 2017 19:02:48 +0000 (03:02 +0800)]
Rollup merge of #45059 - tmccombs:pid, r=alexcrichton

Add current_pid function

Fixes #44971

6 years agoFix formatting in unstable book's attr-literals section
steveklabnik [Wed, 25 Oct 2017 18:23:13 +0000 (14:23 -0400)]
Fix formatting in unstable book's attr-literals section

6 years agoAuto merge of #44636 - GuillaumeGomez:little-error-msg, r=michaelwoerister
bors [Wed, 25 Oct 2017 18:19:42 +0000 (18:19 +0000)]
Auto merge of #44636 - GuillaumeGomez:little-error-msg, r=michaelwoerister

Add short error message-format

Fixes #42653.

6 years agoImplement Hash for raw pointers to unsized types
Matt Brubeck [Mon, 23 Oct 2017 21:21:00 +0000 (14:21 -0700)]
Implement Hash for raw pointers to unsized types

6 years agoci: Test more asmjs again
Alex Crichton [Wed, 25 Oct 2017 16:58:48 +0000 (09:58 -0700)]
ci: Test more asmjs again

This was accidentally added in #45352, forgot to back it out!

6 years agostd: Optimize thread park/unpark implementation
Alex Crichton [Wed, 25 Oct 2017 15:35:51 +0000 (08:35 -0700)]
std: Optimize thread park/unpark implementation

This is an adaptation of alexcrichton/futures-rs#597 for the standard library.
The goal here is to avoid locking a mutex on the "fast path" for thread
park/unpark where you're waking up a thread that isn't sleeping or otherwise
trying to park a thread that's already been notified. Mutex performance varies
quite a bit across platforms so this should provide a nice consistent speed
boost for the fast path of these functions.

6 years agoAuto merge of #45513 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 25 Oct 2017 15:34:03 +0000 (15:34 +0000)]
Auto merge of #45513 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

- Successful merges: #45361, #45461, #45465, #45486, #45502
- Failed merges:

6 years agoReword to avoid using either re-assignment or reassignment in errors
Carol (Nichols || Goulding) [Wed, 25 Oct 2017 15:29:14 +0000 (11:29 -0400)]
Reword to avoid using either re-assignment or reassignment in errors

6 years agostd: Disable usage of mmap allocator in libbacktrace
Alex Crichton [Wed, 25 Oct 2017 14:51:36 +0000 (07:51 -0700)]
std: Disable usage of mmap allocator in libbacktrace

This is sort of a long overdue change from the investigation in #29293
and #37477. The released binaries of rustc don't have debug information and so
don't actively suffer this problem but this can hit local development of rustc
and also larger programs compiled against libstd generating backtraces.

The main purpose of the mmap allocator in libacktrace is to be usable from a
signal handler, but we don't do that, so the normal allocator using malloc/free
should work well for us.

6 years agoFix 32 vs 64 bit platform instability in StableHasher.
Michael Woerister [Wed, 25 Oct 2017 14:49:55 +0000 (16:49 +0200)]
Fix 32 vs 64 bit platform instability in StableHasher.

6 years agoUpdate ui tests for error message deduplication.
Michael Woerister [Wed, 25 Oct 2017 13:02:41 +0000 (15:02 +0200)]
Update ui tests for error message deduplication.

6 years agoUpdate compile-fail tests for error message deduplication.
Michael Woerister [Wed, 25 Oct 2017 13:02:26 +0000 (15:02 +0200)]
Update compile-fail tests for error message deduplication.

6 years agolibrustc_errors: Don't emit the same error message twice.
Michael Woerister [Wed, 25 Oct 2017 13:01:06 +0000 (15:01 +0200)]
librustc_errors: Don't emit the same error message twice.

6 years agoAuto merge of #45476 - Xanewok:fingerprint-disambiguator, r=michaelwoerister
bors [Wed, 25 Oct 2017 12:38:10 +0000 (12:38 +0000)]
Auto merge of #45476 - Xanewok:fingerprint-disambiguator, r=michaelwoerister

Use 128 bit instead of Symbol for crate disambiguator

As discussed on gitter, this changes `crate_disambiguator` from Strings to what they are represented as, a 128 bit number.

There's also one bit I think also needs to change, but wasn't 100% sure how: [create_root_def](https://github.com/rust-lang/rust/blob/f338dba29705e144bad8b2a675284538dd514896/src/librustc/hir/map/definitions.rs#L468-L482). Should I change `DefKey::root_parent_stable_hash` to accept `Fingerprint` as crate_disambiguator to quickly combine the hash of `crate_name` with the new 128 bit hash instead of a string for a disambiguator?

r? @michaelwoerister

EDIT: Are those 3 tests `mir-opt` failing, because the hash is different, because we calculate it a little bit differently (storing directly instead of hashing the hex-string representation)? Should it be updated like in #45319?

6 years agoRename some run-pass tests so they don't crash when executed from eCryptfs.
Michael Woerister [Wed, 25 Oct 2017 11:15:04 +0000 (13:15 +0200)]
Rename some run-pass tests so they don't crash when executed from eCryptfs.

6 years agoAdd a regression test for the const eval type resolution
Oliver Schneider [Wed, 25 Oct 2017 07:13:41 +0000 (09:13 +0200)]
Add a regression test for the const eval type resolution

6 years agoResolve types properly in const eval
Oliver Schneider [Tue, 24 Oct 2017 13:10:23 +0000 (15:10 +0200)]
Resolve types properly in const eval

6 years agoRollup merge of #45502 - GuillaumeGomez:show-src-on-mobile, r=QuietMisdreavus
Guillaume Gomez [Wed, 25 Oct 2017 07:48:12 +0000 (09:48 +0200)]
Rollup merge of #45502 - GuillaumeGomez:show-src-on-mobile, r=QuietMisdreavus

Show src button and function version on mobile version

Fixes #45498.

<img width="1440" alt="screen shot 2017-10-24 at 22 36 09" src="https://user-images.githubusercontent.com/3050060/31966689-c0070404-b90b-11e7-8810-810fa0491eda.png">

r? @rust-lang/docs

6 years agoRollup merge of #45486 - oli-obk:patch-9, r=kennytm
Guillaume Gomez [Wed, 25 Oct 2017 07:48:11 +0000 (09:48 +0200)]
Rollup merge of #45486 - oli-obk:patch-9, r=kennytm

Update docs for Diagnostic::span_suggestion(s)

6 years agoRollup merge of #45465 - glaubitz:sparc64, r=alexcrichton
Guillaume Gomez [Wed, 25 Oct 2017 07:48:10 +0000 (09:48 +0200)]
Rollup merge of #45465 - glaubitz:sparc64, r=alexcrichton

bootstrap: Add openssl configuration for sparc64-unknown-linux-gnu

Hi!

This adds the target missing mapping for sparc64-unknown-linux-gnu.

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

Thanks

6 years agoRollup merge of #45461 - wesleywiser:intrinsics_docs, r=dtolnay
Guillaume Gomez [Wed, 25 Oct 2017 07:48:09 +0000 (09:48 +0200)]
Rollup merge of #45461 - wesleywiser:intrinsics_docs, r=dtolnay

Two small enhancements to intrinsics docs

6 years agoRollup merge of #45361 - GuillaumeGomez:fs-docs, r=QuietMisdreavus
Guillaume Gomez [Wed, 25 Oct 2017 07:48:08 +0000 (09:48 +0200)]
Rollup merge of #45361 - GuillaumeGomez:fs-docs, r=QuietMisdreavus

Add missing code examples

r? @rust-lang/docs

6 years agoCompiletest should parse suggestions from the spans
Oliver Schneider [Wed, 25 Oct 2017 06:33:02 +0000 (08:33 +0200)]
Compiletest should parse suggestions from the spans