]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agosparc64-linux support
Jorge Aparicio [Fri, 30 Dec 2016 06:34:06 +0000 (01:34 -0500)]
sparc64-linux support

7 years agoAdd sparc64-unknown-netbsd target
Jonathan A. Kollasch [Sat, 3 Dec 2016 14:53:13 +0000 (08:53 -0600)]
Add sparc64-unknown-netbsd target

7 years agolibpanic_unwind: UNWIND_DATA_REG for sparc64
Jonathan A. Kollasch [Tue, 6 Dec 2016 22:00:09 +0000 (16:00 -0600)]
libpanic_unwind: UNWIND_DATA_REG for sparc64

7 years agolibunwind: unwinder_private_data_size for sparc64
Jonathan A. Kollasch [Tue, 6 Dec 2016 21:59:15 +0000 (15:59 -0600)]
libunwind: unwinder_private_data_size for sparc64

7 years agolibstd: define std::env::consts::ARCH for sparc64
Jonathan A. Kollasch [Tue, 6 Dec 2016 21:57:43 +0000 (15:57 -0600)]
libstd: define std::env::consts::ARCH for sparc64

7 years agoliballoc_*: add MIN_ALIGN for sparc64
Jonathan A. Kollasch [Tue, 6 Dec 2016 21:55:11 +0000 (15:55 -0600)]
liballoc_*: add MIN_ALIGN for sparc64

7 years agoAdd cabi_sparc64
Jonathan A. Kollasch [Sat, 3 Dec 2016 16:55:50 +0000 (10:55 -0600)]
Add cabi_sparc64

7 years agofurther enable the Sparc LLVM backend
Jonathan A. Kollasch [Sat, 3 Dec 2016 16:53:31 +0000 (10:53 -0600)]
further enable the Sparc LLVM backend

7 years agoAuto merge of #38503 - brson:bootstrap, r=alexcrichton
bors [Thu, 29 Dec 2016 19:34:23 +0000 (19:34 +0000)]
Auto merge of #38503 - brson:bootstrap, r=alexcrichton

Bump bootstrap compiler

r? @alexcrichton

I'm not clear on whether cargo will need to additionally be bumped beyond what's in https://github.com/rust-lang/rust/pull/38470

7 years agoFallout from updating bootstrap Cargo
Alex Crichton [Thu, 29 Dec 2016 04:13:10 +0000 (20:13 -0800)]
Fallout from updating bootstrap Cargo

7 years agoBump bootstrap compiler
Brian Anderson [Tue, 20 Dec 2016 22:40:46 +0000 (22:40 +0000)]
Bump bootstrap compiler

7 years agoAuto merge of #38627 - rkruppe:ninja-build, r=alexcrichton
bors [Thu, 29 Dec 2016 13:48:50 +0000 (13:48 +0000)]
Auto merge of #38627 - rkruppe:ninja-build, r=alexcrichton

Accept ninja-build binary in place of ninja

See comment in the diff for rationale.

r? @alexcrichton

7 years agoAuto merge of #38571 - nrc:emit-metadata-change, r=alexcrichton
bors [Thu, 29 Dec 2016 11:01:11 +0000 (11:01 +0000)]
Auto merge of #38571 - nrc:emit-metadata-change, r=alexcrichton

Change --crate-type metadata to --emit=metadata

WIP

7 years agoAuto merge of #38645 - nikomatsakis:incr-comp-fix-time-depth, r=nrc
bors [Thu, 29 Dec 2016 08:16:58 +0000 (08:16 +0000)]
Auto merge of #38645 - nikomatsakis:incr-comp-fix-time-depth, r=nrc

propagate TIME_DEPTH to the helper threads for -Z time-passes

Currently, the timing measurements for LLVM passes and the like don't come out indented, which messes up `perf.rust-lang.org`.

r? @nrc

7 years agoSupport --emit=foo,metadata
Nick Cameron [Thu, 29 Dec 2016 00:23:38 +0000 (13:23 +1300)]
Support --emit=foo,metadata

7 years agoAuto merge of #38619 - alexcrichton:less-android-flaky, r=brson
bors [Thu, 29 Dec 2016 02:44:28 +0000 (02:44 +0000)]
Auto merge of #38619 - alexcrichton:less-android-flaky, r=brson

travis: Attempt to fix Android flakiness

There's been some flaky runs on Travis where the Android emulator is having
problems staying alive... presumably? For example:

* https://travis-ci.org/rust-lang/rust/jobs/186736745

This commit spawns the emulator in the same way as buildbot with `nohup` to hope
that it goes into the background successfully, followed by a `wait-for-device`
command. I'm not actually sure if this'll fix the problems we're seeing, but I
figure it can't hurt to test out.

7 years agoRestore --crate-type=metadata as an alias for --crate-type=rlib,--emit=metadata ...
Nick Cameron [Tue, 27 Dec 2016 21:12:11 +0000 (10:12 +1300)]
Restore --crate-type=metadata as an alias for --crate-type=rlib,--emit=metadata + a warning

7 years agoAdd a test for #38273
Nick Cameron [Tue, 27 Dec 2016 20:35:48 +0000 (09:35 +1300)]
Add a test for #38273

Closes 38273

7 years agoChange --crate-type metadata to --emit=metadata
Nick Cameron [Fri, 23 Dec 2016 06:39:20 +0000 (19:39 +1300)]
Change --crate-type metadata to --emit=metadata

7 years agoAuto merge of #38449 - eddyb:lazy-10, r=nikomatsakis
bors [Wed, 28 Dec 2016 20:19:39 +0000 (20:19 +0000)]
Auto merge of #38449 - eddyb:lazy-10, r=nikomatsakis

[10/n] Split constants and functions' arguments into disjoint bodies.

_This is part of a series ([prev](https://github.com/rust-lang/rust/pull/38053) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

Finishes the signature-body split started in #37918, namely:
* `trait` items are separated just like `impl` items were, for uniformity, closing #37712
* `static`s, `const`s (including associated ones), `enum` discriminants and array lengths get bodies
  * even the count in "repeat expressions", i.e. `n` in `[x; n]`, which fixes #24414
* arguments' patterns are moved to the bodies, with the types staying in `FnDecl`
  * `&self` now desugars to `self: &Self` instead of `self: &_` (similarly for other `self` forms)
  * `astconv`'s and metadata's (for rustdoc) informative uses are explicitly ignored for the purposes of the dep graph. this could be fixed in the future by hashing the exact information being extracted about the arguments as opposed to generating a dependency on *the whole body*

7 years agoAuto merge of #38639 - xen0n:nightly-dist-hotfix, r=brson
bors [Wed, 28 Dec 2016 17:27:13 +0000 (17:27 +0000)]
Auto merge of #38639 - xen0n:nightly-dist-hotfix, r=brson

rustbuild: Hotfix to unbreak nightly

Fixes an oversight unnoticed in #38468 that eventually broke nightly packaging. I didn't realize this until some moments ago, when I finally found out the failure is actually deterministic. Many apologies for eating 3 nightlies during the holidays.

r? @alexcrichton

7 years agoAuto merge of #38626 - redox-os:args_fix, r=alexcrichton
bors [Wed, 28 Dec 2016 14:33:48 +0000 (14:33 +0000)]
Auto merge of #38626 - redox-os:args_fix, r=alexcrichton

Fix argument handling on Redox

After switching the start code to be handled in libc, we are no longer passing in slices as arguments into the libstd main function. This means that handling had to be rewritten to match the unix way of doing things.

Additional commits on this branch are going to be merged in this PR: https://github.com/rust-lang/rust/pull/38577#issuecomment-269138394

7 years agoAuto merge of #38616 - pnkfelix:refactor-mir-dataflow-remove-ctxt, r=arielb1
bors [Wed, 28 Dec 2016 09:42:46 +0000 (09:42 +0000)]
Auto merge of #38616 - pnkfelix:refactor-mir-dataflow-remove-ctxt, r=arielb1

Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait

Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait

I no longer remember why I needed this (or thought I did). The way
that the `BitDenotation` is passed around in all existing use cases
(and planned future ones), the thing that were in the `Ctxt` can just
be part of `Self` instead.

(I think ariel had been pushing me to do this back when I first put in
this infrastructure; it took me a while to see how much of pain the
`Ctxt` was causing.)

7 years agorustdoc: pretty-print nested bodies in inlined constants.
Eduard-Mihai Burtescu [Tue, 27 Dec 2016 09:15:26 +0000 (11:15 +0200)]
rustdoc: pretty-print nested bodies in inlined constants.

7 years agorustc: always print nested nodes where a HIR map is available.
Eduard-Mihai Burtescu [Tue, 27 Dec 2016 08:00:18 +0000 (10:00 +0200)]
rustc: always print nested nodes where a HIR map is available.

7 years agorustc: simplify constant cross-crate loading and rustc_passes::consts.
Eduard-Mihai Burtescu [Tue, 20 Dec 2016 21:05:21 +0000 (23:05 +0200)]
rustc: simplify constant cross-crate loading and rustc_passes::consts.

7 years agorustc: move function arguments into hir::Body.
Eduard-Mihai Burtescu [Tue, 20 Dec 2016 20:46:11 +0000 (22:46 +0200)]
rustc: move function arguments into hir::Body.

7 years agorustc: separate bodies for static/(associated)const and embedded constants.
Eduard-Mihai Burtescu [Wed, 21 Dec 2016 10:32:59 +0000 (12:32 +0200)]
rustc: separate bodies for static/(associated)const and embedded constants.

7 years agorustc: separate TraitItem from their parent Item, just like ImplItem.
Eduard-Mihai Burtescu [Sun, 4 Dec 2016 02:21:06 +0000 (04:21 +0200)]
rustc: separate TraitItem from their parent Item, just like ImplItem.

7 years agohir: lower `ImplicitSelf` to resolved `Self` TyQPath's.
Eduard-Mihai Burtescu [Sun, 4 Dec 2016 01:18:11 +0000 (03:18 +0200)]
hir: lower `ImplicitSelf` to resolved `Self` TyQPath's.

7 years agoAuto merge of #38589 - aidanhs:aphs-stage0-rustdoc-test, r=alexcrichton
bors [Wed, 28 Dec 2016 07:05:07 +0000 (07:05 +0000)]
Auto merge of #38589 - aidanhs:aphs-stage0-rustdoc-test, r=alexcrichton

Teach `rustdoc --test` about `--sysroot`, pass it when testing rust

This permits rustdoc tests to work in stage0.

Logical continuation of #36586.

Snippet from https://github.com/rust-lang/rust/issues/38575#issuecomment-269090724:

> it should actually be possible to run all the libstd tests immediately after creating std of stage0-out - there's no reason to build librustc at all if you've just made a change to (for example) libcollections, `./x.py test src/libcollections --stage 0 -v --incremental` should just work

This PR makes it so (or appears to in my testing).

r? @alexcrichton

7 years agoAuto merge of #38579 - whitequark:min_atomic_width, r=alexcrichton
bors [Wed, 28 Dec 2016 04:12:11 +0000 (04:12 +0000)]
Auto merge of #38579 - whitequark:min_atomic_width, r=alexcrichton

Add a min_atomic_width target option, like max_atomic_width

Rationale: some ISAs, e.g. OR1K, do not have atomic instructions
for byte and halfword access, and at the same time do not have
a fixed endianness, which makes it unreasonable to implement these
through word-sized atomic accesses.

7 years agorustbuild: fix host-only rules ignoring targets in dist steps
Wang Xuerui [Tue, 27 Dec 2016 17:49:25 +0000 (01:49 +0800)]
rustbuild: fix host-only rules ignoring targets in dist steps

`arr` is the actual list of targets participating in steps construction,
but due to #38468 the hosts array now consists of only the build triple
for the `dist` steps, hence all non-build-triple targets are lost for
the host-only rules.

Fix this by using the original non-shadowed hosts array in `arr`
calculation. This should unbreak the nightly packaging process.

Fixes #38637.

7 years agopropagate TIME_DEPTH to the helper threads for -Z time-passes
Niko Matsakis [Wed, 28 Dec 2016 02:35:34 +0000 (21:35 -0500)]
propagate TIME_DEPTH to the helper threads for -Z time-passes

7 years agoAuto merge of #38479 - michaelwoerister:extern_mod_ich, r=nikomatsakis
bors [Wed, 28 Dec 2016 01:30:31 +0000 (01:30 +0000)]
Auto merge of #38479 - michaelwoerister:extern_mod_ich, r=nikomatsakis

ICH: Fix and test foreign mod hashing.

r? @nikomatsakis

7 years agoAuto merge of #38329 - ollie27:rustdoc_stab_em_div, r=steveklabnik
bors [Tue, 27 Dec 2016 21:10:31 +0000 (21:10 +0000)]
Auto merge of #38329 - ollie27:rustdoc_stab_em_div, r=steveklabnik

rustdoc: Fix invalid HTML in stability notices

`em` tags cannot contain `p` tags so use `div`s instead of `em`s as the Markdown will create `p` tags.

7 years agorustbuild: clarify comment on target array calculation
Wang Xuerui [Tue, 27 Dec 2016 17:54:09 +0000 (01:54 +0800)]
rustbuild: clarify comment on target array calculation

The comment touched, as originally written, only concerned itself with
the `test` steps. However, since #38468 the `arr` variable actually has
gained an indirect relationship with the `dist` steps too. The comment
failed to convey the extra meaning, contributing to the misunderstanding
which eventually lead to #38637. Fix that by moving the comment into the
right place near the relevant condition, and properly documenting
`arr`'s purpose.

7 years agorustbuild: get an empty slice the straight-forward way
Wang Xuerui [Tue, 27 Dec 2016 19:39:35 +0000 (03:39 +0800)]
rustbuild: get an empty slice the straight-forward way

7 years agoAuto merge of #38600 - arielb1:dead-drop, r=eddyb
bors [Tue, 27 Dec 2016 18:25:22 +0000 (18:25 +0000)]
Auto merge of #38600 - arielb1:dead-drop, r=eddyb

clear discriminant drop flag at the bottom of a drop ladder

Fixes #38437.

Beta-nominating because serious I-wrong.

r? @eddyb

7 years agoFix arguments on Redox
Jeremy Soller [Tue, 27 Dec 2016 00:08:27 +0000 (17:08 -0700)]
Fix arguments on Redox

7 years agoAccept ninja-build binary in place of ninja
Robin Kruppe [Tue, 27 Dec 2016 01:13:16 +0000 (02:13 +0100)]
Accept ninja-build binary in place of ninja

7 years agoAuto merge of #38577 - redox-os:master, r=alexcrichton
bors [Tue, 27 Dec 2016 14:15:29 +0000 (14:15 +0000)]
Auto merge of #38577 - redox-os:master, r=alexcrichton

Add Debug to OpenOptions and DirBuilder

This fixes the build on Redox as the platform independent structs now implement Debug.

7 years agoAuto merge of #38574 - Mark-Simulacrum:box-free-unspecialize, r=eddyb
bors [Tue, 27 Dec 2016 11:32:39 +0000 (11:32 +0000)]
Auto merge of #38574 - Mark-Simulacrum:box-free-unspecialize, r=eddyb

Remove special case for Box<ZST> in trans

Remove extra lang item, `exchange_free`; use `box_free` instead.

Trans used to insert code equivalent to `box_free` in a wrapper around
`exchange_free`, and that code is now removed from trans.

Fixes #37710.

7 years agoAuto merge of #38537 - jseyfried:fix_rustdoc_ice, r=nrc
bors [Tue, 27 Dec 2016 05:07:34 +0000 (05:07 +0000)]
Auto merge of #38537 - jseyfried:fix_rustdoc_ice, r=nrc

Fix ICE in rustdoc

Fixes #38237.
r? @nrc

7 years agoAuto merge of #38507 - alexcrichton:travis-lldb, r=brson
bors [Tue, 27 Dec 2016 02:18:20 +0000 (02:18 +0000)]
Auto merge of #38507 - alexcrichton:travis-lldb, r=brson

travis: Update the OSX image we run tests in

The current image is `xcode7.3`, Travis's current default. Unfortunately this
has a version of LLDB which doesn't support debuginfo-lldb tests (see #32520),
so we're not running LLDB tests on Travis yet.

This switches us to the newest image from Travis, `xcode8.2`, which should have
a newer version of LLDB we can run tests against.

7 years agoRemove extra lang item, exchange_free; use box_free instead.
Mark Simulacrum [Wed, 21 Dec 2016 21:29:34 +0000 (14:29 -0700)]
Remove extra lang item, exchange_free; use box_free instead.

Trans used to insert code equivalent to box_free in a wrapper around
exchange_free, and that code is now removed from trans.

7 years agotravis: Update the OSX image we run tests in
Alex Crichton [Wed, 21 Dec 2016 03:34:57 +0000 (19:34 -0800)]
travis: Update the OSX image we run tests in

The current image is `xcode7.3`, Travis's current default. Unfortunately this
has a version of LLDB which doesn't support debuginfo-lldb tests (see #32520),
so we're not running LLDB tests on Travis yet.

This switches us to the newest image from Travis, `xcode8.2`, which should have
a newer version of LLDB we can run tests against.

7 years agoAuto merge of #38274 - elahn:windows-readconsole-ctrl-z, r=alexcrichton
bors [Mon, 26 Dec 2016 23:33:21 +0000 (23:33 +0000)]
Auto merge of #38274 - elahn:windows-readconsole-ctrl-z, r=alexcrichton

Ctrl-Z returns from Stdin.read() when reading from the console on Windows

Fixes #19914.
Fixes read(), read_to_string(), read_to_end(), etc.

r? @alexcrichton

7 years agoAuto merge of #38314 - japaric:do-not-delete-enable-llvm-backend, r=alexcrichton
bors [Mon, 26 Dec 2016 20:48:43 +0000 (20:48 +0000)]
Auto merge of #38314 - japaric:do-not-delete-enable-llvm-backend, r=alexcrichton

initial SPARC support

### UPDATE

Can now compile `no_std` executables with:

```
$ cargo new --bin app && cd $_

$ edit Cargo.toml && tail -n2 $_
[dependencies]
core = { path = "/path/to/rust/src/libcore" }

$ edit src/main.rs && cat $_
#![feature(lang_items)]
#![no_std]
#![no_main]

#[no_mangle]
pub fn _start() -> ! {
    loop {}
}

#[lang = "panic_fmt"]
fn panic_fmt() -> ! {
    loop {}
}

$ edit sparc-none-elf.json && cat $_
{
  "arch": "sparc",
  "data-layout": "E-m:e-p:32:32-i64:64-f128:64-n32-S64",
  "executables": true,
  "llvm-target": "sparc",
  "os": "none",
  "panic-strategy": "abort",
  "target-endian": "big",
  "target-pointer-width": "32"
}

$ cargo rustc --target sparc-none-elf -- -C linker=sparc-unknown-elf-gcc -C link-args=-nostartfiles

$ file target/sparc-none-elf/debug/app
app: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), statically linked, not stripped

$ sparc-unknown-elf-readelf -h target/sparc-none-elf/debug/app
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Sparc
  Version:                           0x1
  Entry point address:               0x10074
  Start of program headers:          52 (bytes into file)
  Start of section headers:          1188 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         2
  Size of section headers:           40 (bytes)
  Number of section headers:         14
  Section header string table index: 11

$ sparc-unknown-elf-objdump -Cd target/sparc-none-elf/debug/app

target/sparc-none-elf/debug/app:     file format elf32-sparc

Disassembly of section .text:

00010074 <_start>:
   10074:       9d e3 bf 98     save  %sp, -104, %sp
   10078:       10 80 00 02     b  10080 <_start+0xc>
   1007c:       01 00 00 00     nop
   10080:       10 80 00 02     b  10088 <_start+0x14>
   10084:       01 00 00 00     nop
   10088:       10 80 00 00     b  10088 <_start+0x14>
   1008c:       01 00 00 00     nop
```

---

Someone wants to attempt launching some Rust [into space](https://www.reddit.com/r/rust/comments/5h76oa/c_interop/) but their platform is based on the SPARCv8 architecture. Let's not block them by enabling LLVM's SPARC backend.

Something very important that they'll also need is the "cabi" stuff as they'll be embedding some Rust code into a bigger C application (i.e. heavy use of `extern "C"`). The question there is what name(s) should we use for "target_arch" as the "cabi" implementation [varies according to that parameter](https://github.com/rust-lang/rust/blob/1.13.0/src/librustc_trans/abi.rs#L498-L523).

AFAICT, SPARCv8 is a 32-bit architecture and SPARCv9 is a 64-bit architecture. And, LLVM uses `sparc`, `sparcv9` and `sparcel` for [the architecture triple](https://github.com/rust-lang/llvm/blob/ac1c94226e9fa17005ce7e2dd52dd6d1875f3137/include/llvm/ADT/Triple.h#L67-L69) so perhaps we should use `target_arch = "sparc"` (32-bit) and `target_arch = "sparcv9"` (64-bit) as well.

r? @alexcrichton This PR only enables this LLVM backend when rustbuild is used. Do I also need to implement this for the old Makefile-based build system? Or are all our nightlies now being generated using rustbuild?

cc @brson

7 years agotravis: Attempt to fix Android flakiness
Alex Crichton [Mon, 26 Dec 2016 19:14:39 +0000 (11:14 -0800)]
travis: Attempt to fix Android flakiness

There's been some flaky runs on Travis where the Android emulator is having
problems staying alive... presumably? For example:

* https://travis-ci.org/rust-lang/rust/jobs/186736745

This commit spawns the emulator in the same way as buildbot with `nohup` to hope
that it goes into the background successfully, followed by a `wait-for-device`
command. I'm not actually sure if this'll fix the problems we're seeing, but I
figure it can't hurt to test out.

7 years agoAuto merge of #38542 - YaLTeR:fastcall-fix, r=pnkfelix
bors [Mon, 26 Dec 2016 17:23:42 +0000 (17:23 +0000)]
Auto merge of #38542 - YaLTeR:fastcall-fix, r=pnkfelix

Fix fastcall not applying inreg attributes to arguments

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

7 years agoRefactor mir::dataflow: remove Ctxt associated type from BitDenotation trait.
Felix S. Klock II [Mon, 26 Dec 2016 14:40:15 +0000 (09:40 -0500)]
Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait.

I no longer remember why I needed this (or thought I did). The way
that the `BitDenotation` is passed around in all existing use cases
(and planned future ones), the thing that were in the `Ctxt` can just
be part of `Self` instead.

(I think ariel had been pushing me to do this back when I first put in
this infrastructure; it took me a while to see how much of pain the
`Ctxt` was causing.)

7 years agoAuto merge of #38154 - petrochenkov:altname, r=jseyfried
bors [Mon, 26 Dec 2016 13:32:13 +0000 (13:32 +0000)]
Auto merge of #38154 - petrochenkov:altname, r=jseyfried

More systematic error reporting in path resolution

Path resolution for types, expressions and patterns used various heuristics to give more helpful messages on unresolved or incorrectly resolved paths.
This PR combines these heuristics and applies them to all non-import paths.

First a path is resolved in all namespaces, starting from its primary namespace (to give messages like "expected function, found macro, you probably forgot `!`").
If this resolution doesn't give a desired result we create a base error - either "path is not resolved" or "path is resolved, but the resolution is not acceptable in this context".
Other helps and notes are applied to this base error using heuristics.

Here's the list of heuristics for a path with a last segment `name` in order.
First we issue special messages for unresolved `Self` and `self`.
Second we try to find free items named `name` in other modules and suggest to import them.
Then we try to find fields and associated items named `name` and suggest `self.name` or `Self::name`.
After that we try several deterministic context dependent heuristics like "expected value, found struct, you probably forgot `{}`".
If nothing of the above works we try to find candidates with other names using Levenshtein distance.

---

Some alternatives/notes/unresolved questions:
- ~~I had a strong desire to migrate all affected tests to `test/ui`, diagnostics comparison becomes much more meaningful, but I did this only for few tests so far.~~ (Done)
- ~~Labels for "unresolved path" errors are mostly useless now, it may make sense to move some help/notes to these labels, help becomes closer to the error this way.~~ (Done)
- ~~Currently only the first successful heuristic results in additional message shown to the user, it may make sense to print them all, they are rarely compatible, so the diagnostics bloat is unlikely.~~ (Done)
- Now when https://github.com/rust-lang/rust/pull/38014 landed `resolve_path` can potentially be replaced with `smart_resolve_path` in couple more places - e.g. ~~visibilities~~ (done), ~~import prefixes~~ (done), HIR paths.

---

Some additional fixes:
- Associated suggestions and typo suggestions are filtered with a context specific predicate to avoid inapplicable suggestions.
- `adjust_local_def` works properly in speculative resolution.
- I also fixed a recently introduced ICE in partially resolved UFCS paths (see test `ufcs-partially-resolved.rs`).     Minimal reproduction:
    ```
    enum E {}
    fn main() {
        <u8 as E>::A;
    }
    ```
    Fixes https://github.com/rust-lang/rust/issues/38409, fixes https://github.com/rust-lang/rust/issues/38504 (duplicates).
- Some bugs in resolution of visibilities are fixed - `pub(Enum)`, `pub(Trait)`, `pub(non::local::path)`.
- Fixes https://github.com/rust-lang/rust/issues/38012.
---

r? @jseyfried for technical details + @jonathandturner  for diagnostics changes
How to read the patch: `smart_resolve_path(_fragment)/resolve_qpath_anywhere` are written anew and replace `resolve_trait_reference`/`resolve_type`/`resolve_pattern_path`/`resolve_struct_path`/`resolve_expr` for `ExprKind::Path`, everything else can be read as a diff.

7 years agoMore systematic error reporting in path resolution
Vadim Petrochenkov [Wed, 30 Nov 2016 22:35:25 +0000 (01:35 +0300)]
More systematic error reporting in path resolution

7 years agoAuto merge of #38536 - retep998:flauschige-kaninchen, r=petrochenkov
bors [Mon, 26 Dec 2016 10:52:56 +0000 (10:52 +0000)]
Auto merge of #38536 - retep998:flauschige-kaninchen, r=petrochenkov

Fix fs tests on Windows systems with non-english locales.

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

r? @alexcrichton

7 years agoMove some compile-fail tests into UI directory
Vadim Petrochenkov [Wed, 30 Nov 2016 22:35:25 +0000 (01:35 +0300)]
Move some compile-fail tests into UI directory

7 years agoAuto merge of #38598 - brson:em, r=alexcrichton
bors [Mon, 26 Dec 2016 00:47:50 +0000 (00:47 +0000)]
Auto merge of #38598 - brson:em, r=alexcrichton

Emscripten targets are Unix targets

I suspect this will fix the errors compiling libc https://buildbot.rust-lang.org/builders/auto-linux-rustbuild-cross-opt/builds/689/steps/compile/logs/stdio that are occurring on every PR.

Emscripten is basically a posix emulation layer for the web and I consider it a Unix.

cc @alexcrichton

7 years agoMove target_family to TargetOptions, not Target
Alex Crichton [Sun, 25 Dec 2016 22:03:44 +0000 (14:03 -0800)]
Move target_family to TargetOptions, not Target

Just fixing a compile error

7 years agoAuto merge of #38490 - jseyfried:def_id_vis, r=nrc
bors [Sun, 25 Dec 2016 21:32:37 +0000 (21:32 +0000)]
Auto merge of #38490 - jseyfried:def_id_vis, r=nrc

Use `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities

This is groundwork for hygiene 2.0, specifically privacy checking hygienic intercrate name resolutions.
r? @nrc

7 years agoAuto merge of #38539 - jseyfried:fix_resolve_hang, r=eddyb
bors [Sun, 25 Dec 2016 18:13:54 +0000 (18:13 +0000)]
Auto merge of #38539 - jseyfried:fix_resolve_hang, r=eddyb

resolve: fix non-termination

Fixes #34324.
r? @eddyb

7 years agoclear discriminant drop flag at the bottom of a ladder
Ariel Ben-Yehuda [Sun, 25 Dec 2016 16:44:19 +0000 (18:44 +0200)]
clear discriminant drop flag at the bottom of a ladder

Fixes #38437.

7 years agoAuto merge of #38566 - jseyfried:fix_import_resolution_bug, r=eddyb
bors [Sun, 25 Dec 2016 13:14:12 +0000 (13:14 +0000)]
Auto merge of #38566 - jseyfried:fix_import_resolution_bug, r=eddyb

Fix bug in import resolution

Fixes #38535 and fixes #38556.
r? @nrc

7 years agoEmscripten targets are Unix targets
Brian Anderson [Sun, 25 Dec 2016 02:09:10 +0000 (02:09 +0000)]
Emscripten targets are Unix targets

7 years agoAuto merge of #38594 - steveklabnik:rollup, r=steveklabnik
bors [Sat, 24 Dec 2016 21:14:17 +0000 (21:14 +0000)]
Auto merge of #38594 - steveklabnik:rollup, r=steveklabnik

Rollup of 14 pull requests

- Successful merges: #37956, #38013, #38297, #38480, #38497, #38502, #38505, #38513, #38521, #38549, #38554, #38557, #38568, #38572
- Failed merges:

7 years agoRollup merge of #38572 - GuillaumeGomez:join_handle_docs, r=frewsxcv
Steve Klabnik [Sat, 24 Dec 2016 19:29:34 +0000 (14:29 -0500)]
Rollup merge of #38572 - GuillaumeGomez:join_handle_docs, r=frewsxcv

Add JoinHandle missing examples

r? @frewsxcv

7 years agoRollup merge of #38568 - chris-morgan:fix-markdown-lists, r=frewsxcv
Steve Klabnik [Sat, 24 Dec 2016 19:29:33 +0000 (14:29 -0500)]
Rollup merge of #38568 - chris-morgan:fix-markdown-lists, r=frewsxcv

Fix Markdown list formatting.

The Markdown engine used by the book can cope with a single leading space on the list marker:

    Like this:

     * List item

    Rather than like this:

    * List item

… but it’s not the typical convention employed in the book, and moreover the Markdown engine used for producing the error index *can’t* cope with it (its behaviour looks like a bug, as it appears to lose one of the two line breaks as well, but that’s immaterial here).

So, we shift to a single convention which doesn’t trigger bugs in the Markdown renderer.

----

See https://doc.rust-lang.org/error-index.html#E0458 and https://doc.rust-lang.org/error-index.html#E0101 for the bad current rendering in the error index.

7 years agoRollup merge of #38557 - michaelwoerister:inline-asm-ich, r=nikomatsakis
Steve Klabnik [Sat, 24 Dec 2016 19:29:32 +0000 (14:29 -0500)]
Rollup merge of #38557 - michaelwoerister:inline-asm-ich, r=nikomatsakis

incr. comp.: Improve InlineAsm hashing and add test case

r? @nikomatsakis

7 years agoRollup merge of #38554 - DirkyJerky:master, r=frewsxcv
Steve Klabnik [Sat, 24 Dec 2016 19:29:31 +0000 (14:29 -0500)]
Rollup merge of #38554 - DirkyJerky:master, r=frewsxcv

Create hyperlink to correct documentation

In librustc_trans's readme

7 years agoRollup merge of #38549 - aidanhs:aphs-incremental-readme-note, r=nikomatsakis
Steve Klabnik [Sat, 24 Dec 2016 19:29:30 +0000 (14:29 -0500)]
Rollup merge of #38549 - aidanhs:aphs-incremental-readme-note, r=nikomatsakis

Correct path of incremental artifacts

Per https://github.com/rust-lang/rust/pull/38072#issuecomment-263670621

r? @nikomatsakis

7 years agoRollup merge of #38521 - jxson:remove-magenta-warnings, r=sfackler
Steve Klabnik [Sat, 24 Dec 2016 19:29:29 +0000 (14:29 -0500)]
Rollup merge of #38521 - jxson:remove-magenta-warnings, r=sfackler

Removes magenta build warning.

Small bug fix to remove an unused type in the magenta process code that causes build failures for magenta's rustc.

r? @alexcrichton

@tedsta @raphlinus

7 years agoRollup merge of #38513 - GuillaumeGomez:thread_fn_docs, r=frewsxcv
Steve Klabnik [Sat, 24 Dec 2016 19:29:28 +0000 (14:29 -0500)]
Rollup merge of #38513 - GuillaumeGomez:thread_fn_docs, r=frewsxcv

Add missing examples in some thread functions

r? @frewsxcv

7 years agoRollup merge of #38505 - estebank:why-lines, r=frewsxcv
Steve Klabnik [Sat, 24 Dec 2016 19:29:26 +0000 (14:29 -0500)]
Rollup merge of #38505 - estebank:why-lines, r=frewsxcv

Docs: Explain why/when `.lines()` returns an error

Fix #37744.

7 years agoRollup merge of #38502 - michaelwoerister:ich-test-inherent-impls, r=nikomatsakis
Steve Klabnik [Sat, 24 Dec 2016 19:29:25 +0000 (14:29 -0500)]
Rollup merge of #38502 - michaelwoerister:ich-test-inherent-impls, r=nikomatsakis

ICH: Add test cases for inherent impls.

r? @nikomatsakis

7 years agoRollup merge of #38497 - QuietMisdreavus:rustdoc-where-again, r=steveklabnik
Steve Klabnik [Sat, 24 Dec 2016 19:29:23 +0000 (14:29 -0500)]
Rollup merge of #38497 - QuietMisdreavus:rustdoc-where-again, r=steveklabnik

rustdoc: properly calculate line length for where clauses

Apparently, while I was cleaning up #37190, I regressed the formatting for long where clauses, where it wouldn't take the "prefix" length into account when deciding whether to break the line up. This patch fixes that.

7 years agoRollup merge of #38480 - clarcharr:import_css, r=steveklabnik
Steve Klabnik [Sat, 24 Dec 2016 19:29:22 +0000 (14:29 -0500)]
Rollup merge of #38480 - clarcharr:import_css, r=steveklabnik

Don't @import normalize.css.

This lets the browser load both files in parallel instead of waiting for `rustdoc.css` to load first.

7 years agoRollup merge of #38297 - matklad:linked-lists-are-not-cool, r=GuillaumeGomez
Steve Klabnik [Sat, 24 Dec 2016 19:29:21 +0000 (14:29 -0500)]
Rollup merge of #38297 - matklad:linked-lists-are-not-cool, r=GuillaumeGomez

Advertise Vec in LinkedList docs

r? @steveklabnik

Hi! We already [advise](https://doc.rust-lang.org/std/collections/#use-a-linkedlist-when) to use `Vec` instead of `LinkedList` in the top-level collections documentation. But I think it may be missed by someone who just directly finds `LinkedList`.

What do you feel about advertising `Vec` directly in `LinkedList` docs as well?

7 years agoRollup merge of #38013 - wezm:simplify-test-notes, r=steveklabnik
Steve Klabnik [Sat, 24 Dec 2016 19:29:20 +0000 (14:29 -0500)]
Rollup merge of #38013 - wezm:simplify-test-notes, r=steveklabnik

Simplify notes on testing and concurrency

The start of the notes on tests running concurrently, added in https://github.com/rust-lang/rust/pull/37766 read a little awkwardly. This PR fixes that and simplifies the wording a bit.

r? @steveklabnik

7 years agoRollup merge of #37956 - tshepang:patch-2, r=steveklabnik
Steve Klabnik [Sat, 24 Dec 2016 19:29:19 +0000 (14:29 -0500)]
Rollup merge of #37956 - tshepang:patch-2, r=steveklabnik

book: replace example I do not understand

7 years agoAuto merge of #38443 - frewsxcv:file-docs, r=brson
bors [Sat, 24 Dec 2016 18:00:45 +0000 (18:00 +0000)]
Auto merge of #38443 - frewsxcv:file-docs, r=brson

Improve the API examples for `std::fs::File`.

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

7 years agoTeach `rustdoc --test` about `--sysroot`, pass it when testing rust
Aidan Hobson Sayers [Sat, 24 Dec 2016 16:04:48 +0000 (16:04 +0000)]
Teach `rustdoc --test` about `--sysroot`, pass it when testing rust

This permits rustdoc tests to work in stage0

7 years agoAuto merge of #38062 - alexcrichton:fix-line-writer, r=brson
bors [Sat, 24 Dec 2016 13:28:37 +0000 (13:28 +0000)]
Auto merge of #38062 - alexcrichton:fix-line-writer, r=brson

std: Fix partial writes in LineWriter

Previously the `LineWriter` could successfully write some bytes but then fail to
report that it has done so. Additionally, an erroneous flush after a successful
write was permanently ignored. This commit fixes these two issues by (a)
maintaining a `need_flush` flag to indicate whether a flush should be the first
operation in `LineWriter::write` and (b) avoiding returning an error once some
bytes have been successfully written.

Closes #37807

7 years agoAdd JoinHandle missing examples
Guillaume Gomez [Fri, 23 Dec 2016 10:25:11 +0000 (11:25 +0100)]
Add JoinHandle missing examples

7 years agoAdd a min_atomic_width target option, like max_atomic_width.
whitequark [Mon, 15 Aug 2016 09:46:44 +0000 (09:46 +0000)]
Add a min_atomic_width target option, like max_atomic_width.

Rationale: some ISAs, e.g. OR1K, do not have atomic instructions
for byte and halfword access, and at the same time do not have
a fixed endianness, which makes it unreasonable to implement these
through word-sized atomic accesses.

7 years agoUse `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities.
Jeffrey Seyfried [Tue, 20 Dec 2016 08:32:15 +0000 (08:32 +0000)]
Use `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities.

7 years agoAuto merge of #38268 - withoutboats:parse_where_higher_rank_hack, r=eddyb
bors [Sat, 24 Dec 2016 00:22:00 +0000 (00:22 +0000)]
Auto merge of #38268 - withoutboats:parse_where_higher_rank_hack, r=eddyb

Prevent where < ident > from parsing.

In order to be forward compatible with `where<'a>` syntax for higher
rank parameters, prevent potential conflicts with UFCS from parsing
correctly for the near term.

7 years agoAuto merge of #38523 - camlorn:disable_field_reordering, r=nikomatsakis
bors [Fri, 23 Dec 2016 21:36:59 +0000 (21:36 +0000)]
Auto merge of #38523 - camlorn:disable_field_reordering, r=nikomatsakis

Disable field reordering

This was decided via IRC and needs a backport to beta.  Basically, #37429 broke servo, and probably needs an announcement and opt-in flag.  I didn't run all tests locally but think I've already reverted all the ones that need to be reverted.

r? @nikomatsakis

7 years agobook: replace example I do not understand
Tshepang Lekhonkhobe [Fri, 23 Dec 2016 20:32:27 +0000 (22:32 +0200)]
book: replace example I do not understand

7 years agoCloexec when creating directories
Jeremy Soller [Fri, 23 Dec 2016 19:21:29 +0000 (12:21 -0700)]
Cloexec when creating directories

7 years agoAuto merge of #38533 - jseyfried:legacy_custom_derive_deprecation, r=nrc
bors [Fri, 23 Dec 2016 18:43:12 +0000 (18:43 +0000)]
Auto merge of #38533 - jseyfried:legacy_custom_derive_deprecation, r=nrc

Allow legacy custom derive authors to disable warnings in downstream crates

This PR allows legacy custom derive authors to use a pre-deprecated method `registry.register_custom_derive()` instead of `registry.register_syntax_extension()` to avoid downstream deprecation warnings.

r? @nrc

7 years agoAdd Debug to OpenOptions and DirBuilder
Jeremy Soller [Fri, 23 Dec 2016 16:42:38 +0000 (09:42 -0700)]
Add Debug to OpenOptions and DirBuilder

7 years agoAuto merge of #38529 - nrc:save-sig, r=nikomatsakis
bors [Fri, 23 Dec 2016 15:59:07 +0000 (15:59 +0000)]
Auto merge of #38529 - nrc:save-sig, r=nikomatsakis

save-analysis: add signature info

These 'signatures' for definitions contain enough info for the RLS to create Rustdoc-style info on the fly.

7 years agoAuto merge of #38511 - Mark-Simulacrum:drop-glue, r=eddyb
bors [Fri, 23 Dec 2016 11:56:50 +0000 (11:56 +0000)]
Auto merge of #38511 - Mark-Simulacrum:drop-glue, r=eddyb

Make drop glue for unsized value pass two arguments instead of *(data, meta)

Fixes #36457

r? @eddyb

7 years agoAuto merge of #38401 - redox-os:redox_cross, r=brson
bors [Fri, 23 Dec 2016 09:09:26 +0000 (09:09 +0000)]
Auto merge of #38401 - redox-os:redox_cross, r=brson

Redox Cross Compilation

I will admit - there are things here that I wish I did not have to do. This completes the ability to create a cross compiler from the rust repository for `x86_64-unknown-redox`. I will document this PR with inline comments explaining some things.

[View this gist to see how a cross compiler is built](https://gist.github.com/jackpot51/6680ad973986e84d69c79854249f2b7e)

Prior discussion of a smaller change is here: https://github.com/rust-lang/rust/pull/38366

7 years agoAuto merge of #38232 - jseyfried:refactor_global_paths, r=nrc
bors [Fri, 23 Dec 2016 06:22:45 +0000 (06:22 +0000)]
Auto merge of #38232 - jseyfried:refactor_global_paths, r=nrc

Refactor global paths

This PR removes the field `global: bool` from `ast::Path` and `hir::Path`, instead representing a global path `::foo::bar` as `{{root}}::foo::bar`, where `{{root}}` is a virtual keyword `keywords::CrateRoot`.

Also, fixes #38016.

r? @nrc

7 years agoAllow legacy custom derive authors to disable warnings in downstream crates.
Jeffrey Seyfried [Thu, 22 Dec 2016 06:03:19 +0000 (06:03 +0000)]
Allow legacy custom derive authors to disable warnings in downstream crates.

7 years agoConvert fam to Symbol
Jeremy Soller [Fri, 23 Dec 2016 05:29:33 +0000 (22:29 -0700)]
Convert fam to Symbol

7 years agoCorrect target_family mess
Jeremy Soller [Fri, 23 Dec 2016 05:20:47 +0000 (22:20 -0700)]
Correct target_family mess

7 years agoDo not build emutls on Redox
Jeremy Soller [Fri, 23 Dec 2016 05:01:15 +0000 (22:01 -0700)]
Do not build emutls on Redox

7 years agoAuto merge of #38562 - brson:rm-llvm-lock, r=brson
bors [Fri, 23 Dec 2016 02:35:45 +0000 (02:35 +0000)]
Auto merge of #38562 - brson:rm-llvm-lock, r=brson

Delete the llvm submodule lockfile when configuring on the bots

This should fix the periodic error that .git/modules/src/llvm/index.lock
exists on the mac slaves.

7 years agoFix rustdoc ICE.
Jeffrey Seyfried [Tue, 20 Dec 2016 21:22:09 +0000 (21:22 +0000)]
Fix rustdoc ICE.