]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #27369 - brson:realstd, r=alexcrichton
Manish Goregaokar [Wed, 29 Jul 2015 20:13:53 +0000 (01:43 +0530)]
Rollup merge of #27369 - brson:realstd, r=alexcrichton

Since most lang items are actually defined in core, these hack reexports don't actually
do anything useful.

8 years agoRollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnik
Manish Goregaokar [Wed, 29 Jul 2015 20:13:53 +0000 (01:43 +0530)]
Rollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #27232 - Dangthrimble:master, r=steveklabnik
Manish Goregaokar [Wed, 29 Jul 2015 20:13:53 +0000 (01:43 +0530)]
Rollup merge of #27232 - Dangthrimble:master, r=steveklabnik

Added definitions for 'Expression', 'Expression-Oriented Language' and 'Statement' to glossary.
Sorted the definitions alphabetically.

r? @steveklabnik

8 years agoRollup merge of #26778 - jawline:master, r=pnkfelix
Manish Goregaokar [Wed, 29 Jul 2015 20:13:52 +0000 (01:43 +0530)]
Rollup merge of #26778 - jawline:master, r=pnkfelix

Print the error message and then what is expected by the repeat count so the output makes more sense when there is an error in the const expression

8 years agoAuto merge of #27353 - arielb1:parenthetical-error, r=steveklabnik
bors [Wed, 29 Jul 2015 18:10:48 +0000 (18:10 +0000)]
Auto merge of #27353 - arielb1:parenthetical-error, r=steveklabnik

This also calls the right API, which e.g. prevents a suggestion
for #![feature(unboxed_closures)] on stable.

Fixes #26970

r? @steveklabnik

8 years agoAuto merge of #27346 - dotdash:closure_dbg, r=michaelwoerister
bors [Wed, 29 Jul 2015 16:28:59 +0000 (16:28 +0000)]
Auto merge of #27346 - dotdash:closure_dbg, r=michaelwoerister

Closure variables represent the closure environment, not the closure
function, so the identifier used to ensure that the debuginfo is unique
for each kind of closure needs to be based on the closure upvars and not
the function signature.

8 years agoAuto merge of #27380 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 29 Jul 2015 14:47:23 +0000 (14:47 +0000)]
Auto merge of #27380 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #27102, #27286, #27313, #27325, #27326, #27327, #27341, #27342, #27343, #27345, #27350, #27355, #27374, #27375, #27379
- Failed merges:

8 years agoRollup merge of #27379 - jeehoonkang:master, r=steveklabnik
Steve Klabnik [Wed, 29 Jul 2015 14:30:37 +0000 (10:30 -0400)]
Rollup merge of #27379 - jeehoonkang:master, r=steveklabnik

As described in the module documentation, the memory orderings in Rust
are the same with that of LLVM.  However, the documentation for the
memory orderings enum says the memory orderings are the same of that of
C++.  Note that they differ in that C++'s support the consume reads,
while LLVM's does not.  Hence this commit fixes the bug in the
documentation for the enum.

8 years agoRollup merge of #27375 - niconii:vec-docs, r=Gankro
Steve Klabnik [Wed, 29 Jul 2015 14:30:36 +0000 (10:30 -0400)]
Rollup merge of #27375 - niconii:vec-docs, r=Gankro

Noticed that syntax like `vec![0; 5]` is never mentioned in `Vec<T>`'s docs, nor used in any of its methods' docs, so I figured I should add a mention of it. Also noticed `vec!(1, 2)` being used in one spot while I was at it, so I fixed that as well for consistency's sake.

r? @steveklabnik

8 years agoRollup merge of #27374 - dhuseby:fixing_configure_bsd, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:36 +0000 (10:30 -0400)]
Rollup merge of #27374 - dhuseby:fixing_configure_bsd, r=alexcrichton

FreeBSD uses ash, not bash.  The double bracket operators [[ and ]] are not supported.

8 years agoRollup merge of #27355 - krumelmonster:patch-1, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:36 +0000 (10:30 -0400)]
Rollup merge of #27355 - krumelmonster:patch-1, r=alexcrichton

Minor change in the book

8 years agoRollup merge of #27350 - GuillaumeGomez:patch-1, r=Manishearth
Steve Klabnik [Wed, 29 Jul 2015 14:30:36 +0000 (10:30 -0400)]
Rollup merge of #27350 - GuillaumeGomez:patch-1, r=Manishearth

cc #26970.

r? @Manishearth

8 years agoRollup merge of #27345 - killercup:patch-15, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:35 +0000 (10:30 -0400)]
Rollup merge of #27345 - killercup:patch-15, r=alexcrichton

The first paragraph of the docs of the Cursor struct ([src](https://github.com/rust-lang/rust/blob/ff6c6ce917bd6af9c5d9315708ae6be3ba0b7e91/src/libstd/io/cursor.rs#L18-L21)) contains a Markdown link. In listings (like <http://doc.rust-lang.org/nightly/std/io/>), this won't get rendered:

![std__io_-_rust](https://cloud.githubusercontent.com/assets/20063/8925843/5c5281a8-350b-11e5-8c63-09a369d746b0.png)

The hotfix would be to change the link by reference:

```rust
/// A `Cursor` wraps another type and provides it with a [`Seek`][seek]
/// implementation.
///
/// [seek]: trait.Seek.html
```

to a direct link:

```rust
/// A `Cursor` wraps another type and provides it with a
/// [`Seek`](trait.Seek.html) implementation.
```

_I have not tested this as I don't have access to a machine for compiling Rust right now._

(This seems to be a more general issue, but I think I have seen this mentioned before. This PR is just to hotfix on particular occurrence. Rustdoc seems to only read the first paragraph of a doc string for the description in index pages, and _after that_ convert Markdown to HTML.)

r? @steveklabnik

8 years agoRollup merge of #27343 - steveklabnik:fix_module, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:35 +0000 (10:30 -0400)]
Rollup merge of #27343 - steveklabnik:fix_module, r=alexcrichton

8 years agoRollup merge of #27342 - steveklabnik:fix_links, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:35 +0000 (10:30 -0400)]
Rollup merge of #27342 - steveklabnik:fix_links, r=alexcrichton

How embarassing :sob:

r? @alexcrichton

8 years agoRollup merge of #27341 - steveklabnik:remove_warning, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:35 +0000 (10:30 -0400)]
Rollup merge of #27341 - steveklabnik:remove_warning, r=alexcrichton

This isn't a standard header, and the other docs don't use it, so let's remove it.

8 years agoRollup merge of #27327 - steveklabnik:fix_take, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:34 +0000 (10:30 -0400)]
Rollup merge of #27327 - steveklabnik:fix_take, r=alexcrichton

This only reads five bytes, so don't use a ten byte buffer, that's confusing.

r? @alexcrichton

8 years agoRollup merge of #27326 - steveklabnik:doc_show_use, r=Gankro
Steve Klabnik [Wed, 29 Jul 2015 14:30:34 +0000 (10:30 -0400)]
Rollup merge of #27326 - steveklabnik:doc_show_use, r=Gankro

In spirit with https://internals.rust-lang.org/t/should-we-keep-including-obvious-imports-in-code-examples/2217, show the feature flags we're using in examples.

(also one instance of 'use')

8 years agoRollup merge of #27325 - midinastasurazz:patch-2, r=alexcrichton
Steve Klabnik [Wed, 29 Jul 2015 14:30:33 +0000 (10:30 -0400)]
Rollup merge of #27325 - midinastasurazz:patch-2, r=alexcrichton

8 years agoRollup merge of #27313 - nagisa:illegal-to-invalid, r=pnkfelix
Steve Klabnik [Wed, 29 Jul 2015 14:30:33 +0000 (10:30 -0400)]
Rollup merge of #27313 - nagisa:illegal-to-invalid, r=pnkfelix

Improves diagnostics in various locations, namely:

* A few error messages that orignally were a mix of an error message and suggestion how to fix it have been split up into two messages: an error and help/hint.
* Never report “illegal”. Fixes https://github.com/rust-lang/rust/issues/27288

8 years agoRollup merge of #27286 - lastorset:pub, r=steveklabnik
Steve Klabnik [Wed, 29 Jul 2015 14:30:33 +0000 (10:30 -0400)]
Rollup merge of #27286 - lastorset:pub, r=steveklabnik

The reader could probably infer this from the current text, but for C++ programmers it's not obvious that struct fields don't automatically become public.

Apparently I wasn't the only one to be confused:

http://stackoverflow.com/questions/29157300/field-of-struct-is-private-when-importing-module

I don't think an example is necessary, but can add one if desired.

r? @steveklabnik

8 years agoRollup merge of #27102 - tshepang:better-examples, r=aturon
Steve Klabnik [Wed, 29 Jul 2015 14:30:33 +0000 (10:30 -0400)]
Rollup merge of #27102 - tshepang:better-examples, r=aturon

8 years agoFix a documentation bug for memory orderings
Jeehoon Kang [Wed, 29 Jul 2015 13:48:25 +0000 (22:48 +0900)]
Fix a documentation bug for memory orderings

As described in the module documentation, the memory orderings in Rust
are the same with that of LLVM.  However, the documentation for the
memory orderings enum says the memory orderings are the same of that of
C++.  Note that they differ in that C++'s support the consume reads,
while LLVM's does not.  Hence this commit fixes the bug in the
documentation for the enum.

8 years agoAuto merge of #27365 - pcwalton:more-collections, r=aturon
bors [Wed, 29 Jul 2015 13:11:29 +0000 (13:11 +0000)]
Auto merge of #27365 - pcwalton:more-collections, r=aturon

This was showing up in Servo profiles.

r? @aturon

8 years agoAuto merge of #27360 - dhuseby:fixing_freebsd_stat_structs_and_tests, r=alexcrichton
bors [Wed, 29 Jul 2015 11:33:20 +0000 (11:33 +0000)]
Auto merge of #27360 - dhuseby:fixing_freebsd_stat_structs_and_tests, r=alexcrichton

…ebsd 10.1 x86_64 and i686

8 years agoAuto merge of #27358 - bluss:split-at-mut, r=aturon
bors [Wed, 29 Jul 2015 09:57:50 +0000 (09:57 +0000)]
Auto merge of #27358 - bluss:split-at-mut, r=aturon

Use raw pointers to avoid aliasing violation in split_at_mut

Fixes #27357

8 years agoModified to add 'found' to error message closes #26485
Blake Loring [Wed, 29 Jul 2015 09:06:50 +0000 (10:06 +0100)]
Modified to add 'found' to error message closes #26485

8 years agoAuto merge of #27349 - arielb1:constant-at, r=alexcrichton
bors [Wed, 29 Jul 2015 08:23:04 +0000 (08:23 +0000)]
Auto merge of #27349 - arielb1:constant-at, r=alexcrichton

Fixes #27033
Fixes #27077

r? @alexcrichton

8 years agoAuto merge of #27261 - arielb1:drop-sanity-check, r=pnkfelix
bors [Wed, 29 Jul 2015 06:47:55 +0000 (06:47 +0000)]
Auto merge of #27261 - arielb1:drop-sanity-check, r=pnkfelix

This fixes multiple bugs, and as several of these are soundness issue, is a [breaking-change].

r? @pnkfelix

8 years agoAuto merge of #27339 - alexcrichton:remove-old-rt, r=brson
bors [Wed, 29 Jul 2015 05:12:33 +0000 (05:12 +0000)]
Auto merge of #27339 - alexcrichton:remove-old-rt, r=brson

These aren't really used for anything any more, so there doesn't seem to be much
reason to leave them around in the `rt` directory. There was some limiting of
threads spawned or tests when run under valgrind, but very little is run under
valgrind nowadays so there's also no real use keeping these around.

8 years agoMake docs for Vec::push() use vec! with square brackets
Nicolette Verlinden [Wed, 29 Jul 2015 04:55:12 +0000 (23:55 -0500)]
Make docs for Vec::push() use vec! with square brackets

8 years agoMention vec![x; len] syntax in Vec docs
Nicolette Verlinden [Wed, 29 Jul 2015 04:53:25 +0000 (23:53 -0500)]
Mention vec![x; len] syntax in Vec docs

8 years agorecent changes to search for gcc/clang on freebsd and this fixes #14381
Dave Huseby [Wed, 29 Jul 2015 04:23:19 +0000 (21:23 -0700)]
recent changes to search for gcc/clang on freebsd and this fixes #14381

8 years agoAuto merge of #27260 - alexcrichton:cap-lints, r=nrc
bors [Wed, 29 Jul 2015 02:04:38 +0000 (02:04 +0000)]
Auto merge of #27260 - alexcrichton:cap-lints, r=nrc

This commit is an implementation of [RFC 1193][rfc] which adds the ability to
the compiler to cap the lint level for the entire compilation session. This flag
will ensure that no lints will go above this level, and Cargo will primarily use
this flag passing `--cap-lints allow` to all upstream dependencies.

[rfc]: https://github.com/rust-lang/rfcs/pull/1193

Closes #27259

8 years agorustc: Add a --cap-lints flag to the compiler
Alex Crichton [Fri, 24 Jul 2015 05:19:12 +0000 (22:19 -0700)]
rustc: Add a --cap-lints flag to the compiler

This commit is an implementation of [RFC 1193][rfc] which adds the ability to
the compiler to cap the lint level for the entire compilation session. This flag
will ensure that no lints will go above this level, and Cargo will primarily use
this flag passing `--cap-lints allow` to all upstream dependencies.

[rfc]: https://github.com/rust-lang/rfcs/pull/1193

Closes #27259

8 years agoAuto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix
bors [Wed, 29 Jul 2015 00:28:55 +0000 (00:28 +0000)]
Auto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix

`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most `print_maybe_styled` invocations allocated a `String` previously, whereas the new macro uses `write_fmt` to write the formatted string directly to the terminal).

This probably could have been part of #26838, but it’s too late now. It’s also rebased on #26838’s branch because otherwise pretty much all of the changes in this PR would conflict with the other PR’s changes.

8 years agostd: Remove some old #[cfg(test) hacks
Brian Anderson [Tue, 28 Jul 2015 23:22:05 +0000 (16:22 -0700)]
std: Remove some old #[cfg(test) hacks

Since most lang items are actually defined in core, these hack reexports don't actually
do anything useful.

8 years agoReplace illegal with invalid in most diagnostics
Simonas Kazlauskas [Mon, 27 Jul 2015 00:49:38 +0000 (03:49 +0300)]
Replace illegal with invalid in most diagnostics

8 years agoImprove typeck diagnostic messages
Simonas Kazlauskas [Mon, 27 Jul 2015 00:31:38 +0000 (03:31 +0300)]
Improve typeck diagnostic messages

Mostly by splitting error messages into proper pairs of errors and helps

8 years agoImprove invalid recursive types diagnostic
Simonas Kazlauskas [Sun, 26 Jul 2015 22:10:43 +0000 (01:10 +0300)]
Improve invalid recursive types diagnostic

8 years agoAuto merge of #27318 - soon:E0391_explanation, r=nrc
bors [Tue, 28 Jul 2015 22:51:53 +0000 (22:51 +0000)]
Auto merge of #27318 - soon:E0391_explanation, r=nrc

Part of #24407

8 years agolibcollections: Inline some performance-critical string functions; e.g.
Patrick Walton [Tue, 28 Jul 2015 22:17:27 +0000 (15:17 -0700)]
libcollections: Inline some performance-critical string functions; e.g.
`chars()`.

This was showing up in Servo profiles.

8 years agoAuto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb
bors [Tue, 28 Jul 2015 21:14:28 +0000 (21:14 +0000)]
Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb

this has quite some fallout. but also made lots of stuff more readable imo

[breaking-change] for plugin authors

8 years agoUse raw pointers to avoid aliasing violation in split_at_mut
Ulrik Sverdrup [Tue, 28 Jul 2015 17:54:13 +0000 (19:54 +0200)]
Use raw pointers to avoid aliasing violation in split_at_mut

Fixes #27357

8 years agoAuto merge of #26934 - reem:boxed-slice-clone, r=Gankro
bors [Tue, 28 Jul 2015 19:36:26 +0000 (19:36 +0000)]
Auto merge of #26934 - reem:boxed-slice-clone, r=Gankro

Closes #25097

8 years agoFixes #25155 and fixes #27359 by fixing the stat defines for both freebsd 10.1 x86_64...
Dave Huseby [Tue, 28 Jul 2015 18:09:49 +0000 (11:09 -0700)]
Fixes #25155 and fixes #27359 by fixing the stat defines for both freebsd 10.1 x86_64 and i686

8 years agoAuto merge of #27173 - mark-buer:split-android-ndks, r=alexcrichton
bors [Tue, 28 Jul 2015 17:58:18 +0000 (17:58 +0000)]
Auto merge of #27173 - mark-buer:split-android-ndks, r=alexcrichton

Allows a multi-Android-target Rust compiler to be built.
Without these (or similar) changes, only a single-Android-target Rust compiler is possible.
Please see https://internals.rust-lang.org/t/dual-target-android-rust-compiler/2382/3 for additional context.

8 years agomore precise for inclusive range
krumelmonster [Tue, 28 Jul 2015 17:22:20 +0000 (19:22 +0200)]
more precise for inclusive range

8 years agoprohibit the lhs of an @-pattern being a constant
Ariel Ben-Yehuda [Tue, 28 Jul 2015 13:52:54 +0000 (16:52 +0300)]
prohibit the lhs of an @-pattern being a constant

as this breaks code that worked under some conditions, this is a
[breaking-change]

Fixes #27033
Fixes #27077

8 years agoclarify the parenthetical notation stability error message
Ariel Ben-Yehuda [Tue, 28 Jul 2015 16:21:24 +0000 (19:21 +0300)]
clarify the parenthetical notation stability error message

This also calls the right API, which e.g. prevents a suggestion
for #![feature(unboxed_closures)] on stable.

Fixes #26970

8 years agoremove `get_ident` and `get_name`, make `as_str` sound
Oliver Schneider [Tue, 28 Jul 2015 16:07:20 +0000 (18:07 +0200)]
remove `get_ident` and `get_name`, make `as_str` sound

8 years agoAuto merge of #26173 - pnkfelix:fsk-trans-nzmove-take3, r=nikomatsakis
bors [Tue, 28 Jul 2015 15:15:00 +0000 (15:15 +0000)]
Auto merge of #26173 - pnkfelix:fsk-trans-nzmove-take3, r=nikomatsakis

Add dropflag hints (stack-local booleans) for unfragmented paths in trans.  Part of #5016.

Added code to maintain these hints at runtime, and to conditionalize drop-filling and calls to destructors.

In this early stage of my incremental implementation strategy, we are using hints, so we are always free to leave out a flag for a path -- then we just pass `None` as the dropflag hint in the corresponding schedule cleanup call. But, once a path has a hint, we must at least maintain it: i.e. if the hint exists, we must ensure it is never set to "moved" if the data in question might actually have been initialized. It remains sound to conservatively set the hint to "initialized" as long as the true drop-flag embedded in the value itself is up-to-date.

I hope the commit series has been broken up to be readable; most of the commits in the series should build (though I did not always check this).

----

Oh, I think this technically qualifies as a:
[breaking-change]
because it removes drop-filling in some cases where one could previously observe it. That should only affect `unsafe` code; no safe code should be able to inspect whether the drop-fill was present or not. For an example of code that needed to change to account for this, see commit a81c24ae0216ab47df59acd724f8a33124fb6d97 (a unit test of the `move_val_init` intrinsic).  I have not encountered actual code that needed to be updated to account for the change, since this should only be skipping the drop-filling on *moved* values, not on dropped one, and so even types that use `unsafe_no_drop_flag` should be unchanged by this particular PR. (Their time will come later.)

8 years agoReplace occurences of illegal in user facing docs
Simonas Kazlauskas [Tue, 28 Jul 2015 14:53:50 +0000 (17:53 +0300)]
Replace occurences of illegal in user facing docs

8 years agoImprove E0119 error explanation
Guillaume Gomez [Tue, 28 Jul 2015 14:05:16 +0000 (16:05 +0200)]
Improve E0119 error explanation

8 years agocomments and code-cleanup in response to reviews.
Felix S. Klock II [Tue, 28 Jul 2015 14:07:05 +0000 (16:07 +0200)]
comments and code-cleanup in response to reviews.

8 years agobuild fragmented map earlier to make its dependencies clearer.
Felix S. Klock II [Tue, 30 Jun 2015 12:09:25 +0000 (08:09 -0400)]
build fragmented map earlier to make its dependencies clearer.

8 years agoReduced the Lvalue constructors to a kernel of three constructors.
Felix S. Klock II [Wed, 10 Jun 2015 09:42:48 +0000 (11:42 +0200)]
Reduced the Lvalue constructors to a kernel of three constructors.

Updated all call sites that used the other contructors to uniformly
call `Lvalue::new_with_hint`, passing along the appropriate kind
of hint for each context.

Placated tidy in a few other places in datum.rs.

8 years agoRevise intrinsic-move-val test to not require knowledge of whether filling drop is...
Felix S. Klock II [Mon, 8 Jun 2015 10:30:58 +0000 (12:30 +0200)]
Revise intrinsic-move-val test to not require knowledge of whether filling drop is in use.

8 years agoDuring my own review, I convinced myself this was indeed a bug.
Felix S. Klock II [Wed, 10 Jun 2015 08:40:32 +0000 (10:40 +0200)]
During my own review, I convinced myself this was indeed a bug.

Testing indicates bug would have been caught, albeit later than one
might hope, during `sync::mpsc::tests::smoke_shared_port_gone2` test.

8 years agoAdd dropflag hints (stack-local booleans) for unfragmented paths in trans.
Felix S. Klock II [Sun, 7 Jun 2015 07:25:14 +0000 (09:25 +0200)]
Add dropflag hints (stack-local booleans) for unfragmented paths in trans.

Added code to maintain these hints at runtime, and to conditionalize
drop-filling and calls to destructors.

In this early stage, we are using hints, so we are always free to
leave out a flag for a path -- then we just pass `None` as the
dropflag hint in the corresponding schedule cleanup call. But, once a
path has a hint, we must at least maintain it: i.e. if the hint
exists, we must ensure it is never set to "moved" if the data in
question might actually have been initialized. It remains sound to
conservatively set the hint to "initialized" as long as the true
drop-flag embedded in the value itself is up-to-date.

----

Here are some high-level details I want to point out:

 * We maintain the hint in Lvalue::post_store, marking the lvalue as
   moved. (But also continue drop-filling if necessary.)

 * We update the hint on ExprAssign.

 * We pass along the hint in once closures that capture-by-move.

 * You only call `drop_ty` for state that does not have an associated hint.
   If you have a hint, you must call `drop_ty_core` instead.
   (Originally I passed the hint into `drop_ty` as well, to make the
   connection to a hint more apparent, but the vast majority of
   current calls to `drop_ty` are in contexts where no hint is
   available, so it just seemed like noise in the resulting diff.)

8 years agorustc and rustc::borrowck: pass fragment info down into trans.
Felix S. Klock II [Sun, 7 Jun 2015 07:16:55 +0000 (09:16 +0200)]
rustc and rustc::borrowck: pass fragment info down into trans.

8 years agoExtend `trans::datum::Lvalue` so that it carrys an optional dropflag hint.
Felix S. Klock II [Fri, 5 Jun 2015 19:34:03 +0000 (21:34 +0200)]
Extend `trans::datum::Lvalue` so that it carrys an optional dropflag hint.

Instrumented calls sites that construct Lvalues to ease tracking down
cases that we might need to change whether or not they carry a hint.

Note that this commit does not do anything to actually *construct*
the `lldropflag_hints` map, nor does it change anything about codegen
itself. Those parts are in follow-on commits.

8 years agodebugflag to turn off nonzeroing move hint optimization.
Felix S. Klock II [Fri, 5 Jun 2015 19:29:18 +0000 (21:29 +0200)]
debugflag to turn off nonzeroing move hint optimization.

(already thumbs-upped pre-rebase by nikomatsakis)

8 years agoPrep for dropflag hints: refactor `trans:_match` to pass around `MatchInput` rather...
Felix S. Klock II [Fri, 5 Jun 2015 12:38:49 +0000 (14:38 +0200)]
Prep for dropflag hints: refactor `trans:_match` to pass around `MatchInput` rather than `ValueRef`.

(already thumbs-upped pre-rebase by nikomatsakis)

The refactoring here is trivial because `trans::datum::Lvalue`
currently carries no payload. However, future commits will start
adding a payload to `Lvalue`, and thus will force us either

 1. to thread the payload through the `_match` code (a long term goal), or

 2. to ensure the payload has some reasonable default value.

8 years agoPrep for dropflag-hints: Clarify trans bindings MoveByRef and MoveIntoCopy.
Felix S. Klock II [Fri, 5 Jun 2015 11:30:41 +0000 (13:30 +0200)]
Prep for dropflag-hints: Clarify trans bindings MoveByRef and MoveIntoCopy.

8 years agoAuto merge of #27330 - alexcrichton:reenable-lto-syntax-extension, r=huonw
bors [Tue, 28 Jul 2015 12:53:28 +0000 (12:53 +0000)]
Auto merge of #27330 - alexcrichton:reenable-lto-syntax-extension, r=huonw

The functionality this was testing was removed somewhere along the line, and
this commit restores what it was testing.

Closes #20586

8 years agoAuto merge of #27319 - diaphore:pr_debug_osstr_escape, r=alexcrichton
bors [Tue, 28 Jul 2015 10:28:45 +0000 (10:28 +0000)]
Auto merge of #27319 - diaphore:pr_debug_osstr_escape, r=alexcrichton

I had to modify some tests : since `wtf8buf_show` and `wtf8_show` were doing the exact same thing, I repurposed `wtf8_show` to `wtf8buf_show_str` which ensures `Wtf8Buf` `Debug`-formats the same as `str`.

`write_str_escaped` might also be shared amongst other `fmt` but I just left it there within `Wtf8::fmt` for review.

8 years agoFix de-deduplication for closure debuginfo
Björn Steinbrink [Mon, 27 Jul 2015 22:29:05 +0000 (00:29 +0200)]
Fix de-deduplication for closure debuginfo

Closure variables represent the closure environment, not the closure
function, so the identifier used to ensure that the debuginfo is unique
for each kind of closure needs to be based on the closure upvars and not
the function signature.

8 years agoAuto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichton
bors [Tue, 28 Jul 2015 08:51:21 +0000 (08:51 +0000)]
Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichton

FreeBSD i386 snapshot is missing, failed tests (possibly spurious).
r? @alexcrichton

8 years agoImplement Clone for Box<[T]> where T: Clone
Jonathan Reem [Mon, 27 Jul 2015 05:12:00 +0000 (22:12 -0700)]
Implement Clone for Box<[T]> where T: Clone

Closes #25097

8 years agoIO Docs: Fix Link in Cursor description
Pascal Hertleif [Tue, 28 Jul 2015 07:39:15 +0000 (09:39 +0200)]
IO Docs: Fix Link in Cursor description

The first paragraph of the docs of the Cursor struct contains a Markdown
link. In listings, this won't get rendered. (Rustdoc seems to split off the
first paragraph and after that convert Markdown to HTML.)

8 years agoSplits Android NDK path configuration.
Mark Buer [Mon, 20 Jul 2015 23:39:47 +0000 (11:39 +1200)]
Splits Android NDK path configuration.

8 years agoAuto merge of #27275 - nrc:save-use, r=brson
bors [Tue, 28 Jul 2015 07:14:55 +0000 (07:14 +0000)]
Auto merge of #27275 - nrc:save-use, r=brson

r? @brson

8 years agoAuto merge of #27280 - bluss:siphash-perf, r=alexcrichton
bors [Tue, 28 Jul 2015 05:38:53 +0000 (05:38 +0000)]
Auto merge of #27280 - bluss:siphash-perf, r=alexcrichton

Improve siphash performance for longer data

Use `ptr::copy_nonoverlapping` (aka memcpy) to load an u64 from the
byte stream. This is correct for any alignment, and the compiler will
use the appropriate instruction to load the data.

Also contains small tweaks that should benefit hashing short data too,
both the commit that removes a variable and the autovectorization of
the hash state initialization (in SipHash::reset).

Benchmarks show that hashing longer data benefits for the improved word loading.

Before (using benchmarks from the first commit in the PR):

The before benchmark is a bit noisy.

```
test hash::sip::bench_bytes_4                              ... bench:          41 ns/iter (+/- 0) = 97 MB/s
test hash::sip::bench_bytes_7                              ... bench:          49 ns/iter (+/- 2) = 142 MB/s
test hash::sip::bench_bytes_8                              ... bench:          42 ns/iter (+/- 4) = 190 MB/s
test hash::sip::bench_bytes_a_16                           ... bench:          57 ns/iter (+/- 14) = 280 MB/s
test hash::sip::bench_bytes_b_32                           ... bench:          85 ns/iter (+/- 74) = 376 MB/s
test hash::sip::bench_bytes_c_128                          ... bench:         278 ns/iter (+/- 33) = 460 MB/s
test hash::sip::bench_long_str                             ... bench:         825 ns/iter (+/- 103)
test hash::sip::bench_str_of_8_bytes                       ... bench:         151 ns/iter (+/- 66)
test hash::sip::bench_str_over_8_bytes                     ... bench:          59 ns/iter (+/- 3)
test hash::sip::bench_str_under_8_bytes                    ... bench:          47 ns/iter (+/- 56)
test hash::sip::bench_u32                                  ... bench:          39 ns/iter (+/- 93) = 205 MB/s
test hash::sip::bench_u32_keyed                            ... bench:          40 ns/iter (+/- 88) = 200 MB/s
test hash::sip::bench_u64                                  ... bench:          54 ns/iter (+/- 96) = 148 MB/s
```

After:

```
test hash::sip::bench_bytes_4                              ... bench:          41 ns/iter (+/- 3) = 97 MB/s
test hash::sip::bench_bytes_7                              ... bench:          48 ns/iter (+/- 0) = 145 MB/s
test hash::sip::bench_bytes_8                              ... bench:          35 ns/iter (+/- 1) = 228 MB/s
test hash::sip::bench_bytes_a_16                           ... bench:          45 ns/iter (+/- 1) = 355 MB/s
test hash::sip::bench_bytes_b_32                           ... bench:          60 ns/iter (+/- 0) = 533 MB/s
test hash::sip::bench_bytes_c_128                          ... bench:         161 ns/iter (+/- 5) = 795 MB/s
test hash::sip::bench_long_str                             ... bench:         514 ns/iter (+/- 5)
test hash::sip::bench_str_of_8_bytes                       ... bench:          44 ns/iter (+/- 0)
test hash::sip::bench_str_over_8_bytes                     ... bench:          51 ns/iter (+/- 0)
test hash::sip::bench_str_under_8_bytes                    ... bench:          52 ns/iter (+/- 6)
test hash::sip::bench_u32                                  ... bench:          40 ns/iter (+/- 2) = 200 MB/s
test hash::sip::bench_u32_keyed                            ... bench:          39 ns/iter (+/- 1) = 205 MB/s
test hash::sip::bench_u64                                  ... bench:          36 ns/iter (+/- 1) = 222 MB/s
```

8 years agoremove incorrect statement from TRPL: crates and modules
Steve Klabnik [Tue, 28 Jul 2015 03:04:42 +0000 (23:04 -0400)]
remove incorrect statement from TRPL: crates and modules

8 years agofix two links
Steve Klabnik [Tue, 28 Jul 2015 02:25:06 +0000 (22:25 -0400)]
fix two links

How embarassing :sob:

8 years agoRemove warning header for consistency
Steve Klabnik [Tue, 28 Jul 2015 02:20:37 +0000 (22:20 -0400)]
Remove warning header for consistency

This isn't a standard header, and the other docs don't use it, so let's remove it.

8 years agoAuto merge of #26914 - alexcrichton:deprecate-easy, r=aturon
bors [Tue, 28 Jul 2015 01:12:39 +0000 (01:12 +0000)]
Auto merge of #26914 - alexcrichton:deprecate-easy, r=aturon

Many of these have long since reached their stage of being obsolete, so this
commit starts the removal process for all of them. The unstable features that
were deprecated are:

* box_heap
* cmp_partial
* fs_time
* hash_default
* int_slice
* iter_min_max
* iter_reset_fuse
* iter_to_vec
* map_in_place
* move_from
* owned_ascii_ext
* page_size
* read_and_zero
* scan_state
* slice_chars
* slice_position_elem
* subslice_offset

8 years agostd: Deprecate a number of unstable features
Alex Crichton [Wed, 8 Jul 2015 15:33:13 +0000 (08:33 -0700)]
std: Deprecate a number of unstable features

Many of these have long since reached their stage of being obsolete, so this
commit starts the removal process for all of them. The unstable features that
were deprecated are:

* cmp_partial
* fs_time
* hash_default
* int_slice
* iter_min_max
* iter_reset_fuse
* iter_to_vec
* map_in_place
* move_from
* owned_ascii_ext
* page_size
* read_and_zero
* scan_state
* slice_chars
* slice_position_elem
* subslice_offset

8 years agoAuto merge of #27250 - alexcrichton:ucrt, r=brson
bors [Mon, 27 Jul 2015 23:38:04 +0000 (23:38 +0000)]
Auto merge of #27250 - alexcrichton:ucrt, r=brson

Visual Studio 2015, recently released, includes the Universal CRT, a different
flavor than was provided before. The binaries and header files for this library
are included in new locations not previously known about by gcc-rs, and this
commit adds support for the necessary probing to find these.

Unfortunately there are no prior examples of this probing to be found in
frameworks like CMake or clang, so this is done is a bit of a sketchy method
today. It assumes that the installation is in a relatively standard format and
then blindly looks for the location of the UCRT. I'd love to switch this over to
using registry keys for probing, but I was currently unable to find such keys.

This should enable the compiler to work outside VS 2015 dev tools prompts.

8 years agostd: Remove msvc/valgrind headers
Alex Crichton [Mon, 27 Jul 2015 23:10:59 +0000 (16:10 -0700)]
std: Remove msvc/valgrind headers

These aren't really used for anything any more, so there doesn't seem to be much
reason to leave them around in the `rt` directory. There was some limiting of
threads spawned or tests when run under valgrind, but very little is run under
valgrind nowadays so there's also no real use keeping these around.

8 years agoAuto merge of #26216 - azerupi:doc-experiments, r=steveklabnik
bors [Mon, 27 Jul 2015 21:20:11 +0000 (21:20 +0000)]
Auto merge of #26216 - azerupi:doc-experiments, r=steveklabnik

So I have tried to improve the rustbook engine:

- The sidebar now looks a lot more like gitbook (I thinks it cleaner)
- Added the Open Sans font, in my opinion more readable for prolonged periods of time
- Changed the style for code blocks a little

I encountered 1 problem. In `build.rs` I added this google font url (I commented out the non-relevant parts for clarity)

```rust
let rustdoc_args: &[String] = &[
    //"".to_string(),
    //preprocessed_path.display().to_string(),
    //format!("-o{}", out_path.display()),
    //format!("--html-before-content={}", prelude.display()),
    //format!("--html-after-content={}", postlude.display()),
    //format!("--markdown-playground-url=http://play.rust-lang.org"),
    //format!("--markdown-css={}", item.path_to_root.join("rust-book.css").display()),
    format!("--markdown-css=http://fonts.googleapis.com/css?family&#61;Open+Sans:400italic,700italic,400,700"),
    //"--markdown-no-toc".to_string(),
];
```
As you can see, I had to escape `=` with `&#61;` because the string would get truncated if I didn't. Is that normal behaviour? Is that for security measures? If it is, isn't it a little weak if you can circumvent it by escaped characters? I don't know the reason behind, but I thought it was at least worth mentioning :)

Take your time for this PR, I still want to add multiple improvements:

- Like gitbook, possibility to change font by user
- Put `css` and `js` in their respective files (not hardcoded in rust)
- button to hide sidebar
- ...

So I'm not in a hurry to get this merged ;) But if you think it's good enough to be merged, go ahead. I will make another PR when I have other improvements.

In the image below is a screen of the improvements

![rustbook](https://cloud.githubusercontent.com/assets/7647338/8105345/bf545c74-1038-11e5-962e-b04ebfaf8257.png)

8 years agoAuto merge of #27230 - GuillaumeGomez:patch-1, r=brson
bors [Mon, 27 Jul 2015 19:44:22 +0000 (19:44 +0000)]
Auto merge of #27230 - GuillaumeGomez:patch-1, r=brson

Part of #24407.
cc @Manishearth

8 years agoFix the relative path issue by including the files using include_bytes!
Mathieu David [Mon, 27 Jul 2015 18:46:01 +0000 (20:46 +0200)]
Fix the relative path issue by including the files using include_bytes!

8 years agoAuto merge of #27304 - alexcrichton:revert-picky-dllimport, r=brson
bors [Mon, 27 Jul 2015 18:09:22 +0000 (18:09 +0000)]
Auto merge of #27304 - alexcrichton:revert-picky-dllimport, r=brson

This reverts commit a0efd3a3d99a98e3399a4f07abe6a67cf0660335.

This commit caused a lot of unintended breakage for many Cargo builds. The problem is that Cargo compiles build scripts with `-C prefer-dynamic`, so the standard library is always dynamically linked and hence any imports need to be marked with `dllimport`. Dependencies of build scripts, however, were compiled as rlibs and did not have their imports tagged with `dllimport`, so build scripts would fail to link.

While known that this situation would break, it was unknown that it was a common scenario in the wild. As a result I'm just reverting these heuristics for now.

8 years agoFix escaping of characters in Debug for OsStr
diaphore [Sun, 26 Jul 2015 17:32:13 +0000 (19:32 +0200)]
Fix escaping of characters in Debug for OsStr

Fixes #27211

Fix Debug for {char, str} in core::fmt

8 years agotest: Fix lto-syntax-extension
Alex Crichton [Mon, 27 Jul 2015 17:14:48 +0000 (10:14 -0700)]
test: Fix lto-syntax-extension

The functionality this was testing was removed somewhere along the line, and
this commit restores what it was testing.

Closes #20586

8 years agoAuto merge of #27284 - lastorset:default-methods, r=Gankro
bors [Mon, 27 Jul 2015 16:34:40 +0000 (16:34 +0000)]
Auto merge of #27284 - lastorset:default-methods, r=Gankro

Instead of bar/baz, use valid/invalid as default methods. This
illustrates why you might want default methods, and shows that you can
call other trait methods from a default method.

r? @steveklabnik

8 years agoShow appropriate feature flags in docs
Steve Klabnik [Mon, 27 Jul 2015 14:50:19 +0000 (10:50 -0400)]
Show appropriate feature flags in docs

8 years agoFix buffer length in std::io::take
Steve Klabnik [Mon, 27 Jul 2015 15:43:15 +0000 (11:43 -0400)]
Fix buffer length in std::io::take

This only reads five bytes, so don't use a ten byte buffer, that's confusing.

8 years agoTurn on `box(PLACE) expr` deprecation warning post-snapshot.
Eduard Burtescu [Mon, 27 Jul 2015 15:11:43 +0000 (18:11 +0300)]
Turn on `box(PLACE) expr` deprecation warning post-snapshot.

8 years agoAuto merge of #27317 - midinastasurazz:patch-1, r=Gankro
bors [Mon, 27 Jul 2015 14:59:27 +0000 (14:59 +0000)]
Auto merge of #27317 - midinastasurazz:patch-1, r=Gankro

r? @steveklabnik

8 years agoFix misrendered HTML character entities
midinastasurazz [Mon, 27 Jul 2015 14:18:50 +0000 (16:18 +0200)]
Fix misrendered HTML character entities

8 years agoAuto merge of #27278 - thepowersgang:result-expect-issue, r=alexcrichton
bors [Mon, 27 Jul 2015 13:24:34 +0000 (13:24 +0000)]
Auto merge of #27278 - thepowersgang:result-expect-issue, r=alexcrichton

8 years agoAuto merge of #27315 - eefriedman:improper-ctypes-void-ret, r=alexcrichton
bors [Mon, 27 Jul 2015 11:49:45 +0000 (11:49 +0000)]
Auto merge of #27315 - eefriedman:improper-ctypes-void-ret, r=alexcrichton

Fixes issue #27302.

8 years agoRegister new snapshots (2015-07-26 a5c12f4).
Eduard Burtescu [Mon, 27 Jul 2015 10:31:48 +0000 (13:31 +0300)]
Register new snapshots (2015-07-26 a5c12f4).

8 years agoAuto merge of #27310 - akiss77:fix-aarch64-getrandom, r=alexcrichton
bors [Mon, 27 Jul 2015 09:34:05 +0000 (09:34 +0000)]
Auto merge of #27310 - akiss77:fix-aarch64-getrandom, r=alexcrichton

8 years agoFixed grammar
Andrew [Mon, 27 Jul 2015 09:26:35 +0000 (14:26 +0500)]
Fixed grammar

8 years agoAuto merge of #27308 - sstewartgallus:standardize-nonzero-check, r=alexcrichton
bors [Mon, 27 Jul 2015 05:55:25 +0000 (05:55 +0000)]
Auto merge of #27308 - sstewartgallus:standardize-nonzero-check, r=alexcrichton

It's odd that "! -z" was used instead of "-n" in some places.  Is perhaps, "! -z" more portable or something?

8 years agoFix typo: yur -> your
midinastasurazz [Mon, 27 Jul 2015 05:20:54 +0000 (07:20 +0200)]
Fix typo: yur -> your