]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agocomment out record of now-unused error code E0563
Zack M. Davis [Mon, 7 Aug 2017 04:50:41 +0000 (21:50 -0700)]
comment out record of now-unused error code E0563

The sole appearance of this code was deleted in 6383de15; the existing practice
in these cases seems to be to comment out its mention in
`register_diagnostics!`.

6 years agofixing doctest failures in resurfaced extended information
Zack M. Davis [Mon, 7 Aug 2017 04:36:06 +0000 (21:36 -0700)]
fixing doctest failures in resurfaced extended information

After repatriating error explanations to the global registry, some lurking
doctest failures surfaced and needed to be chased down. Sadly, a few doctests
needed to be ignored due to a not-yet-understood regression in the doctest
`compile_fail` functionality (filed #43707).

6 years agode-orphan extended information
Zack M. Davis [Mon, 31 Jul 2017 06:22:09 +0000 (23:22 -0700)]
de-orphan extended information

Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax
weren't getting their error explanations registered.

Resolves #35284.

6 years agoAuto merge of #43397 - GuillaumeGomez:unused-union-field, r=petrochenkov
bors [Sun, 6 Aug 2017 18:57:57 +0000 (18:57 +0000)]
Auto merge of #43397 - GuillaumeGomez:unused-union-field, r=petrochenkov

Don't warn on unused field on union

Fixes #43393.

6 years agoHandle type aliases as well
Guillaume Gomez [Sun, 6 Aug 2017 18:46:32 +0000 (20:46 +0200)]
Handle type aliases as well

6 years agoFix union unused fields check
Guillaume Gomez [Sun, 6 Aug 2017 16:49:33 +0000 (18:49 +0200)]
Fix union unused fields check

6 years agoImprove union unused field detection
Guillaume Gomez [Sun, 6 Aug 2017 15:19:15 +0000 (17:19 +0200)]
Improve union unused field detection

6 years agoAuto merge of #43655 - bjorn3:more_doc_comments, r=arielb1
bors [Sun, 6 Aug 2017 12:46:20 +0000 (12:46 +0000)]
Auto merge of #43655 - bjorn3:more_doc_comments, r=arielb1

Make some comments doc comments in librustc/middle/cstore.rs

6 years agoAuto merge of #43488 - Florob:repeat-opt, r=arielb1
bors [Sun, 6 Aug 2017 08:09:59 +0000 (08:09 +0000)]
Auto merge of #43488 - Florob:repeat-opt, r=arielb1

Optimize initialization of arrays using repeat expressions

This PR was inspired by [this thread](https://www.reddit.com/r/rust/comments/6o8ok9/understanding_rust_performances_a_newbie_question/) on Reddit.
It tries to bring array initialization in the same ballpark as `Vec::from_elem()` for unoptimized builds.
For optimized builds this should relieve LLVM of having to figure out the construct we generate is in fact a `memset()`.

To that end this emits `llvm.memset()` when:
* the array is of integer type and all elements are zero (`Vec::from_elem()` also explicitly optimizes for this case)
* the array elements are byte sized

If the array is zero-sized initialization is omitted entirely.

6 years agoAuto merge of #43688 - frewsxcv:frewsxcv-bump-book, r=carols10cents
bors [Sat, 5 Aug 2017 22:10:14 +0000 (22:10 +0000)]
Auto merge of #43688 - frewsxcv:frewsxcv-bump-book, r=carols10cents

Bump 'src/doc/book' git submodule.

Primarily to pick up this change:

https://github.com/rust-lang/book/pull/866

...to move this PR forward:

https://github.com/rust-lang/rust/pull/43641

6 years agoBump 'src/doc/book' git submodule.
Corey Farwell [Sat, 5 Aug 2017 15:04:45 +0000 (11:04 -0400)]
Bump 'src/doc/book' git submodule.

Primarily to pick up this change:

https://github.com/rust-lang/book/pull/866

...to move this PR forward:

https://github.com/rust-lang/rust/pull/43641

6 years agoImprove dead code detection for unions
Guillaume Gomez [Sun, 30 Jul 2017 17:08:26 +0000 (19:08 +0200)]
Improve dead code detection for unions

6 years agoDon't warn on unused field on union
Guillaume Gomez [Fri, 21 Jul 2017 23:17:53 +0000 (01:17 +0200)]
Don't warn on unused field on union

6 years agoAuto merge of #43689 - edaniels:patch-1, r=GuillaumeGomez
bors [Sat, 5 Aug 2017 19:51:19 +0000 (19:51 +0000)]
Auto merge of #43689 - edaniels:patch-1, r=GuillaumeGomez

Fix typo in coerce_forced_unit docstring

6 years agoFix typo in coerce_forced_unit docstring
Eric Daniels [Sat, 5 Aug 2017 17:15:53 +0000 (13:15 -0400)]
Fix typo in coerce_forced_unit docstring

6 years agoAuto merge of #43652 - frewsxcv:frewsxcv-str-examples, r=QuietMisdreavus
bors [Sat, 5 Aug 2017 15:58:11 +0000 (15:58 +0000)]
Auto merge of #43652 - frewsxcv:frewsxcv-str-examples, r=QuietMisdreavus

String slice doc improvements.

None

6 years agoAuto merge of #43554 - eddyb:apfloat, r=nikomatsakis
bors [Sat, 5 Aug 2017 13:12:56 +0000 (13:12 +0000)]
Auto merge of #43554 - eddyb:apfloat, r=nikomatsakis

APFloat: Rewrite It In Rust and use it for deterministic floating-point CTFE.

As part of the CTFE initiative, we're forced to find a solution for floating-point operations.
By design, IEEE-754 does not explicitly define everything in a deterministic manner, and there is some variability between platforms, at the very least (e.g. NaN payloads).

If types are to evaluate constant expressions involving type (or in the future, const) generics, that evaluation needs to be *fully deterministic*, even across `rustc` host platforms.
That is, if `[T; T::X]` was used in a cross-compiled library, and the evaluation of `T::X` executed a floating-point operation, that operation has to be reproducible on *any other host*, only knowing `T` and the definition of the `X` associated const (as either AST or HIR).

Failure to uphold those rules allows an associated type (e.g. `<Foo as Iterator>::Item`) to be seen as two (or more) different types, depending on the current host, and such type safety violations typically allow writing of a `transmute` in safe code, given enough generics.

The options considered by @rust-lang/compiler were:
1. Ban floating-point operations in generic const-evaluation contexts
2. Emulate floating-point operations in an uniformly deterministic fashion

The former option may seem appealing at first, but floating-point operations *are allowed today*, so they can't be banned wholesale, a distinction has to be made between the code that already works, and future generic contexts. *Moreover*, every computation that succeeded *has to be cached*, otherwise the generic case can be reproduced without any generics. IMO there are too many ways it can go wrong, and a single violation can be enough for an unsoundness hole.
Not to mention we may end up really wanting floating-point operations *anyway*, in CTFE.

I went with the latter option, and seeing how LLVM *already* has a library for this exact purpose (as it needs to perform optimizations independently of host floating-point capabilities), i.e. `APFloat`, that was what I ended up basing this PR on.
But having been burned by the low reusability of bindings that link to LLVM, and because I would *rather* the floating-point operations to be wrong than not deterministic or not memory-safe (`APFloat` does far more pointer juggling than I'm comfortable with), I decided to RIIR.

This way, we have a guarantee of *no* `unsafe` code, a bit more control over the where native floating-point might accidentally be involved, and non-LLVM backends can share it.
I've also ported all the testcases over, *before* any functionality, to catch any mistakes.

Currently the PR replaces all CTFE operations to go through `apfloat::ieee::{Single,Double}`, keeping only the bits of the `f32` / `f64` memory representation in between operations.
Converting from a string also double-checks that `core::num` and `apfloat` agree on the interpretation of a floating-point number literal, in case either of them has any bugs left around.

r? @nikomatsakis
f? @nagisa @est31

<hr/>

Huge thanks to @edef1c for first demoing usable `APFloat` bindings and to @chandlerc for fielding my questions on IRC about `APFloat` peculiarities (also upstreaming some bugfixes).

6 years agoIndicate how to turn byte slices back into a string slice.
Corey Farwell [Sat, 5 Aug 2017 03:08:29 +0000 (23:08 -0400)]
Indicate how to turn byte slices back into a string slice.

6 years agoUpdate str::split_at_mut example to demonstrate mutability.
Corey Farwell [Fri, 4 Aug 2017 22:01:34 +0000 (18:01 -0400)]
Update str::split_at_mut example to demonstrate mutability.

6 years agoMake some comments doc comments in librustc/middle/cstore.rs
bjorn3 [Sat, 5 Aug 2017 08:42:53 +0000 (10:42 +0200)]
Make some comments doc comments in librustc/middle/cstore.rs

6 years agoAuto merge of #43640 - oli-obk:patch-5, r=nikomatsakis
bors [Sat, 5 Aug 2017 07:31:00 +0000 (07:31 +0000)]
Auto merge of #43640 - oli-obk:patch-5, r=nikomatsakis

Uplift some comments to Doc comments

6 years agoAuto merge of #43642 - mmatyas:unskip_aarch64_tests, r=sanxiyn
bors [Sat, 5 Aug 2017 05:08:12 +0000 (05:08 +0000)]
Auto merge of #43642 - mmatyas:unskip_aarch64_tests, r=sanxiyn

Unskip some tests on AArch64

I've been running the test suite remotely on an Acer Chromebook R13 and natively on an ARM Juno developer board, both AArch64 devices. Most of the tests that are skipped on AArch64 are due to testing stdcall/fastcall/x86-specific code or the debugger, but I've found a few tests that could be enabled there.

These have been skipped previously due to failing on the `aarch64-linux-android` and `mac-android` buildbots, more than 2 years ago (#23471, #23695). It seems we don't test those platforms any more, but as they do work on AArch64 Linux, I'd like to propose re-enabling them. All of them pass on my devices.

6 years agocodegen tests: Check type of `len` argument to `llvm.memset.*` based on the exact...
Florian Zeitz [Fri, 4 Aug 2017 14:58:12 +0000 (16:58 +0200)]
codegen tests: Check type of `len` argument to `llvm.memset.*` based on the exact intrinsic used

6 years agoAuto merge of #43639 - TobiasSchaffner:master, r=alexcrichton
bors [Sat, 5 Aug 2017 01:58:24 +0000 (01:58 +0000)]
Auto merge of #43639 - TobiasSchaffner:master, r=alexcrichton

Add L4Re Support in librustc_back

Add experimental support for x86_64-unknown-l4re-uclibc target, which covers the L4 Runtime Environment.

This pull request contains the changes that have to be made to librustc_back. It follows the changes humenda made in pull request https://github.com/rust-lang/libc/pull/591 to libc.

Next steps will be the modifications to the needed libraries. (libstd,  liballoc_system, libpanic_abort, libunwind)

Thanks to humenda for reviewing.

6 years agoAuto merge of #43615 - dhduvall:lto-unaligned-read, r=nagisa
bors [Fri, 4 Aug 2017 22:35:22 +0000 (22:35 +0000)]
Auto merge of #43615 - dhduvall:lto-unaligned-read, r=nagisa

Fix some unaligned reads on SPARC in LTO

This fixes #43593 by eliminating some undefined behavior.

6 years agoAuto merge of #43590 - michaelwoerister:no-reopening-1, r=nikomatsakis
bors [Fri, 4 Aug 2017 20:06:09 +0000 (20:06 +0000)]
Auto merge of #43590 - michaelwoerister:no-reopening-1, r=nikomatsakis

incr.comp.: Assert that no DepNode is re-opened (see issue #42298).

This PR removes the last occurrence of DepNode re-opening and adds an assertion that prevents our doing so in the future too. The DepGraph should no be guaranteed to be cycle free.

r? @nikomatsakis

EDIT: Closes https://github.com/rust-lang/rust/issues/42298

6 years agoAuto merge of #43577 - cuviper:link-llvm-dylib, r=sanxiyn
bors [Fri, 4 Aug 2017 17:36:10 +0000 (17:36 +0000)]
Auto merge of #43577 - cuviper:link-llvm-dylib, r=sanxiyn

Link LLVM tools dynamically

Set `LLVM_LINK_LLVM_DYLIB=ON` -- "If enabled, tools will be linked with
the libLLVM shared library."  Rust doesn't ship any of the LLVM tools,
and only needs a few at all for some test cases, so statically linking
the tools is just a waste of space.  I've also had memory issues on
slower machines with LLVM debuginfo enabled, when several tools start
linking in parallel consuming several GBs each.

With the default configuration, `build/x86_64-unknown-linux-gnu/llvm`
was 1.5GB before, now down to 731MB.  The difference is more drastic
with `--enable-llvm-release-debuginfo`, from 28GB to "only" 13GB.

This does not change the linking behavior of `rustc_llvm`.

6 years agoAuto merge of #43600 - scalexm:issue-35976, r=nikomatsakis
bors [Fri, 4 Aug 2017 15:03:00 +0000 (15:03 +0000)]
Auto merge of #43600 - scalexm:issue-35976, r=nikomatsakis

Add a more precise error message for issue #35976

When trying to perform static dispatch on something which derefs to a trait object, and the target trait is not in scope, we had confusing error messages if the target method had a `Self: Sized` bound. We add a more precise error message in this case: "consider using trait ...".

Fixes #35976.

r? @nikomatsakis

6 years agoIndicate why str::{get,get_mut} examples return None.
Corey Farwell [Fri, 4 Aug 2017 12:21:28 +0000 (08:21 -0400)]
Indicate why str::{get,get_mut} examples return None.

6 years agoUnskip some tests on AArch64
Mátyás Mustoha [Fri, 4 Aug 2017 11:45:08 +0000 (13:45 +0200)]
Unskip some tests on AArch64

6 years agoUplift some comments to Doc comments
Oliver Schneider [Fri, 4 Aug 2017 10:33:48 +0000 (12:33 +0200)]
Uplift some comments to Doc comments

6 years agoAuto merge of #43442 - zackmdavis:note_available_field_names_if_levenshtein_fails...
bors [Fri, 4 Aug 2017 10:13:55 +0000 (10:13 +0000)]
Auto merge of #43442 - zackmdavis:note_available_field_names_if_levenshtein_fails, r=nikomatsakis

field does not exist error: note fields if Levenshtein suggestion fails

When trying to access or initialize a nonexistent field, if we can't infer what
field was meant (by virtue of the purported field in the source being a small
Levenshtein distance away from an actual field, suggestive of a typo), issue a
note listing all the available fields. To reduce terminal clutter, we don't
issue the note when we have a `find_best_match_for_name` Levenshtein
suggestion: the suggestion is probably right.

The third argument of the call to `find_best_match_for_name` is changed to
`None`, accepting the default maximum Levenshtein distance of one-third of the
identifier supplied for correction. The previous value of `Some(name.len())`
was overzealous, inappropriately very Levenshtein-distant suggestions when the
attempted field access could not plausibly be a mere typo. For example, if a
struct has fields `mule` and `phone`, but I type `.donkey`, I'd rather the
error have a note listing that the available fields are, in fact, `mule` and
`phone` (which is the behavior induced by this patch) rather than the error
asking "did you mean `phone`?" (which is the behavior on master). The "only
find fits with at least one matching letter" comment was accurate when it was
first introduced in 09d992471 (January 2015), but is a vicious lie in its
present context before a call to `find_best_match_for_name` and must be
destroyed (replacing every letter is within a Levenshtein distance of name.len()).

The present author claims that this suffices to resolve #42599.

6 years agoRename `ConfirmResult` fields
scalexm [Fri, 4 Aug 2017 10:04:34 +0000 (12:04 +0200)]
Rename `ConfirmResult` fields

6 years agoAuto merge of #43403 - RalfJung:mir-validate, r=nikomatsakis
bors [Fri, 4 Aug 2017 07:48:07 +0000 (07:48 +0000)]
Auto merge of #43403 - RalfJung:mir-validate, r=nikomatsakis

Add MIR Validate statement

This adds statements to MIR that express when types are to be validated (following [Types as Contracts](https://internals.rust-lang.org/t/types-as-contracts/5562)). Obviously nothing is stabilized, and in fact a `-Z` flag has to be passed for behavior to even change at all.

This is meant to make experimentation with Types as Contracts in miri possible. The design is definitely not final.

Cc @nikomatsakis @aturon

6 years agoUse LLVM_LINK_LLVM_DYLIB only on linux-gnu and apple-darwin
Josh Stone [Fri, 4 Aug 2017 07:13:11 +0000 (00:13 -0700)]
Use LLVM_LINK_LLVM_DYLIB only on linux-gnu and apple-darwin

6 years agoAdd L4Re Support in librustc_back
Tobias Schaffner [Thu, 3 Aug 2017 08:37:11 +0000 (10:37 +0200)]
Add L4Re Support in librustc_back

Add support for x86_64-unknown-l4re-uclibc target, which covers
the L4 Runtime Environment.

6 years agoAuto merge of #43634 - dhduvall:solaris-test-fixes, r=sanxiyn
bors [Fri, 4 Aug 2017 05:30:12 +0000 (05:30 +0000)]
Auto merge of #43634 - dhduvall:solaris-test-fixes, r=sanxiyn

Fix a number of failing tests on Solaris and SPARC

6 years agoAuto merge of #43459 - ids1024:asrawfd, r=alexcrichton
bors [Fri, 4 Aug 2017 02:15:04 +0000 (02:15 +0000)]
Auto merge of #43459 - ids1024:asrawfd, r=alexcrichton

Implement AsRawFd for Stdin, Stdout, and Stderr

https://github.com/rust-lang/rfcs/issues/2074

6 years agotrans: Reuse immediate value in call to call_memset()
Florian Zeitz [Fri, 4 Aug 2017 00:27:30 +0000 (02:27 +0200)]
trans: Reuse immediate value in call to call_memset()

6 years agoRecognize SPARC in more tests where architecture matters.
Danek Duvall [Fri, 4 Aug 2017 00:19:19 +0000 (17:19 -0700)]
Recognize SPARC in more tests where architecture matters.

6 years agoSolaris linker options need to be accounted for in one test.
Danek Duvall [Fri, 4 Aug 2017 00:18:19 +0000 (17:18 -0700)]
Solaris linker options need to be accounted for in one test.

This is a follow-up to f189d7a6937 and 9d11b089ad1.  While `-z ignore`
is what needs to be passed to the Solaris linker, because gcc is used as
the default linker, both that form and `-Wl,-z -Wl,ignore` (including
extra double quotes) need to be taken into account, which explains the
more complex regular expression.

6 years agoFix AsRawHandle
Ian Douglas Scott [Thu, 3 Aug 2017 22:54:53 +0000 (15:54 -0700)]
Fix AsRawHandle

6 years agoExclude Windows from LLVM_LINK_LLVM_DYLIB
Josh Stone [Thu, 3 Aug 2017 22:42:05 +0000 (15:42 -0700)]
Exclude Windows from LLVM_LINK_LLVM_DYLIB

6 years agoSome tests use `res_init()` and need `-lresolv` on Solaris
Danek Duvall [Thu, 3 Aug 2017 22:38:34 +0000 (15:38 -0700)]
Some tests use `res_init()` and need `-lresolv` on Solaris

This is a follow-up to ea23e50f, which fixed it for the build.

6 years agoFix a dangling symlink bug in `remove_dir_all()` on Solaris
Danek Duvall [Thu, 3 Aug 2017 21:55:01 +0000 (14:55 -0700)]
Fix a dangling symlink bug in `remove_dir_all()` on Solaris

This fixes a handful of long-failing tests.

6 years agoImplement AsRawHandle for Std* on Windows
Ian Douglas Scott [Fri, 28 Jul 2017 23:34:16 +0000 (16:34 -0700)]
Implement AsRawHandle for Std* on Windows

6 years agoAuto merge of #43619 - frewsxcv:frewsxcv-thread, r=QuietMisdreavus
bors [Thu, 3 Aug 2017 19:40:27 +0000 (19:40 +0000)]
Auto merge of #43619 - frewsxcv:frewsxcv-thread, r=QuietMisdreavus

Thread docs fix and improvements.

None

6 years agoAuto merge of #43618 - SimonSapin:nomiconup, r=steveklabnik
bors [Thu, 3 Aug 2017 16:54:22 +0000 (16:54 +0000)]
Auto merge of #43618 - SimonSapin:nomiconup, r=steveklabnik

Update nomicon

(This should have been in https://github.com/rust-lang/rust/pull/42959.)

6 years agoAuto merge of #43609 - dsprenkels:issue-40510, r=Mark-Simulacrum
bors [Thu, 3 Aug 2017 14:21:37 +0000 (14:21 +0000)]
Auto merge of #43609 - dsprenkels:issue-40510, r=Mark-Simulacrum

Add regression test for #40510

This pull request adds a test case for issue #40510.

Fixes #40510.

6 years agoincr.comp.: Make ConstEval dep-node anonymous.
Michael Woerister [Thu, 3 Aug 2017 12:45:01 +0000 (14:45 +0200)]
incr.comp.: Make ConstEval dep-node anonymous.

6 years agoTweak error message
scalexm [Thu, 3 Aug 2017 11:50:06 +0000 (13:50 +0200)]
Tweak error message

6 years agoHandle ambiguous cases
scalexm [Wed, 2 Aug 2017 10:17:34 +0000 (12:17 +0200)]
Handle ambiguous cases

6 years agoAdd a more precise error message
scalexm [Tue, 1 Aug 2017 19:38:52 +0000 (21:38 +0200)]
Add a more precise error message
When trying to perform static dispatch on something which derefs
to a trait object, and the target trait is not in scope, we had
confusing error messages if the target method had a
`Self: Sized` bound. We add a more precise error message in this
case: "consider using trait ...".

Fixes #35976.

6 years agoAuto merge of #43622 - RalfJung:config.toml, r=michaelwoerister
bors [Thu, 3 Aug 2017 11:50:29 +0000 (11:50 +0000)]
Auto merge of #43622 - RalfJung:config.toml, r=michaelwoerister

extend config.toml doc for debug-assertions

Even after I knew that I had to change config.toml to get any printing from debug! and trace!, going over the entire fail did not make it clear to me that `debug-assertions` is the option controlling that.

6 years agoAuto merge of #43616 - mbrubeck:fnv, r=michaelwoerister
bors [Thu, 3 Aug 2017 08:25:49 +0000 (08:25 +0000)]
Auto merge of #43616 - mbrubeck:fnv, r=michaelwoerister

Remove unused FnvHash code

None

6 years agoAdd more regression tests for #40510
Daan Sprenkels [Thu, 3 Aug 2017 02:14:16 +0000 (04:14 +0200)]
Add more regression tests for #40510

6 years agoAuto merge of #43611 - nrc:save-tidy, r=eddyb
bors [Thu, 3 Aug 2017 04:32:37 +0000 (04:32 +0000)]
Auto merge of #43611 - nrc:save-tidy, r=eddyb

Update RLS and deps

This PR further moves towards configuring save-analysis using the rls-data Config struct. We remove completely the concept of api_crate. Updates the RLS so the client is expecting these changes and which pulls in a commit re-enabling all RLS tests (been disabled due to a span error for a while).

6 years agoAppease tidy and fix save-analysis config for dist builds
Nick Cameron [Wed, 2 Aug 2017 22:20:01 +0000 (10:20 +1200)]
Appease tidy and fix save-analysis config for dist builds

6 years agoextend config.toml doc
Ralf Jung [Thu, 3 Aug 2017 04:12:36 +0000 (21:12 -0700)]
extend config.toml doc

6 years agoIndicate how `ThreadId` is created.
Corey Farwell [Thu, 3 Aug 2017 00:59:33 +0000 (20:59 -0400)]
Indicate how `ThreadId` is created.

6 years agoFix broken links in `Thread` docs.
Corey Farwell [Thu, 3 Aug 2017 00:57:47 +0000 (20:57 -0400)]
Fix broken links in `Thread` docs.

6 years agoUpdate nomicon
Simon Sapin [Wed, 2 Aug 2017 22:36:43 +0000 (00:36 +0200)]
Update nomicon

6 years agoAuto merge of #43614 - pornel:is_gotcha, r=BurntSushi
bors [Wed, 2 Aug 2017 19:01:01 +0000 (19:01 +0000)]
Auto merge of #43614 - pornel:is_gotcha, r=BurntSushi

Emphasise that these functions look at the disk, not just the path

I thought that `PathBuf::new("foo/bar/").is_dir()` is always true, because the path ends in `/`. However, this is not what `is_dir()` function does. So I've updated the docs to make it clear.

6 years agoRemove unused fnv hash code
Matt Brubeck [Wed, 2 Aug 2017 17:42:12 +0000 (10:42 -0700)]
Remove unused fnv hash code

6 years agoFix some unaligned reads on SPARC in LTO
Danek Duvall [Wed, 2 Aug 2017 16:58:16 +0000 (09:58 -0700)]
Fix some unaligned reads on SPARC in LTO

This fixes #43593 by eliminating some undefined behavior.

6 years agoAuto merge of #43607 - marioidival:master, r=alexcrichton
bors [Wed, 2 Aug 2017 16:21:39 +0000 (16:21 +0000)]
Auto merge of #43607 - marioidival:master, r=alexcrichton

Remove unecessary test code #43219

related #43219

6 years agoEmphasise that these functions look at the disk, not just the path
Kornel [Wed, 2 Aug 2017 14:40:08 +0000 (15:40 +0100)]
Emphasise that these functions look at the disk, not just the path

6 years agorustc_trans: do not pass floating-point values to LLVM through FFI.
Eduard-Mihai Burtescu [Sun, 30 Jul 2017 17:43:53 +0000 (20:43 +0300)]
rustc_trans: do not pass floating-point values to LLVM through FFI.

6 years agorustc_const_math: use apfloat::ieee::{Single,Double} in ConstFloat.
Eduard-Mihai Burtescu [Sun, 30 Jul 2017 04:32:11 +0000 (07:32 +0300)]
rustc_const_math: use apfloat::ieee::{Single,Double} in ConstFloat.

6 years agoAuto merge of #43605 - RalfJung:mapdoc, r=michaelwoerister
bors [Wed, 2 Aug 2017 13:40:35 +0000 (13:40 +0000)]
Auto merge of #43605 - RalfJung:mapdoc, r=michaelwoerister

Improve hir::map::Map::get_parent_node doc

The documentation says
```
    /// Similar to get_parent, returns the parent node id or id if there is no
    /// parent.
    /// This function returns the immediate parent in the AST, whereas get_parent
    /// returns the enclosing item.
```
One would think that one can walk up the tree by repeatedly calling `get_parent_node` until it returns the argument, and then work on the `NodeId`s that arise. However, that is not true: `get_parent_node` will return id 0 (the crate itself) for items that sit directly in the crate; calling `get` on that `NodeId` will panic.

So, the fact that `get_parent_node` returns the root when passed the root is actually not really useful, because the root itself is already a somewhat degenerate node. This improves the doc so hopefully people writing code that "walks up the tree" don't run into this issue like I did...

6 years agoAuto merge of #43612 - michaelwoerister:fix-cgu-hashing, r=eddyb
bors [Wed, 2 Aug 2017 11:14:54 +0000 (11:14 +0000)]
Auto merge of #43612 - michaelwoerister:fix-cgu-hashing, r=eddyb

incr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.

This PR fixes the way the CGU hash for incr. comp. is computed. The CGU hash represents which `TransItems` are emitted into which codegen unit with which linkage and visibility. Before the new, LLVM-independent symbol internalizer the CGU hash did not accurately contain `TransItem` linkage and visibility because we would not enable symbol internalization in incremental mode anyway. The new internalizer is also run in incremental mode which uncovered the inaccuracy of CGU hashing. Luckily, the fix is rather simple.

r? @eddyb
cc @nikomatsakis

6 years agoincr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.
Michael Woerister [Wed, 2 Aug 2017 09:56:23 +0000 (11:56 +0200)]
incr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.

6 years agoAuto merge of #43602 - QuietMisdreavus:fantastic-shrinking-headings, r=GuillaumeGomez
bors [Wed, 2 Aug 2017 08:49:02 +0000 (08:49 +0000)]
Auto merge of #43602 - QuietMisdreavus:fantastic-shrinking-headings, r=GuillaumeGomez

rustdoc: shrink headings in non-top-level docblocks

Headings in per-method docs are often bigger than the function names/signatures themselves, so this tones those down to accentuate the methods.

![screenshot of this change on Vec::swap_remove](https://user-images.githubusercontent.com/5217170/28849380-6116a830-76dc-11e7-8ce2-04433d09463a.png)

Fixes #17193

6 years agoAuto merge of #43584 - arielb1:unused-reads, r=eddyb
bors [Wed, 2 Aug 2017 05:56:06 +0000 (05:56 +0000)]
Auto merge of #43584 - arielb1:unused-reads, r=eddyb

Fix quadratic performance with lots of use statements

This fixes 2 problems that caused quadratic performance when lots of use-statements were present. After this patch, performance is linear (and very fast) even with 1M uses.

Fixes #43572.
Fixes #43573.

r? @eddyb

6 years agoUpdate RLS
Nick Cameron [Wed, 2 Aug 2017 05:21:12 +0000 (17:21 +1200)]
Update RLS

6 years agoUpdate rls-data dep
Nick Cameron [Wed, 2 Aug 2017 04:57:50 +0000 (16:57 +1200)]
Update rls-data dep

6 years agoalso release-validate return value before a call
Ralf Jung [Wed, 2 Aug 2017 04:06:33 +0000 (21:06 -0700)]
also release-validate return value before a call

6 years agosave-analysis: only emit public fields in value of a struct if the config permits
Nick Cameron [Wed, 2 Aug 2017 03:46:59 +0000 (15:46 +1200)]
save-analysis: only emit public fields in value of a struct if the config permits

6 years agoAuto merge of #43603 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 2 Aug 2017 03:39:27 +0000 (03:39 +0000)]
Auto merge of #43603 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #43389, #43423, #43581, #43585, #43597, #43598
- Failed merges:

6 years agoRemove unecessary test code #43219
Mario Idival [Wed, 2 Aug 2017 03:06:42 +0000 (00:06 -0300)]
Remove unecessary test code #43219

6 years agoimprove hir::map::Map::get_parent_node doc
Ralf Jung [Wed, 2 Aug 2017 02:13:47 +0000 (19:13 -0700)]
improve hir::map::Map::get_parent_node doc

6 years agorustdoc: shrink headings in non-top-level docblocks
QuietMisdreavus [Tue, 1 Aug 2017 22:08:33 +0000 (17:08 -0500)]
rustdoc: shrink headings in non-top-level docblocks

6 years agoAdd regression test for #40510
Daan Sprenkels [Wed, 2 Aug 2017 01:44:11 +0000 (03:44 +0200)]
Add regression test for #40510

6 years agoclosure unsafety check: stop moving up when we hit an item
Ralf Jung [Wed, 2 Aug 2017 01:26:28 +0000 (18:26 -0700)]
closure unsafety check: stop moving up when we hit an item

6 years agoRollup merge of #43598 - ibabushkin:master, r=eddyb
Corey Farwell [Wed, 2 Aug 2017 01:22:30 +0000 (01:22 +0000)]
Rollup merge of #43598 - ibabushkin:master, r=eddyb

Derive `Hash` on `AssociatedKind`.

This is a trivial change useful in downstream code poking in rustc's
innards, in particular the semver verification tool I'm currently working on.

r? @eddyb

6 years agoRollup merge of #43597 - dhduvall:master, r=alexcrichton
Corey Farwell [Wed, 2 Aug 2017 01:22:29 +0000 (01:22 +0000)]
Rollup merge of #43597 - dhduvall:master, r=alexcrichton

Fix the Solaris pthread_t raw type in std to match what's in libc

The old type causes failures when building cargo 0.20.0 after rust-lang/libc@8304e06b5.

6 years agoRollup merge of #43585 - frewsxcv:frewsxcv-hashset-docs, r=steveklabnik,quietmisdreavus
Corey Farwell [Wed, 2 Aug 2017 01:22:28 +0000 (01:22 +0000)]
Rollup merge of #43585 - frewsxcv:frewsxcv-hashset-docs, r=steveklabnik,quietmisdreavus

Improve docs & doc examples for HashSet.

None

6 years agoRollup merge of #43581 - alexcrichton:inline-more, r=michaelwoerister
Corey Farwell [Wed, 2 Aug 2017 01:22:27 +0000 (01:22 +0000)]
Rollup merge of #43581 - alexcrichton:inline-more, r=michaelwoerister

rustc: Inline bitwise modification operators

These need to be inlined across crates to avoid showing up as one-instruction
functions in profiles! In the benchmark from #43578 this decreased the
translation item collection step from 30s to 23s, and looks like it also allowed
vectorization elsewhere of the operations!

6 years agoRollup merge of #43423 - xliiv:cell-example, r=steveklabnik
Corey Farwell [Wed, 2 Aug 2017 01:22:27 +0000 (01:22 +0000)]
Rollup merge of #43423 - xliiv:cell-example, r=steveklabnik

Add simple docs example for struct Cell

6 years agoRollup merge of #43389 - alexcrichton:thread-error, r=michaelwoerister
Corey Farwell [Wed, 2 Aug 2017 01:22:26 +0000 (01:22 +0000)]
Rollup merge of #43389 - alexcrichton:thread-error, r=michaelwoerister

Thread through the original error when opening archives

This updates the management of opening archives to thread through the original
piece of error information from LLVM over to the end consumer, trans.

6 years agoAuto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton
bors [Wed, 2 Aug 2017 01:13:02 +0000 (01:13 +0000)]
Auto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton

Gate LLVMRustHasFeature on LLVM_RUSTLLVM

Commit c4710203c098b in #43492 make `LLVMRustHasFeature` "more robust"
by using `getFeatureTable()`.  However, this function is specific to
Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
`#if LLVM_RUSTLLVM` to guard this call.

Closes #43555.

6 years agorustc_apfloat: complete the IEEE & PPC implementations.
Eduard-Mihai Burtescu [Fri, 28 Jul 2017 18:10:06 +0000 (21:10 +0300)]
rustc_apfloat: complete the IEEE & PPC implementations.

6 years agorustc_apfloat: port the suite of unit tests.
Eduard-Mihai Burtescu [Tue, 11 Jul 2017 22:06:56 +0000 (01:06 +0300)]
rustc_apfloat: port the suite of unit tests.

6 years agorustc_apfloat: stub IEEE & PPC implementations.
Eduard-Mihai Burtescu [Tue, 11 Jul 2017 22:06:02 +0000 (01:06 +0300)]
rustc_apfloat: stub IEEE & PPC implementations.

6 years agorustc_apfloat: introduce the base Float API.
Eduard-Mihai Burtescu [Sat, 8 Jul 2017 17:46:43 +0000 (20:46 +0300)]
rustc_apfloat: introduce the base Float API.

6 years agoAdd doc example for HashSet::drain.
Corey Farwell [Tue, 1 Aug 2017 12:12:01 +0000 (08:12 -0400)]
Add doc example for HashSet::drain.

6 years agoRemove unnecessary clones in doc examples.
Corey Farwell [Tue, 1 Aug 2017 11:55:44 +0000 (07:55 -0400)]
Remove unnecessary clones in doc examples.

6 years agoShow the capacity in HashSet::with_capacity doc example.
Corey Farwell [Tue, 1 Aug 2017 11:47:17 +0000 (07:47 -0400)]
Show the capacity in HashSet::with_capacity doc example.

6 years agoRemove unnecessary 'mut' bindings.
Corey Farwell [Tue, 1 Aug 2017 11:46:41 +0000 (07:46 -0400)]
Remove unnecessary 'mut' bindings.

6 years agoIndicate HashSet is code-like in docs.
Corey Farwell [Tue, 1 Aug 2017 11:44:43 +0000 (07:44 -0400)]
Indicate HashSet is code-like in docs.