Commit Graph

58416 Commits

Author SHA1 Message Date
Steve Klabnik
ce8c6f6d00 Rollup merge of #36842 - cjm00:release-notes-fix, r=brson
Fixed wrong link in release notes

The link for the pull request updating hash_map to implement Debug was a copy of the previous link, this changes the link to the correct PR.
2016-09-30 13:44:48 -04:00
Steve Klabnik
e3e5f1fea3 Rollup merge of #36841 - GuillaumeGomez:process_doc, r=steveklabnik
Improve process module doc a bit

r? @steveklabnik
2016-09-30 13:44:47 -04:00
Steve Klabnik
a6f0a41b14 Rollup merge of #36833 - tmiasko:system-time-error, r=steveklabnik
Reword description of SystemTimeError.

Repalce timestamp with a system time, to be more consistent with
remaining documentation.

r? @steveklabnik
2016-09-30 13:44:47 -04:00
Steve Klabnik
c2977ea038 Rollup merge of #36829 - apasel422:releases-typo, r=alexcrichton
Fix typo in RELEASES.md
2016-09-30 13:44:47 -04:00
Steve Klabnik
fb880dfce4 Rollup merge of #36810 - GuillaumeGomez:ops_doc, r=steveklabnik
Add missing urls for ops module

Part of #29365.

r? @steveklabnik
2016-09-30 13:44:47 -04:00
Steve Klabnik
083af27779 Rollup merge of #36750 - GuillaumeGomez:cmp_doc, r=steveklabnik
Add missing links on cmp module

r? @steveklabnik
2016-09-30 13:44:47 -04:00
Steve Klabnik
431c037b94 Rollup merge of #36711 - pcn:patch-1, r=steveklabnik
Suggesting a change to a comment that puzzled me

While reading this, the comment made it difficult for me to simply absorb the concept.  It interrupted my reading flow, and I think this expresses the same meaning, but reads a bit better.  It's trivial, but makes it easier for me to move on to the next line.
2016-09-30 13:44:46 -04:00
Steve Klabnik
cabfa99199 Rollup merge of #36623 - GuillaumeGomez:doc_typos, r=steveklabnik
Fix some typos and improve doc comments style

r? @steveklabnik
2016-09-30 13:44:46 -04:00
Steve Klabnik
71a4bde9e9 Rollup merge of #36576 - GuillaumeGomez:box_urls, r=steveklabnik
Add missing urls for Box doc

r? @steveklabnik
2016-09-30 13:44:46 -04:00
Steve Klabnik
dcec48dc13 Rollup merge of #36535 - GuillaumeGomez:macro_url, r=steveklabnik
Update to new macro url syntax

r? @steveklabnik
2016-09-30 13:44:46 -04:00
Steve Klabnik
f6497ea569 Rollup merge of #36529 - bluss:index-doc, r=GuillaumeGomez
Clarify Index/IndexMut trait docs

Use examples and placeholder variable names with more meaning, to not
make it so abstract.
2016-09-30 13:44:45 -04:00
Tim Neumann
62fb242ad6 fix out-of-tree rustbuild 2016-09-30 18:04:41 +02:00
Michael Woerister
16261a6496 Fix another comment in test/incremental/hashes/enum_defs 2016-09-30 11:34:33 -04:00
Michael Woerister
1a41138f59 Fix comment in test/incremental/hashes/enum_defs 2016-09-30 11:12:37 -04:00
Andrea Pretto
5d9318c42c Fixes requested by @michaelwoerister. 2016-09-30 16:49:52 +02:00
bors
954873055a Auto merge of #36823 - durka:discriminant_value, r=nagisa
add wrapper for discriminant_value, take 2

[This is #34785 reopened, since @bors apparently gave up on that thread.]

add wrapper for discriminant_value intrinsic

Implementation of [RFC 1696](https://github.com/rust-lang/rfcs/blob/master/text/1696-discriminant.md).

Wraps the `discriminant_value` intrinsic under the name `std::mem::discriminant`. In order to avoid prematurely leaking information about the implementation of enums, the return value is an opaque type, generic over the enum type, which implements Copy, Clone, PartialEq, Eq, Hash, and Debug (notably not PartialOrd). There is currently no way to get the value out excepting printing the debug representation.

The wrapper is safe and can be stabilized soon as per discussion in #24263.

cc @aturon
r? @nagisa
2016-09-30 07:35:04 -07:00
Wesley Wiser
a5244dd66c Add Send and Sync traits to the reference
Fixes #36859
2016-09-30 09:56:58 -04:00
bors
1d64acdceb Auto merge of #36822 - Aatch:resolve-callee-expr, r=luqmana
Resolve the callee type in check_call before autoderef

If the callee type is an associated type, then it needs to be normalized
before trying to deref it. This matches the behaviour of
`check_method_call` for autoderef behaviour in calls.

Fixes #36786
2016-09-30 04:24:38 -07:00
Tomasz Miąsko
1e8f692461 Fix BufRead::{read_until, read_line} documentation. 2016-09-30 11:58:10 +02:00
bors
c88ed2a1a7 Auto merge of #36819 - jseyfried:fix_ast_const_integer_ice, r=nrc
Fix ICE on some macros in const integer positions (e.g. `[u8; m!()]`)

Fixes #36816.
r? @nrc
2016-09-30 01:15:50 -07:00
David Henningsson
971e0be77c str: Fix documentation typo
from_utf8 returns a Result, not an Option.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2016-09-30 06:13:14 +02:00
bors
7660bdf70a Auto merge of #36557 - sfackler:fix-hashdos-docs, r=alexcrichton
Clean up hasher discussion on HashMap

* We never want to make guarantees about protecting against attacks.
* "True randomness" is not the right terminology to be using in this
    context.
* There is significantly more nuance to the performance of SipHash than
    "somewhat slow".

r? @steveklabnik

Follow up to discussion on #35371
2016-09-29 20:25:45 -07:00
石博文
7d6227a9b3 add println!() macro with out any arguments 2016-09-30 09:11:18 +08:00
bors
c717cfa7c1 Auto merge of #36430 - llogiq:cow_add, r=alexcrichton
impl Add<{str, Cow<str>}> for Cow<str>

cc #35837
2016-09-29 15:50:32 -07:00
Chris McDonald
e9d3e62c90 Fixed wrong link in release notes 2016-09-29 16:26:02 -06:00
Guillaume Gomez
3176ba42e2 Improve process module doc a bit 2016-09-30 00:10:42 +02:00
Andrea Pretto
e3b4a53064 Test Case for Incr. Comp. Hash for enums #36674. 2016-09-29 23:59:15 +02:00
Steven Fackler
aaf32aa4fe Mention FNV 2016-09-29 21:12:58 +02:00
bors
289f3a4ca7 Auto merge of #36377 - tormol:encode_utf, r=alexcrichton
Change encode_utf{8,16}() to write to a buffer and panic if it's too small

cc #27784

Should the "A buffer that's too small" examples be removed and replaced by tests?
2016-09-29 11:20:02 -07:00
Tomasz Miąsko
01a57a2faa Reword description of SystemTimeError.
Repalce timestamp with a system time, to be more consistent with
remaining documentation.
2016-09-29 20:08:46 +02:00
bors
ff67da63ea Auto merge of #36752 - jonas-schievink:vartmparg, r=eddyb
Move MIR towards a single kind of local

This PR modifies MIR to handle function arguments (`Arg`), user-defined variable bindings (`Var`), compiler-generated temporaries (`Tmp`), as well as the return value pointer equally. All of them are replaced with a single `Local` type, a few functions for iterating over different kinds of locals, and a way to get the kind of local we're dealing with (mainly used in the constant qualification/propagation passes).

~~I haven't managed to fix one remaining issue: A `StorageDead` not getting emitted for a variable (see the `TODO` in the test). If that's fixed, this is basically good to go.~~ Found the issue (an off-by-one error), fix incoming.

r? @eddyb for changes to constant qualification and propagation I'm not quite sure about
2016-09-29 07:53:33 -07:00
Andrew Paseltiner
e5e632ba40 Fix typo in RELEASES.md 2016-09-29 10:43:08 -04:00
Guillaume Gomez
5cec065399 Add missing urls for ops module 2016-09-29 15:33:13 +02:00
Andre Bogus
dd13a80344 impl {Add, AddAssign}<{str, Cow<str>}> for Cow<str>
This does not actually add anything that wasn't there, but is merely an
optimization for the given cases, which would have incurred additional
heap allocation for adding empty strings, and improving the ergonomics
of `Cow` with strings.
2016-09-29 14:56:58 +02:00
Felix S. Klock II
55a37cbec6 Update src/compiler-rt to incoporate fix for UB in floatsidf. Fix #36518. 2016-09-29 13:54:06 +02:00
bors
704bcc0dda Auto merge of #36456 - alexcrichton:rustbuild-dont-use-c, r=jonathandturner
rustbuild: Use current_dir instead of -C

Apparently some versions of git don't support the `-C` flag, so let's use the
guaranteed-to-work `current_dir` function.
2016-09-29 03:48:02 -07:00
Nicholas Nethercote
6a9b5e4c51 Clarify HashMap's capacity handling.
This commit does the following.

- Changes the terminology for capacities used within HashMap's code.
  "Internal capacity" is now consistently "raw capacity", and "usable
  capacity" is now consistently just "capacity". This makes the code
  easier to understand.

- Reworks capacity and raw capacity computations. Raw capacity
  computations are now handled in a single place:
  `DefaultResizePolicy::raw_capacity()`. This function correctly returns
  zero when given zero, which means that the following cases now result
  in a capacity of zero when they previously did not.

  * `Hash{Map,Set}::with_capacity(0)`
  * `Hash{Map,Set}::with_capacity_and_hasher(0)`
  * `Hash{Map,Set}::shrink_to_fit()`, when used with a hash map/set whose
    elements have all been removed

- Strengthens the language used in the comments describing the above
  functions, to make it clearer when they will result in a map/set with
  a capacity of zero. The new language is based on the language used for
  the corresponding functions in `Vec`.

- Adds tests for the above zero-capacity cases.

- Removes `test_resize_policy` because it is no longer useful.
2016-09-29 20:38:35 +10:00
bors
91f34c0c70 Auto merge of #36818 - jonathandturner:rollup, r=jonathandturner
Rollup of 12 pull requests

- Successful merges: #35286, #35892, #36460, #36704, #36741, #36760, #36787, #36789, #36794, #36803, #36811, #36813
- Failed merges:
2016-09-28 21:55:15 -07:00
James Miller
ec2e05194f Resolve the callee type in check_call before autoderef
If the callee type is an associated type, then it needs to be normalized
before trying to deref it. This matches the behaviour of
`check_method_call` for autoderef behaviour in calls.

Fixes #36786
2016-09-29 17:07:03 +13:00
Pweaver (Paul Weaver)
5e3aaab2f6 #36680 add warning when compliation cache fails to hard link 2016-09-29 00:03:13 -04:00
Jeffrey Seyfried
4bec961a21 Add regression test. 2016-09-29 03:52:09 +00:00
Jonathan Turner
f12f9504b3 Rollup merge of #36813 - palango:link-to-fmt, r=steveklabnik
Add link to format! docs
2016-09-28 20:21:53 -07:00
Jonathan Turner
02c050644b Rollup merge of #36811 - brson:bootstrap, r=alexcrichton
Update bootstrap compiler
2016-09-28 20:21:52 -07:00
Jonathan Turner
47a335b677 Rollup merge of #36803 - brson:node, r=alexcrichton
Move nodejs detection into bootstrap

This avoids issues with mingw path conversions.

r? @alexcrichton
2016-09-28 20:21:52 -07:00
Jonathan Turner
9143c3c9c0 Rollup merge of #36794 - japaric:target-panic, r=alexcrichton
add a panic-strategy field to the target specification

Now a target can define its panic strategy in its specification. If a
user doesn't specify a panic strategy via the command line, i.e. '-C
panic', then the compiler will use the panic strategy defined by the
target specification.

Custom targets can pick their panic strategy via the "panic-strategy"
field of their target specification JSON file. If omitted in the
specification, the strategy defaults to "unwind".

closes #36647

---

I checked that compiling an executable for a custom target with "panic-strategy" set to "abort" doesn't need the "eh_personality" lang item and also that standard crates compiled for that custom target didn't contained undefined symbols to _Unwind_Resume. But this needs an actual unit test, any suggestion on how to test this?

Most of the noise in the diff is due to moving `PanicStrategy` from the `rustc` to the `rustc_back` crate.

r? @alexcrichton
cc @phil-opp
2016-09-28 20:21:52 -07:00
Jonathan Turner
f1ea5cc273 Rollup merge of #36789 - jseyfried:non_inline_mod_in_block, r=nikomatsakis
Allow more non-inline modules in blocks

Currently, non-inline modules without a `#[path]` attribute are not allowed in blocks.
This PR allows non-inline modules that have an ancestor module with a `#[path]` attribute, provided there is not a nearer ancestor block.

For example,
```rust
fn main() {
    #[path = "..."] mod foo {
        mod bar; //< allowed by this PR
        fn f() {
            mod bar; //< still an error
        }
    }
}
```

Fixes #36772.
r? @nikomatsakis
2016-09-28 20:21:52 -07:00
Jonathan Turner
13c8e763d4 Rollup merge of #36787 - jseyfried:fix_test_harness_reexport_errors, r=nrc
Avoid re-export errors in the generated test harness

Fixes #36768.
r? @nrc
2016-09-28 20:21:51 -07:00
Jonathan Turner
45fd0626a4 Rollup merge of #36760 - nrc:input2, r=alexcrichton
Allow supplying an error destination via the compiler driver

Allows replacing stderr with a buffer from the client.

Also, some refactoring around run_compiler.
2016-09-28 20:21:51 -07:00
Jonathan Turner
8f2c000506 Rollup merge of #36741 - matklad:no-flacky-test, r=alexcrichton
Remove CString drop test.

The test relies on the undefined behavior, and so may fail in some
circumstances. This can be worked around by stubbing a memory allocator
in the test, but it is a bit of work, and LLVM could still theoretically
eliminate the write of the zero byte in release mode (which is
intended).

So let's just remove the test and mark the function as inline. It
shouldn't be optimized away when inlined into the debug build of user's
code.

Supersedes #36607

r? @alexcrichton
2016-09-28 20:21:51 -07:00
Jonathan Turner
725d0f5d6a Rollup merge of #36704 - Mark-Simulacrum:cleanup-cabi, r=Aatch
Move ty_align and ty_size out of most C ABI code

s390x's C ABI ty_align and ty_size are not moved because the
implementation of ty_align varies in an atypical pattern: it calls
ty_size for the llvm::Vector type kind. ty_size then cannot be moved
since it indirectly calls ty_align through align.

Fixes #5116 (probably, not sure).
2016-09-28 20:21:51 -07:00