]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRun rustfmt on liballoc.
Ahmed Charles [Mon, 12 Oct 2015 05:11:59 +0000 (22:11 -0700)]
Run rustfmt on liballoc.

8 years agoAuto merge of #28969 - chrisccerami:link_to_ffi_in_concurrency_chapter, r=steveklabnik
bors [Sun, 11 Oct 2015 23:20:28 +0000 (23:20 +0000)]
Auto merge of #28969 - chrisccerami:link_to_ffi_in_concurrency_chapter, r=steveklabnik

8 years agoAuto merge of #28973 - nrc:match-source, r=Manishearth
bors [Sun, 11 Oct 2015 21:35:48 +0000 (21:35 +0000)]
Auto merge of #28973 - nrc:match-source, r=Manishearth

r? @Manishearth

8 years agoProperly set the MatchSource for for loops
Nick Cameron [Sun, 11 Oct 2015 20:49:29 +0000 (09:49 +1300)]
Properly set the MatchSource for for loops

8 years agoAuto merge of #28960 - barosl:home-temp-dir-doc, r=alexcrichton
bors [Sun, 11 Oct 2015 19:51:22 +0000 (19:51 +0000)]
Auto merge of #28960 - barosl:home-temp-dir-doc, r=alexcrichton

This concern was raised by #28940.

8 years agoAuto merge of #28948 - steveklabnik:gh28944, r=alexcrichton
bors [Sun, 11 Oct 2015 18:06:51 +0000 (18:06 +0000)]
Auto merge of #28948 - steveklabnik:gh28944, r=alexcrichton

"Crate features" isn't a thing in Rust, but you do need to add this line
to your crate root.

Fixes #28944

8 years agoLink to FFI in Concurrency chapter
Chris C Cerami [Sun, 11 Oct 2015 17:23:57 +0000 (13:23 -0400)]
Link to FFI in Concurrency chapter

8 years agoAuto merge of #28966 - ykomatsu:trpl, r=steveklabnik
bors [Sun, 11 Oct 2015 16:20:13 +0000 (16:20 +0000)]
Auto merge of #28966 - ykomatsu:trpl, r=steveklabnik

8 years agoAuto merge of #28964 - eminence:docfix, r=sfackler
bors [Sun, 11 Oct 2015 14:32:45 +0000 (14:32 +0000)]
Auto merge of #28964 - eminence:docfix, r=sfackler

r? @steveklabnik

8 years agoFix some typos
Yoshito Komatsu [Sun, 11 Oct 2015 13:38:44 +0000 (22:38 +0900)]
Fix some typos

8 years agoAuto merge of #28965 - bluss:ptr-write-doc, r=huonw
bors [Sun, 11 Oct 2015 11:45:26 +0000 (11:45 +0000)]
Auto merge of #28965 - bluss:ptr-write-doc, r=huonw

core: Update the safety docs for core::ptr::write

Updated to reflect that not dropping a value is safe (but discouraged).

8 years agocore: Update the safety docs for core::ptr::write
Ulrik Sverdrup [Sun, 11 Oct 2015 11:40:47 +0000 (13:40 +0200)]
core: Update the safety docs for core::ptr::write

Updated to reflect that not dropping a value is safe (but discouraged).

8 years agoTrivial typo fix: from_utrf8 should be from_utf8
Andrew Chin [Sun, 11 Oct 2015 03:32:35 +0000 (23:32 -0400)]
Trivial typo fix:  from_utrf8 should be from_utf8

8 years agoClarify the behavior of `std::env::home_dir` and `std::env::temp_dir`
Barosl Lee [Sat, 10 Oct 2015 18:50:26 +0000 (03:50 +0900)]
Clarify the behavior of `std::env::home_dir` and `std::env::temp_dir`

This concern was raised by #28940.

8 years agoAuto merge of #28941 - jcaudle:rustfmt/librand-distributions-normal, r=nrc
bors [Sat, 10 Oct 2015 22:39:35 +0000 (22:39 +0000)]
Auto merge of #28941 - jcaudle:rustfmt/librand-distributions-normal, r=nrc

This is my first PR to rust and first collaboration on a rust project, but I think the formatting looked ok. If this works out, I hope to go through more of librand.

8 years agoAuto merge of #28949 - iwillspeak:rustfmt-libflate, r=nrc
bors [Sat, 10 Oct 2015 19:55:37 +0000 (19:55 +0000)]
Auto merge of #28949 - iwillspeak:rustfmt-libflate, r=nrc

This commit updates the libflate crate with the formatting output of
`rustfmt`.

r? @nrc

8 years agoUpdate Libflate Formatting
Will Speak [Sat, 10 Oct 2015 18:00:20 +0000 (19:00 +0100)]
Update Libflate Formatting

This commit updates the libflate crate with the formatting output of
`rustfmt`.

8 years agoDiagnostic change: crate features -> crate root
Steve Klabnik [Sat, 10 Oct 2015 17:35:40 +0000 (13:35 -0400)]
Diagnostic change: crate features -> crate root

"Crate features" isn't a thing in Rust, but you do need to add this line
to your crate root.

Fixes #28944

8 years agoAuto merge of #28945 - shama:doc-typos, r=steveklabnik
bors [Sat, 10 Oct 2015 16:40:05 +0000 (16:40 +0000)]
Auto merge of #28945 - shama:doc-typos, r=steveklabnik

Just a few typos found in the docs. Thanks!

8 years agodoc: fixing typos
Kyle Robinson Young [Sat, 10 Oct 2015 16:15:55 +0000 (09:15 -0700)]
doc: fixing typos

8 years agoAuto merge of #28922 - panicbit:trpl-missing-docs, r=steveklabnik
bors [Sat, 10 Oct 2015 14:51:42 +0000 (14:51 +0000)]
Auto merge of #28922 - panicbit:trpl-missing-docs, r=steveklabnik

8 years agoAuto merge of #28938 - GlenDC:master, r=Manishearth
bors [Sat, 10 Oct 2015 12:02:24 +0000 (12:02 +0000)]
Auto merge of #28938 - GlenDC:master, r=Manishearth

Here is my attempt to resolve issue #28822, @Manishearth.
Please let me know if it's fine. And if not, what should I do instead?

This issue felt like quite a good start for some rust contributions. It allows me to get used to the workflow  and codebase of rust in an easy-to-swallow manner. Are there any other issues you would recommend me to look at? :) Would love to do some more stuff!

8 years agoWhitelisting PatWild for E0022. Fix #28822
glendc [Sat, 10 Oct 2015 00:01:42 +0000 (00:01 +0000)]
Whitelisting PatWild for E0022. Fix #28822

8 years agoAuto merge of #28930 - steveklabnik:update_pr, r=steveklabnik
bors [Sat, 10 Oct 2015 07:56:49 +0000 (07:56 +0000)]
Auto merge of #28930 - steveklabnik:update_pr, r=steveklabnik

https://github.com/rust-lang/rust/pull/27813#issuecomment-146842041

8 years agoAuto merge of #28920 - dotdash:const_align, r=eddyb
bors [Sat, 10 Oct 2015 06:07:40 +0000 (06:07 +0000)]
Auto merge of #28920 - dotdash:const_align, r=eddyb

For enum variants, the default alignment for a specific variant might be
lower than the alignment of the enum type itself. In such cases we, for
example, generate memcpy calls with an alignment that's higher than the
alignment of the constant we copy from.

To avoid that, we need to explicitly set the required alignment on
constants.

Fixes #28912.

8 years agoAuto merge of #28928 - ykomatsu:trpl, r=Manishearth
bors [Sat, 10 Oct 2015 04:15:33 +0000 (04:15 +0000)]
Auto merge of #28928 - ykomatsu:trpl, r=Manishearth

8 years agoRun rustfmt on librand/distributions/normal.rs
Joseph Caudle [Sat, 10 Oct 2015 04:01:57 +0000 (00:01 -0400)]
Run rustfmt on librand/distributions/normal.rs

8 years agoAuto merge of #28932 - barosl:empty-comment, r=alexcrichton
bors [Sat, 10 Oct 2015 02:29:37 +0000 (02:29 +0000)]
Auto merge of #28932 - barosl:empty-comment, r=alexcrichton

Previously, `/**/` was incorrectly regarded as a doc comment because it starts with `/**` and ends with `*/`. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to `is_block_doc_comment` that tests the length of the input.

Fixes #28844.

8 years agoAuto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1
bors [Sat, 10 Oct 2015 00:39:29 +0000 (00:39 +0000)]
Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1

implement RFC 1238: nonparametric dropck.

cc #28498

cc @nikomatsakis

8 years agoSet proper alignment on constants
Björn Steinbrink [Thu, 8 Oct 2015 23:26:21 +0000 (01:26 +0200)]
Set proper alignment on constants

For enum variants, the default alignment for a specific variant might be
lower than the alignment of the enum type itself. In such cases we, for
example, generate memcpy calls with an alignment that's higher than the
alignment of the constant we copy from.

To avoid that, we need to explicitly set the required alignment on
constants.

Fixes #28912.

8 years agoAuto merge of #28049 - steveklabnik:doc_write, r=alexcrichton
bors [Fri, 9 Oct 2015 22:15:24 +0000 (22:15 +0000)]
Auto merge of #28049 - steveklabnik:doc_write, r=alexcrichton

8 years agoUse a proper C string for the gdb script section name
Björn Steinbrink [Fri, 9 Oct 2015 20:20:56 +0000 (22:20 +0200)]
Use a proper C string for the gdb script section name

8 years agoPrevent `/**/` from being parsed as a doc comment
Barosl Lee [Wed, 7 Oct 2015 22:25:59 +0000 (07:25 +0900)]
Prevent `/**/` from being parsed as a doc comment

Previously, `/**/` was incorrectly regarded as a doc comment because it
starts with `/**` and ends with `*/`. However, this caused an ICE
because some code assumed that the length of a doc comment is at least
5. This commit adds an additional check to `is_block_doc_comment` that
tests the length of the input.

Fixes #28844.

8 years agoAuto merge of #28926 - DanielKeep:syntax-index, r=steveklabnik
bors [Fri, 9 Oct 2015 19:28:43 +0000 (19:28 +0000)]
Auto merge of #28926 - DanielKeep:syntax-index, r=steveklabnik

The intent with this chapter is to have a central place where users can
go to find out what a random bit of syntax means, be it a keyword,
symbol, or some unusual bit of composite syntax (like `for <...>`).  This
should be useful both for new users (who may not know what to call this
weird `'blah` thing), and for experienced users (who may just wish to
link someone to the appropriate section on `Trait + Trait` bounds).

Where possible, entries have been linked to an appropriate section of
the book which explains the syntax.  This was not possible in all cases.
If an entry is missing links, that's because I was unable to *find*
anything appropriate to link to.

This commit should include all stable keywords, operators and symbols,
as well as a selection of potentially confusing or unusual syntax.

8 years agoImprove docs for write!/writeln! macros
Steve Klabnik [Thu, 27 Aug 2015 18:24:53 +0000 (14:24 -0400)]
Improve docs for write!/writeln! macros

8 years agoAuto merge of #28929 - pnkfelix:expand-legal-cycles-test, r=alexcrichton
bors [Fri, 9 Oct 2015 17:07:48 +0000 (17:07 +0000)]
Auto merge of #28929 - pnkfelix:expand-legal-cycles-test, r=alexcrichton

Major revision to the dropck_legal_cycles test.

1. Added big comment block explaining the test framework.

2. Added tests exericising Rc and Arc. This was inspired by a comment
   from eefriedman on PR #28861.

3. Made the cycle-detection not issue false-positives on acyclic dags.

   Doing this efficiently required revising the framework; instead of
   visiting all children (i.e. doing a traversal), now each test is
   responsible for supplying the path that will act as a witness to
   the cycle.

   Luckily for me, all of the pre-existing tests worked with a trivial
   path built from "always tke your first left", but new tests I added
   did require other input paths (i.e., "first turn right, then left".

   (The path representation is a bit-string and its branches are
    n-ary, not word phrases and binary branches as you might think
    from the outline above.)

cc PR #27185

8 years agoreview comment: further refinement of comment above `fn is_adt_dtorck`.
Felix S. Klock II [Fri, 9 Oct 2015 16:42:14 +0000 (18:42 +0200)]
review comment: further refinement of comment above `fn is_adt_dtorck`.

8 years agoAdded the param-blindness attribute to `Rc` and `Arc`.
Felix S. Klock II [Fri, 9 Oct 2015 16:03:31 +0000 (18:03 +0200)]
Added the param-blindness attribute to `Rc` and `Arc`.

This was proven necessary after I added `Rc` and `Arc` to the rpass
test `dropck_legal_cycles.rs`; see PR #28929.

8 years agoSome tidying up
Jonathan Hansford [Tue, 18 Aug 2015 19:37:27 +0000 (20:37 +0100)]
Some tidying up

Improving the use of 2nd and 3rd person
Adding a few contractions to make the text less formal
Tidying up some notes
Providing a little bit more clarification for Windows users

8 years ago2nd to 3rd person
Jonathan Hansford [Thu, 13 Aug 2015 17:22:16 +0000 (18:22 +0100)]
2nd to 3rd person

Replacing all references to the 2nd person with references to the 3rd
person (excluding `authors = [ "Your name <you@example.com>" ]` and
`file:///home/yourname/projects/hello_world` in `hello-cargo.md`)

8 years agoMajor revision to the dropck_legal_cycles test.
Felix S. Klock II [Fri, 9 Oct 2015 16:02:37 +0000 (18:02 +0200)]
Major revision to the dropck_legal_cycles test.

1. Added big comment block explaining the test framework.

2. Added tests exericising Rc and Arc. This was inspired by a comment
   from eefriedman on PR #28861.

3. Made the cycle-detection not issue false-positives on acyclic dags.

   Doing this efficiently required revising the framework; instead of
   visiting all children (i.e. doing a traversal), now each test is
   responsible for supplying the path that will act as a witness to
   the cycle.

   Luckily for me, all of the pre-existing tests worked with a trivial
   path built from "always tke your first left", but new tests I added
   did require other input paths (i.e., "first turn right, then left".

   (The path representation is a bit-string and its branches are
    n-ary, not word phrases and binary branches as you might think
    from the outline above.)

8 years agoAuto merge of #27897 - sfackler:cursor-box-slice, r=alexcrichton
bors [Fri, 9 Oct 2015 13:07:07 +0000 (13:07 +0000)]
Auto merge of #27897 - sfackler:cursor-box-slice, r=alexcrichton

8 years agoImplement Read, BufRead, Write and Seek for Cursor<Box<[u8]>>
Steven Fackler [Wed, 19 Aug 2015 06:02:49 +0000 (23:02 -0700)]
Implement Read, BufRead, Write and Seek for Cursor<Box<[u8]>>

8 years agoFix GitHub
Yoshito Komatsu [Fri, 9 Oct 2015 13:03:02 +0000 (22:03 +0900)]
Fix GitHub

8 years agotrpl: mention doc(hidden)
panicbit [Fri, 9 Oct 2015 12:08:32 +0000 (14:08 +0200)]
trpl: mention doc(hidden)

8 years agoreview comment: point out that the dropck analysis is now trivial.
Felix S. Klock II [Fri, 9 Oct 2015 12:08:06 +0000 (14:08 +0200)]
review comment: point out that the dropck analysis is now trivial.

8 years agoCorrections to syntax index.
Daniel Keep [Fri, 9 Oct 2015 12:06:20 +0000 (23:06 +1100)]
Corrections to syntax index.

* removed reference to struct fields from `mut` description.
* changed `..` pattern example to not be syntactically bogus.
* changed `@` pattern example for similar reasons.

(Thanks petrochenkov)

8 years agotrpl: missing documentation wording
panicbit [Fri, 9 Oct 2015 12:04:45 +0000 (14:04 +0200)]
trpl: missing documentation wording

8 years agorevise cfail test, removing ugeh attribute that was erroneously cut-and-pasted into it.
Felix S. Klock II [Fri, 9 Oct 2015 11:30:08 +0000 (13:30 +0200)]
revise cfail test, removing ugeh attribute that was erroneously cut-and-pasted into it.

8 years agoExpanded entries for generics.
Daniel Keep [Fri, 9 Oct 2015 11:19:56 +0000 (22:19 +1100)]
Expanded entries for generics.

* Now mentions method generics.
* Has separate entries for generic `fn`, `struct`, `enum`, and `impl`
  items.

(Thanks killercup).

8 years agoAuto merge of #28857 - nrc:lowering, r=nikomatsakis
bors [Fri, 9 Oct 2015 08:53:45 +0000 (08:53 +0000)]
Auto merge of #28857 - nrc:lowering, r=nikomatsakis

r? @nikomatsakis

8 years agoIntroduces a "Syntax Index" chapter to TRPL.
Daniel Keep [Fri, 9 Oct 2015 08:47:16 +0000 (19:47 +1100)]
Introduces a "Syntax Index" chapter to TRPL.

The intent with this chapter is to have a central place where users can
go to find out what a random bit of syntax means, be it a keyword,
symbol, or some unusual bit of composite syntax (like `for <...>`).  This
should be useful both for new users (who may not know what to call this
weird `'blah` thing), and for experienced users (who may just wish to
link someone to the appropriate section on `Trait + Trait` bounds).

Where possible, entries have been linked to an appropriate section of
the book which explains the syntax.  This was not possible in all cases.
If an entry is missing links, that's because I was unable to *find*
anything appropriate to link to.

This commit should include all stable keywords, operators and symbols,
as well as a selection of potentially confusing or unusual syntax.

8 years agoreview comments
Nick Cameron [Tue, 6 Oct 2015 19:26:22 +0000 (08:26 +1300)]
review comments

8 years agoAuto merge of #28869 - alexcrichton:allocator-dox, r=steveklabnik
bors [Fri, 9 Oct 2015 06:29:30 +0000 (06:29 +0000)]
Auto merge of #28869 - alexcrichton:allocator-dox, r=steveklabnik

This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.

8 years agoAuto merge of #28817 - dcarral:installing_rust_v130, r=brson
bors [Fri, 9 Oct 2015 04:43:31 +0000 (04:43 +0000)]
Auto merge of #28817 - dcarral:installing_rust_v130, r=brson

Update "Installing Rust" section @ TRPL so it references the last stable version, v1.3.0.

8 years agoAuto merge of #28919 - huonw:placement-tracking-issue, r=alexcrichton
bors [Fri, 9 Oct 2015 02:57:38 +0000 (02:57 +0000)]
Auto merge of #28919 - huonw:placement-tracking-issue, r=alexcrichton

cc #28244

8 years agoAuto merge of #28888 - arielb1:variant-ctor, r=eddyb
bors [Fri, 9 Oct 2015 01:11:45 +0000 (01:11 +0000)]
Auto merge of #28888 - arielb1:variant-ctor, r=eddyb

this makes the code cleaner, and is a complement to the cleanup on the
HIR side.

r? @eddyb

8 years agotrpl: mention missing_docs lint
panicbit [Fri, 9 Oct 2015 01:00:43 +0000 (03:00 +0200)]
trpl: mention missing_docs lint

8 years agoPoint `placement_in_syntax`/`box_syntax` lang features at tracking issue #27779.
Huon Wilson [Thu, 8 Oct 2015 22:13:40 +0000 (09:13 +1100)]
Point `placement_in_syntax`/`box_syntax` lang features at tracking issue #27779.

cc #28244.

8 years agorustfmt'ing
Nick Cameron [Tue, 6 Oct 2015 03:03:56 +0000 (16:03 +1300)]
rustfmt'ing

8 years agoMisc fixups
Nick Cameron [Tue, 6 Oct 2015 02:31:43 +0000 (15:31 +1300)]
Misc fixups

8 years agoAdd a comment
Nick Cameron [Wed, 30 Sep 2015 05:23:52 +0000 (18:23 +1300)]
Add a comment

8 years agoSome cleanup of no longer used AST things
Nick Cameron [Wed, 30 Sep 2015 04:18:09 +0000 (17:18 +1300)]
Some cleanup of no longer used AST things

8 years agoCache ids between lowering runs
Nick Cameron [Wed, 30 Sep 2015 03:17:37 +0000 (16:17 +1300)]
Cache ids between lowering runs

So that lowering is reproducible

8 years agoMake save-analysis work for `if let` etc.
Nick Cameron [Wed, 30 Sep 2015 01:56:19 +0000 (14:56 +1300)]
Make save-analysis work for `if let` etc.

8 years agohygiene for `for` loops, `if let`, `while let`
Nick Cameron [Tue, 29 Sep 2015 23:19:45 +0000 (12:19 +1300)]
hygiene for `for` loops, `if let`, `while let`

and some unrelated test cleanups

8 years agoFix stability
Nick Cameron [Tue, 29 Sep 2015 00:46:01 +0000 (13:46 +1300)]
Fix stability

8 years agoFixes to rustdoc, etc.
Nick Cameron [Tue, 29 Sep 2015 00:18:05 +0000 (13:18 +1300)]
Fixes to rustdoc, etc.

8 years agoMove placement in desugaring to lowering
Nick Cameron [Tue, 29 Sep 2015 00:17:46 +0000 (13:17 +1300)]
Move placement in desugaring to lowering

8 years agoif let and while let
Nick Cameron [Mon, 28 Sep 2015 04:24:42 +0000 (17:24 +1300)]
if let and while let

8 years agoFor loops in save-analysis
Nick Cameron [Mon, 28 Sep 2015 03:24:08 +0000 (16:24 +1300)]
For loops in save-analysis

8 years agoMove `for` loop desugaring to lowering
Nick Cameron [Mon, 28 Sep 2015 02:00:15 +0000 (15:00 +1300)]
Move `for` loop desugaring to lowering

8 years agoAdd a lowering context
Nick Cameron [Fri, 25 Sep 2015 04:03:28 +0000 (16:03 +1200)]
Add a lowering context

8 years agoAuto merge of #28900 - cristicbz:typos, r=alexcrichton
bors [Thu, 8 Oct 2015 22:40:50 +0000 (22:40 +0000)]
Auto merge of #28900 - cristicbz:typos, r=alexcrichton

I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review.

Anyway, to find most of these I used:

  * `ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'` for repeated words

  * `ag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'` to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes.

  * `cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag`. Hacky way to find misspellings, but it works ok. I got `typos.txt` from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines)

* `ag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'` to find places where 'a' was followed by a vowel (requiring 'an' instead).

I also used a handful more one off regexes that are too boring to reproduce here.

8 years agoplacate check-pretty via comment rearrangement.
Felix S. Klock II [Thu, 8 Oct 2015 21:02:42 +0000 (23:02 +0200)]
placate check-pretty via comment rearrangement.

8 years agoAuto merge of #27197 - nwin:generic-cursor-impl, r=alexcrichton
bors [Thu, 8 Oct 2015 20:53:23 +0000 (20:53 +0000)]
Auto merge of #27197 - nwin:generic-cursor-impl, r=alexcrichton

This is a revival of #23364. Github didn’t recognize my updated branch there.

The cursor implementation now uses `AsRef` which means that fixed-sized array can now be used with `Cursor`. Besides that, the generic implementation simplifies the code as the macro can be avoided.

The only drawback is, that specialized implementation for fixed-sized arrays are now ruled out unless [RFC#1210](https://github.com/rust-lang/rfcs/pull/1210) is accepted & implemented.

`Box<[u8]>` cannot be used yet, but that should be mitigated by [implementing `AsRef` for `Box` and friends](https://internals.rust-lang.org/t/forward-implement-traits-on-smart-pointers-make-smart-pointers-more-transparent/2380/3). I will submit a separate PR for that later as it is an orthogonal issue.

8 years agobook: Add documentation on custom allocators
Alex Crichton [Tue, 6 Oct 2015 17:59:18 +0000 (10:59 -0700)]
book: Add documentation on custom allocators

This adds a chapter to the nightly section of the book on leveraging and
implementing the `#![allocator]` attribute to write custom allocators as well as
explaining the current situation with allocators.

8 years agoAuto merge of #28913 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 8 Oct 2015 19:05:54 +0000 (19:05 +0000)]
Auto merge of #28913 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #28621, #28872, #28893, #28904, #28905, #28908, #28910
- Failed merges: #28906

8 years agotypos: fix a grabbag of typos all over the place
Cristi Cobzarenco [Wed, 7 Oct 2015 22:11:25 +0000 (23:11 +0100)]
typos: fix a grabbag of typos all over the place

8 years agoRollup merge of #28910 - frewsxcv:patch-26, r=steveklabnik
Steve Klabnik [Thu, 8 Oct 2015 17:54:05 +0000 (13:54 -0400)]
Rollup merge of #28910 - frewsxcv:patch-26, r=steveklabnik

8 years agoRollup merge of #28908 - GuillaumeGomez:patch-2, r=Manishearth
Steve Klabnik [Thu, 8 Oct 2015 17:54:05 +0000 (13:54 -0400)]
Rollup merge of #28908 - GuillaumeGomez:patch-2, r=Manishearth

r? @Manishearth

8 years agoRollup merge of #28905 - tshepang:typo, r=steveklabnik
Steve Klabnik [Thu, 8 Oct 2015 17:54:04 +0000 (13:54 -0400)]
Rollup merge of #28905 - tshepang:typo, r=steveklabnik

8 years agoRollup merge of #28904 - panicbit:trpl-derive, r=steveklabnik
Steve Klabnik [Thu, 8 Oct 2015 17:54:04 +0000 (13:54 -0400)]
Rollup merge of #28904 - panicbit:trpl-derive, r=steveklabnik

8 years agoRollup merge of #28893 - steveklabnik:gh28687, r=nikomatsakis
Steve Klabnik [Thu, 8 Oct 2015 17:54:03 +0000 (13:54 -0400)]
Rollup merge of #28893 - steveklabnik:gh28687, r=nikomatsakis

Fixes #28687

8 years agoRollup merge of #28872 - iwillspeak:master, r=Manishearth
Steve Klabnik [Thu, 8 Oct 2015 17:54:03 +0000 (13:54 -0400)]
Rollup merge of #28872 - iwillspeak:master, r=Manishearth

Currently the explain command line flag requires full error codes, complete with
the leading zeros and the E at the beginning. This commit changes that,
if you don't supply a full error code then the error number is padded
out to the required size and the E is added to the beginning.

This means that where previously you would need to write E0001, you can
now write 0001, 001, 01 or just 1 to refer to the same error.

8 years agoFix typo in E0101
Guillaume Gomez [Thu, 8 Oct 2015 09:32:38 +0000 (11:32 +0200)]
Fix typo in E0101

8 years agoAuto merge of #28826 - arthurprs:leading_plus, r=alexcrichton
bors [Thu, 8 Oct 2015 17:19:59 +0000 (17:19 +0000)]
Auto merge of #28826 - arthurprs:leading_plus, r=alexcrichton

Closes #27580

8 years agoAuto merge of #28621 - tshepang:move-safety, r=steveklabnik
bors [Thu, 8 Oct 2015 14:04:41 +0000 (14:04 +0000)]
Auto merge of #28621 - tshepang:move-safety, r=steveklabnik

8 years agoDocument the new more conservative dropck rule and the escape hatch.
Felix S. Klock II [Thu, 8 Oct 2015 13:29:09 +0000 (15:29 +0200)]
Document the new more conservative dropck rule and the escape hatch.

8 years agoAdded tests illustrating when and when not to use the UGEH attribute w.r.t. types...
Felix S. Klock II [Thu, 8 Oct 2015 12:32:36 +0000 (14:32 +0200)]
Added tests illustrating when and when not to use the UGEH attribute w.r.t. types in negative position.

8 years agoAdded tests illustrating when and when not to use the UGEH attribute w.r.t. a lifetim...
Felix S. Klock II [Thu, 8 Oct 2015 12:19:37 +0000 (14:19 +0200)]
Added tests illustrating when and when not to use the UGEH attribute w.r.t. a lifetime param.

8 years agoAdded tests illustrating when and when not to use the UGEH attribute w.r.t. a trait...
Felix S. Klock II [Thu, 8 Oct 2015 12:12:26 +0000 (14:12 +0200)]
Added tests illustrating when and when not to use the UGEH attribute w.r.t. a trait bound.

8 years agoreview comment: reduce the `is_adt_dtorck` method to just a check for the attribute.
Felix S. Klock II [Wed, 7 Oct 2015 11:17:12 +0000 (13:17 +0200)]
review comment: reduce the `is_adt_dtorck` method to just a check for the attribute.

8 years agoAuto merge of #28897 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 8 Oct 2015 12:15:47 +0000 (12:15 +0000)]
Auto merge of #28897 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #28836, #28856, #28874, #28876, #28878, #28880, #28882, #28885, #28889, #28896
- Failed merges:

8 years agoFormat code-like text in Iterator::cloned doc-comment
Corey Farwell [Thu, 8 Oct 2015 12:00:02 +0000 (08:00 -0400)]
Format code-like text in Iterator::cloned doc-comment

8 years agoAuto merge of #28891 - cristicbz:new-nbody, r=alexcrichton
bors [Thu, 8 Oct 2015 10:04:12 +0000 (10:04 +0000)]
Auto merge of #28891 - cristicbz:new-nbody, r=alexcrichton

This new version takes inspiration from the C implementation of the benchmark, but instead of explicitly using SIMD operations which can't be done on stable, it instead arranges everything the same way and leaves the actual vectorization up to LLVM.

In addition to the ~20% speed gains (see below), this PR also adds some general niceties which showcase the language a little bit: a `Vec3` type to cut down on `(x, y, z)` repetition,  using `while let` instead of `loop-if-break`, iterator adapters instead of for loops etc.

Here are the times in seconds of 10 runs each on my workstation:

```
before: 6.254, 6.260, 6.263, 6.264, 6.265, 6.267, 6.334, 6.341, 6.441, 6.509
before-min: 6.254
before-median: 6.266
before-max: 6.509

after: 4.823, 4.824, 4.826, 4.827, 4.837, 4.839, 4.881, 4.959, 4.990, 5.377
after-min: 4.823
after-median: 4.838
after-max: 5.377

gcc: 4.674, 4.676, 4.680, 4.682, 4.695, 4.696, 4.701, 4.708, 4.794, 5.297
gcc-min: 4.674
gcc-median: 4.696
gcc-max: 5.297
```

On my i7 laptop the speed up is less impressive, from ~5.4s to ~4.7s, but still significant. On my Vultr VPS the numbers look closer to the workstation results. Surprisingly my laptop beats both office workstation and VPS...

8 years agoAuto merge of #28892 - cristicbz:default-wrapping, r=alexcrichton
bors [Thu, 8 Oct 2015 07:39:06 +0000 (07:39 +0000)]
Auto merge of #28892 - cristicbz:default-wrapping, r=alexcrichton

It's not very common to store `Wrapping` values, but I kept wrapping and unwrapping a hash value when I taking it out of a struct to do operations on it. I couldn't store the hash as `Wrapping<u64>` because I wanted to be able to `#[derive(Default)]` for the struct.

At any rate, it feels to me that `Wrapping<T>` should implement pretty much everything `T` does. I left out `#[derive(Hash)]` since I'd be hard pressed to find a use case and wanted to avoid the extra generated code, but maybe I should add that too?

8 years agoreference: fix typos
Tshepang Lekhonkhobe [Thu, 8 Oct 2015 05:24:00 +0000 (07:24 +0200)]
reference: fix typos

8 years agotrpl: link to derivable trait's docs
panicbit [Thu, 8 Oct 2015 05:27:26 +0000 (07:27 +0200)]
trpl: link to derivable trait's docs

8 years agotrpl: mention deriving in traits section
panicbit [Thu, 8 Oct 2015 05:10:56 +0000 (07:10 +0200)]
trpl: mention deriving in traits section