]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #28312 - GuillaumeGomez:privacy, r=Manishearth
bors [Fri, 11 Sep 2015 04:23:40 +0000 (04:23 +0000)]
Auto merge of #28312 - GuillaumeGomez:privacy, r=Manishearth

r? @Manishearth

8 years agoAuto merge of #28337 - apasel422:tests, r=alexcrichton
bors [Fri, 11 Sep 2015 01:18:19 +0000 (01:18 +0000)]
Auto merge of #28337 - apasel422:tests, r=alexcrichton

Closes #17994.

8 years agoAuto merge of #28331 - semarie:openbsd-configure-egcc, r=alexcrichton
bors [Thu, 10 Sep 2015 23:33:31 +0000 (23:33 +0000)]
Auto merge of #28331 - semarie:openbsd-configure-egcc, r=alexcrichton

under OpenBSD, it could be have present multiples versions of gcc compiler:
  - gcc-4.2 (with patchs) : c/c++ compiler present in `/usr/bin`. It is unusable to build recent LLVM (so rustc too).
  - gcc/g++ -4.9 : c/c++ compiler, installed as third-party with "ports" mechanism. The compiler is installed in `/usr/local` as `egcc` (and `eg++`).

this PR adds probing for `egcc` for `CFG_GCC`, if the first probed `gcc` is too old. It will set `CC` and `CXX` too, in order to pass the variables to LLVM configure if builded.

please note this PR is a first step in order to build rustc under OpenBSD with unpatched tree.

r? @alexcrichton

cc @brson @dhuseby

8 years agoAuto merge of #28321 - nikomatsakis:issue-27616, r=pnkfelix
bors [Thu, 10 Sep 2015 21:48:29 +0000 (21:48 +0000)]
Auto merge of #28321 - nikomatsakis:issue-27616, r=pnkfelix

Fixes #27616.

r? @pnkfelix

8 years agoAdd test for #17994
Andrew Paseltiner [Thu, 10 Sep 2015 20:02:00 +0000 (16:02 -0400)]
Add test for #17994

Closes #17994.

8 years agoAuto merge of #28301 - christopherdumas:intergrate_error_burnstushi, r=steveklabnik
bors [Thu, 10 Sep 2015 20:03:30 +0000 (20:03 +0000)]
Auto merge of #28301 - christopherdumas:intergrate_error_burnstushi, r=steveklabnik

This was @steveklabnik's idea. Thanks @BurntSushi for the awesome blog post!
r? @steveklabnik

8 years agoAuto merge of #28318 - dongz9:master, r=eddyb
bors [Thu, 10 Sep 2015 18:18:45 +0000 (18:18 +0000)]
Auto merge of #28318 - dongz9:master, r=eddyb

Fix the following error when running configure with llvm 3.8svn:

configure: error: bad LLVM version: 3.8.0svn, need >=3.5

8 years agodisable jemalloc on OpenBSD
Sébastien Marie [Thu, 10 Sep 2015 16:50:01 +0000 (18:50 +0200)]
disable jemalloc on OpenBSD

depending of the compiler used, jemalloc configure don't detect
correctly some parameters.

8 years agoAdapted @BurtSushi's blog post for the error handling chapter, rewrite the case study.
christopherdumas [Thu, 10 Sep 2015 16:48:04 +0000 (09:48 -0700)]
Adapted @BurtSushi's blog post for the error handling chapter, rewrite the case study.

8 years agoAuto merge of #28332 - apasel422:tests, r=alexcrichton
bors [Thu, 10 Sep 2015 16:29:49 +0000 (16:29 +0000)]
Auto merge of #28332 - apasel422:tests, r=alexcrichton

Closes #22638.
Closes #22872.
Closes #23024.
Closes #23046.

8 years agoAdd tests for #22638, #22872, #23024, #23046
Andrew Paseltiner [Thu, 10 Sep 2015 15:26:19 +0000 (11:26 -0400)]
Add tests for #22638, #22872, #23024, #23046

Closes #22638.
Closes #22872.
Closes #23024.
Closes #23046.

8 years agoAuto merge of #28329 - tshepang:comfort, r=steveklabnik
bors [Thu, 10 Sep 2015 13:44:48 +0000 (13:44 +0000)]
Auto merge of #28329 - tshepang:comfort, r=steveklabnik

8 years agoAdd error code for private struct field issue
Guillaume Gomez [Wed, 9 Sep 2015 10:16:43 +0000 (12:16 +0200)]
Add error code for private struct field issue

8 years agoopenbsd: probe CFG_GCC egcc
Sébastien Marie [Thu, 10 Sep 2015 06:50:12 +0000 (08:50 +0200)]
openbsd: probe CFG_GCC egcc

if default CFG_GCC is too old, probe also egcc (which is gcc from
ports).

set CC/CXX too, in order to pass them to LLVM

8 years agoAuto merge of #28266 - jackwilsonv:patch-4, r=steveklabnik
bors [Thu, 10 Sep 2015 07:39:50 +0000 (07:39 +0000)]
Auto merge of #28266 - jackwilsonv:patch-4, r=steveklabnik

r? @steveklabnik

8 years agoAuto merge of #28282 - DiamondLovesYou:optional-data-layout, r=alexcrichton
bors [Thu, 10 Sep 2015 05:39:48 +0000 (05:39 +0000)]
Auto merge of #28282 - DiamondLovesYou:optional-data-layout, r=alexcrichton

NFC.

8 years agoreference: not comfortable seeing a paragraph starting with a lowercase letter
Tshepang Lekhonkhobe [Thu, 10 Sep 2015 04:03:32 +0000 (06:03 +0200)]
reference: not comfortable seeing a paragraph starting with a lowercase letter

8 years agoAuto merge of #28323 - tshepang:idiom, r=steveklabnik
bors [Thu, 10 Sep 2015 03:48:30 +0000 (03:48 +0000)]
Auto merge of #28323 - tshepang:idiom, r=steveklabnik

8 years agoAuto merge of #28232 - brson:tprl, r=steveklabnik
bors [Thu, 10 Sep 2015 00:37:55 +0000 (00:37 +0000)]
Auto merge of #28232 - brson:tprl, r=steveklabnik

r? @steveklabnik

The phrase 'academic research' rubs me the wrong way. I have some concern about the role of this page and think it could be expanded to more than just academic papers and cleaned up a lot.

8 years agoRefactor `TargetOptions::data_layout` into an `Option`al value to reflect current...
Richard Diamond [Mon, 7 Sep 2015 05:35:57 +0000 (00:35 -0500)]
Refactor `TargetOptions::data_layout` into an `Option`al value to reflect current usage.

NFC.

8 years agoAuto merge of #28250 - durka:patch-7, r=steveklabnik
bors [Wed, 9 Sep 2015 22:41:23 +0000 (22:41 +0000)]
Auto merge of #28250 - durka:patch-7, r=steveklabnik

I took a stab at fixing #28064. Not sure if this all-features-in-one-example approach is the right one. Also I completely made up the terms "star globbing" and "brace expansion globbing" -- they are just called "glob-like syntax" in the reference.

8 years agoreference: format code snippets in an idiomatic manner
Tshepang Lekhonkhobe [Wed, 9 Sep 2015 20:35:49 +0000 (22:35 +0200)]
reference: format code snippets in an idiomatic manner

8 years agoTreat loans of 'static data as extending to the end of the enclosing
Niko Matsakis [Wed, 9 Sep 2015 20:04:55 +0000 (16:04 -0400)]
Treat loans of 'static data as extending to the end of the enclosing
fn. Fixes #27616.

8 years agoAuto merge of #28299 - apasel422:tests, r=alexcrichton
bors [Wed, 9 Sep 2015 18:40:55 +0000 (18:40 +0000)]
Auto merge of #28299 - apasel422:tests, r=alexcrichton

Closes #17001
Closes #21449
Closes #22992
Closes #23208
Closes #23442

8 years agoAuto merge of #28313 - rutsky:patch-4, r=alexcrichton
bors [Wed, 9 Sep 2015 16:44:43 +0000 (16:44 +0000)]
Auto merge of #28313 - rutsky:patch-4, r=alexcrichton

Follow-up fix for PR #28283.

8 years agoFix clang too
Dong Zhou [Wed, 9 Sep 2015 15:45:59 +0000 (11:45 -0400)]
Fix clang too

8 years agoFix configure for LLVM 3.8
Dong Zhou [Wed, 9 Sep 2015 15:32:05 +0000 (11:32 -0400)]
Fix configure for LLVM 3.8

8 years agoAuto merge of #28316 - Manishearth:rollup, r=Manishearth
bors [Wed, 9 Sep 2015 14:42:00 +0000 (14:42 +0000)]
Auto merge of #28316 - Manishearth:rollup, r=Manishearth

- Successful merges: #28281, #28283, #28289, #28294, #28295, #28305
- Failed merges:

8 years agoRollup merge of #28305 - apasel422:copyright, r=alexcrichton
Manish Goregaokar [Wed, 9 Sep 2015 13:06:12 +0000 (18:36 +0530)]
Rollup merge of #28305 - apasel422:copyright, r=alexcrichton

8 years agoRollup merge of #28295 - steveklabnik:language_fix, r=alexcrichton
Manish Goregaokar [Wed, 9 Sep 2015 13:06:11 +0000 (18:36 +0530)]
Rollup merge of #28295 - steveklabnik:language_fix, r=alexcrichton

Thanks Eric, reported via email

8 years agoRollup merge of #28294 - midinastasurazz:patch-3, r=steveklabnik
Manish Goregaokar [Wed, 9 Sep 2015 13:06:11 +0000 (18:36 +0530)]
Rollup merge of #28294 - midinastasurazz:patch-3, r=steveklabnik

The link address is defined below the paragraph so no need to have it inline.

8 years agoRollup merge of #28289 - shepmaster:include_bytes-docs, r=alexcrichton
Manish Goregaokar [Wed, 9 Sep 2015 13:06:11 +0000 (18:36 +0530)]
Rollup merge of #28289 - shepmaster:include_bytes-docs, r=alexcrichton

This can be shown with the example code

```rust
fn main() {
    let () = include_bytes!("/etc/hosts");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`

8 years agoRollup merge of #28283 - rutsky:patch-3, r=steveklabnik
Manish Goregaokar [Wed, 9 Sep 2015 13:06:11 +0000 (18:36 +0530)]
Rollup merge of #28283 - rutsky:patch-3, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #28281 - rutsky:patch-2, r=steveklabnik
Manish Goregaokar [Wed, 9 Sep 2015 13:06:10 +0000 (18:36 +0530)]
Rollup merge of #28281 - rutsky:patch-2, r=steveklabnik

r? @steveklabnik

8 years agoAuto merge of #28300 - Manishearth:crate_err, r=eddyb
bors [Wed, 9 Sep 2015 10:54:05 +0000 (10:54 +0000)]
Auto merge of #28300 - Manishearth:crate_err, r=eddyb

Partially fixes #22750

I'll write a test for this when I figure out how to.

r? @eddyb

cc @steveklabnik

8 years agoAdd error code for tuple struct constructor error
Guillaume Gomez [Wed, 9 Sep 2015 10:08:21 +0000 (12:08 +0200)]
Add error code for tuple struct constructor error

8 years agoAdd error code for unnecessary visibility qualifier
Guillaume Gomez [Wed, 9 Sep 2015 09:58:27 +0000 (11:58 +0200)]
Add error code for unnecessary visibility qualifier

8 years agofix capitalization inside sentense
Vladimir Rutsky [Wed, 9 Sep 2015 09:54:31 +0000 (12:54 +0300)]
fix capitalization inside sentense

8 years agoAdd error code for enum item visibility error
Guillaume Gomez [Wed, 9 Sep 2015 09:47:00 +0000 (11:47 +0200)]
Add error code for enum item visibility error

8 years agoAdd new error code for visibility inside a function
Guillaume Gomez [Wed, 9 Sep 2015 09:15:33 +0000 (11:15 +0200)]
Add new error code for visibility inside a function

8 years agoAdd error code for privacy error on exported signature
Guillaume Gomez [Wed, 9 Sep 2015 09:08:35 +0000 (11:08 +0200)]
Add error code for privacy error on exported signature

8 years agoAdd new error code for trait privacy error
Guillaume Gomez [Wed, 9 Sep 2015 09:02:52 +0000 (11:02 +0200)]
Add new error code for trait privacy error

8 years agoAuto merge of #28297 - lifthrasiir:rustdoc-html-tweaks, r=alexcrichton
bors [Wed, 9 Sep 2015 08:00:10 +0000 (08:00 +0000)]
Auto merge of #28297 - lifthrasiir:rustdoc-html-tweaks, r=alexcrichton

I have tested the result with w3m and I believe this is better than the current template. In detail:

- `section.sidebar` -> `nav.sidebar`, also added an unordered list.
- `div#help` -> `aside#help`, also added a hidden heading.
- The current crate is now emphasized in the sidebar.

Fixes #16310.

8 years agoAuto merge of #28277 - DiamondLovesYou:intrinsic-unnamed-addr, r=huonw
bors [Wed, 9 Sep 2015 03:46:32 +0000 (03:46 +0000)]
Auto merge of #28277 - DiamondLovesYou:intrinsic-unnamed-addr, r=huonw

Intrinsics never have an address, so it doesn't make sense to say that their
address is unnamed.

8 years agoAuto merge of #28198 - alexcrichton:from-raw-mut, r=aturon
bors [Wed, 9 Sep 2015 01:16:54 +0000 (01:16 +0000)]
Auto merge of #28198 - alexcrichton:from-raw-mut, r=aturon

Conventionally in C `*mut T` is a transfer of ownership where `*const T` is a
loan, so `*mut T` is likely the more appropriate return type for these
functions. Additionally, this more closely mirrors the APIs on `Box` for this
sort of functionality.

cc #27769

8 years agoRemove references to removed Valgrind headers
Andrew Paseltiner [Tue, 8 Sep 2015 23:01:26 +0000 (19:01 -0400)]
Remove references to removed Valgrind headers

8 years agoAuto merge of #28264 - mneumann:dragonfly_backend_fixes2, r=alexcrichton
bors [Tue, 8 Sep 2015 22:22:36 +0000 (22:22 +0000)]
Auto merge of #28264 - mneumann:dragonfly_backend_fixes2, r=alexcrichton

Having -L/usr/local/lib in the linking path by default interferes
with an already installed version of Rust during building of Rust.

8 years agoAdd tests for #17001, #21449, #22992, #23208, #23442
Andrew Paseltiner [Tue, 8 Sep 2015 18:19:08 +0000 (14:19 -0400)]
Add tests for #17001, #21449, #22992, #23208, #23442

Closes #17001
Closes #21449
Closes #22992
Closes #23208
Closes #23442

8 years agoAuto merge of #28241 - dhuseby:adding_openbsd_snapshot, r=alexcrichton
bors [Tue, 8 Sep 2015 20:34:50 +0000 (20:34 +0000)]
Auto merge of #28241 - dhuseby:adding_openbsd_snapshot, r=alexcrichton

@alexcrichton please upload this snapshot when landing:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2015-08-11-1af31d4-openbsd-x86_64-9cae790c4ca19b1b29a048605ce249fe1c20a498.tar.bz2

BTW, this is the snapshot that @semarie has published on his website for use in the OpenBSD port for rust.  Credit goes to him.

8 years agoPrint correct crate name
Manish Goregaokar [Tue, 8 Sep 2015 19:52:03 +0000 (01:22 +0530)]
Print correct crate name

8 years agoAdd test
Manish Goregaokar [Tue, 8 Sep 2015 19:04:55 +0000 (00:34 +0530)]
Add test

8 years agoFix fixme, add crate check
Manish Goregaokar [Tue, 8 Sep 2015 18:27:24 +0000 (23:57 +0530)]
Fix fixme, add crate check

8 years agoUse 'a different' for trait object mismatches too
Manish Goregaokar [Tue, 8 Sep 2015 18:20:48 +0000 (23:50 +0530)]
Use 'a different' for trait object mismatches too

8 years agoHandle trait objects
Manish Goregaokar [Tue, 8 Sep 2015 16:51:20 +0000 (22:21 +0530)]
Handle trait objects

8 years agoAuto merge of #28173 - alexcrichton:llvm-37, r=brson
bors [Tue, 8 Sep 2015 17:47:23 +0000 (17:47 +0000)]
Auto merge of #28173 - alexcrichton:llvm-37, r=brson

This updates the jemalloc and LLVM submodules to the recently released 4.0.0 and 3.7 versions. There's no breakage on the LLVM side of things because we had already been tracking the 3.7 release branch for awhile and no breakage was introduced, and jemalloc apparently is stable enough that nothing broke!

8 years agoAuto merge of #28292 - kud1ing:patch-1, r=steveklabnik
bors [Tue, 8 Sep 2015 15:55:28 +0000 (15:55 +0000)]
Auto merge of #28292 - kud1ing:patch-1, r=steveklabnik

The dates are taken from

  * https://www.rust-lang.org/install.html
  * http://blog.rust-lang.org/2015/06/25/Rust-1.1.html
  * http://blog.rust-lang.org/2015/05/15/Rust-1.0.html

8 years agorustdoc: Tweak the main template and CSS for semantic mark-up.
Kang Seonghoon [Tue, 8 Sep 2015 15:46:44 +0000 (00:46 +0900)]
rustdoc: Tweak the main template and CSS for semantic mark-up.

- section.sidebar -> nav.sidebar, also added an unordered list.
- div#help -> aside#help, also added a hidden heading.
- the current crate is now emphasized in the sidebar.

Fixes #16310.

8 years agoAdd note for when a type error comes from similarly named objects from two different...
Manish Goregaokar [Tue, 8 Sep 2015 14:18:56 +0000 (19:48 +0530)]
Add note for when a type error comes from similarly named objects from two different crate of the same name (#22750)

8 years agoFix small sentence about references
Steve Klabnik [Tue, 8 Sep 2015 13:33:53 +0000 (09:33 -0400)]
Fix small sentence about references

Thanks Eric, reported via email

8 years agoAuto merge of #28287 - llogiq:clippy, r=Manishearth
bors [Tue, 8 Sep 2015 13:04:22 +0000 (13:04 +0000)]
Auto merge of #28287 - llogiq:clippy, r=Manishearth

It's a large number of small improvements to the code, mostly readability-related, but removing closures and replacing `str::to_string()` with `.to_owned()` should also positively affect performance.

r? @Manishearth (once it compiles, of course :smile:)

8 years agoFix link to hygienic macros on Wikipedia
midinastasurazz [Tue, 8 Sep 2015 12:06:35 +0000 (14:06 +0200)]
Fix link to hygienic macros on Wikipedia

8 years agoReverted for-loop, it messes up type inference
llogiq [Tue, 8 Sep 2015 07:02:04 +0000 (09:02 +0200)]
Reverted for-loop, it messes up type inference

8 years agoAdd release days, fixes #28228
kud1ing [Tue, 8 Sep 2015 06:29:45 +0000 (08:29 +0200)]
Add release days, fixes #28228

8 years agoLet's see if lifetime elision works in this case
llogiq [Tue, 8 Sep 2015 06:05:59 +0000 (08:05 +0200)]
Let's see if lifetime elision works in this case

8 years agoFixed required type coercion
llogiq [Tue, 8 Sep 2015 05:41:50 +0000 (07:41 +0200)]
Fixed required type coercion

I'd have thought that the types of the slice::Split would have been inferred, but this appears not to be the case. Reverted this one change.

8 years agoAuto merge of #28291 - nrc:shr_span_fix, r=sfackler
bors [Tue, 8 Sep 2015 04:45:37 +0000 (04:45 +0000)]
Auto merge of #28291 - nrc:shr_span_fix, r=sfackler

8 years agoFix span bug with >> and type bindings
Nick Cameron [Tue, 8 Sep 2015 04:09:28 +0000 (16:09 +1200)]
Fix span bug with >> and type bindings

8 years agoAuto merge of #28246 - huonw:lang-tracking-issues, r=alexcrichton
bors [Tue, 8 Sep 2015 01:02:06 +0000 (01:02 +0000)]
Auto merge of #28246 - huonw:lang-tracking-issues, r=alexcrichton

This is similar to the libs version, which allow an `issue` field in the
`#[unstable]` attribute.

cc #28244

8 years agoAllow tracking issues for lang features.
Huon Wilson [Fri, 4 Sep 2015 23:37:22 +0000 (16:37 -0700)]
Allow tracking issues for lang features.

This is similar to the libs version, which allow an `issue` field in the
`#[unstable]` attribute.

cc #28244

8 years agoClarify that `include_bytes!` returns a reference to an array, not just a slice
Jake Goulding [Tue, 8 Sep 2015 00:01:14 +0000 (20:01 -0400)]
Clarify that `include_bytes!` returns a reference to an array, not just a slice

This can be shown with the example code

```rust
fn main() {
    let () = include_bytes!("/etc/hosts");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`

8 years agofixes/improvements thanks to @Manishearth
Andre Bogus [Mon, 7 Sep 2015 23:03:01 +0000 (01:03 +0200)]
fixes/improvements thanks to @Manishearth

8 years agosome more clippy-based improvements
Andre Bogus [Mon, 7 Sep 2015 22:36:29 +0000 (00:36 +0200)]
some more clippy-based improvements

8 years agoAuto merge of #28285 - steveklabnik:split_at_idiom, r=arielb1
bors [Mon, 7 Sep 2015 19:25:21 +0000 (19:25 +0000)]
Auto merge of #28285 - steveklabnik:split_at_idiom, r=arielb1

Generally, including everything that makes an unsafe block safe in the
block is good style. Since the assert! is what makes this safe, it
should go inside the block. I also added a few bits of whitespace.

This is of course, a little style thing, so no worries if we don't want this patch.

8 years agoUse unsafe more idiomatically
Steve Klabnik [Mon, 7 Sep 2015 14:16:57 +0000 (10:16 -0400)]
Use unsafe more idiomatically

Generally, including everything that makes an unsafe block safe in the
block is good style. Since the assert! is what makes this safe, it
should go inside the block. I also added a few bits of whitespace.

8 years agoAuto merge of #28278 - pfpacket:typo, r=steveklabnik
bors [Mon, 7 Sep 2015 13:59:08 +0000 (13:59 +0000)]
Auto merge of #28278 - pfpacket:typo, r=steveklabnik

8 years agofix punctuation in list (again)
Vladimir Rutsky [Mon, 7 Sep 2015 08:03:53 +0000 (11:03 +0300)]
fix punctuation in list (again)

8 years agofix capitalization inside sentense
Vladimir Rutsky [Mon, 7 Sep 2015 08:01:01 +0000 (11:01 +0300)]
fix capitalization inside sentense

8 years agofix punctuation in list
Vladimir Rutsky [Mon, 7 Sep 2015 06:41:02 +0000 (09:41 +0300)]
fix punctuation in list

r? @steveklabnik

8 years agoAuto merge of #28275 - hunan-rostomyan:patch-1, r=steveklabnik
bors [Mon, 7 Sep 2015 06:13:50 +0000 (06:13 +0000)]
Auto merge of #28275 - hunan-rostomyan:patch-1, r=steveklabnik

8 years agoAuto merge of #28272 - Manishearth:improve_vec_docs, r=steveklabnik
bors [Mon, 7 Sep 2015 03:09:05 +0000 (03:09 +0000)]
Auto merge of #28272 - Manishearth:improve_vec_docs, r=steveklabnik

r? @steveklabnik

8 years agoat_exit: fix a typo of the doc comment
Ryo Munakata [Mon, 7 Sep 2015 01:28:54 +0000 (10:28 +0900)]
at_exit: fix a typo of the doc comment

8 years agoAuto merge of #28175 - christopherdumas:master, r=nrc
bors [Mon, 7 Sep 2015 01:16:38 +0000 (01:16 +0000)]
Auto merge of #28175 - christopherdumas:master, r=nrc

per #28168. This is my first contribution. I don't know who to "r?" for source code changes.

8 years agoDon't add unnamed address attributes to intrinsics.
Richard Diamond [Mon, 7 Sep 2015 00:26:41 +0000 (19:26 -0500)]
Don't add unnamed address attributes to intrinsics.

Intrinsics never have an address, so it doesn't make sense to say that their
address is unnamed.

8 years agoAuto merge of #28270 - arielb1:raw-fat-ops, r=nrc
bors [Sun, 6 Sep 2015 23:24:11 +0000 (23:24 +0000)]
Auto merge of #28270 - arielb1:raw-fat-ops, r=nrc

r? @nrc

Fixes #17736
Fixes #18829
Fixes #23888
Fixes #28236

8 years agoAdd note about clone in docs for vec![]
Manish Goregaokar [Sun, 6 Sep 2015 14:57:37 +0000 (20:27 +0530)]
Add note about clone in docs for vec![]

8 years agoFix a typo
Hunan Rostomyan [Sun, 6 Sep 2015 21:38:12 +0000 (14:38 -0700)]
Fix a typo

8 years agoAuto merge of #27893 - nikomatsakis:mir, r=nrc
bors [Sun, 6 Sep 2015 21:31:26 +0000 (21:31 +0000)]
Auto merge of #27893 - nikomatsakis:mir, r=nrc

This PR contains a new crate, `rustc_mir`, which implements the MIR as specified in the RFC (more or less). There are no targeted unit tests at the moment, as I didn't decide what kind of infrastructure would be best and didn't take the time to implement it.

~~NB: In packaging up this PR, I realized that MIR construction code is not triggering for methods right now, I think it's only for fixed fns. I'll push a fix for this soon. Hopefully it doesn't stop any crates from building. :)~~ Fixed. Everything still seems to work.

However, the MIR construction code (`librustc_mir/build`) is intentionally quite distinct from the code which munges the compiler's data structures (`librustc_mir/tcx`). The interface between the two is the `HIR` trait (`librustc_mir/hir`). To avoid confusion with @nrc's work, perhaps a better name for this trait is warranted, although ultimately this trait *will* be connected to the HIR, I imagine, so in a way the name is perfect. Anyway, I'm open to suggestions. The initial motivation for this split was to allow for the MIR construction code to be unit-tested. But while I didn't end up writing unit tests (yet), I did find the split made the code immensely easier to think about, since the messiness of our existing system, with its myriad hashtables, punning, and so forth, is confined to one part, which simply transforms to a more fully explicit AST-like form. I tried to separate out the commits somewhat, but since this mostly new code, it mostly winds up coming in one fell swoop in the MIR commit.

Quick guide to the MIR crate:

- `repr.rs` defines the MIR itself; each MIR instance is parameterized by some HIR `H`
- `build/` is the MIR construction code, parameterized by a particular HIR
- `hir/` is the definition of the HIR interface
- `tcx/` is the impl of the HIR interface for the tcx
- `dump.rs` is the minimal compiler pass that invokes the HIR

One open question:

- In the HIR trait, I used exclusively struct-like variants. I found I like this more, since things have names. Should I convert the repr code?

8 years agoenable slice patterns and enable building rustdoc
Niko Matsakis [Sat, 5 Sep 2015 09:46:50 +0000 (05:46 -0400)]
enable slice patterns and enable building rustdoc

8 years agoAuto merge of #28269 - petrochenkov:docorder, r=steveklabnik
bors [Sun, 6 Sep 2015 19:43:06 +0000 (19:43 +0000)]
Auto merge of #28269 - petrochenkov:docorder, r=steveklabnik

This is what I was talking about in https://github.com/rust-lang/rust/pull/26462#issuecomment-113883744

r? @steveklabnik

8 years agoAuto merge of #28265 - boblehest:master, r=bluss
bors [Sun, 6 Sep 2015 17:55:04 +0000 (17:55 +0000)]
Auto merge of #28265 - boblehest:master, r=bluss

In the last code snippet on the following page there is a bug in the
implementation of Vec::drain().

https://doc.rust-lang.org/nightly/nomicon/vec-drain.html

```rust
pub fn drain(&mut self) -> Drain<T> {
    // Oops, setting it to 0 while we still need the old value!
    self.len = 0;

    unsafe {
        Drain {
            // len is used to create a &[T] from &self here,
            // so we end up always creating an empty slice.
            iter: RawValIter::new(&self),
            vec: PhantomData,
        }
    }
}
```

A simple test to verify that Drain is broken can be found here:
https://play.rust-lang.org/?gist=30f579565e4bbf4836ce&version=nightly

And here's one with a fixed implementation:
https://play.rust-lang.org/?gist=2ec0c1a6dcf5defd7a53&version=nightly

8 years agoRustonomicon: Reword potentially confusing comment in Vec::drain.
Jørn Lode [Sun, 6 Sep 2015 16:21:57 +0000 (18:21 +0200)]
Rustonomicon: Reword potentially confusing comment in Vec::drain.

8 years agofunctional structure update syntax -> structure update syntax
christopherdumas [Wed, 2 Sep 2015 20:25:01 +0000 (13:25 -0700)]
functional structure update syntax -> structure update syntax

8 years agoimplement raw fat pointer ops
Ariel Ben-Yehuda [Sat, 5 Sep 2015 18:27:43 +0000 (21:27 +0300)]
implement raw fat pointer ops

8 years agoFurther tweaks to doc/index.md
Vadim Petrochenkov [Sun, 6 Sep 2015 13:07:55 +0000 (16:07 +0300)]
Further tweaks to doc/index.md

8 years agoReorder sections in doc/index.md
Vadim Petrochenkov [Sun, 6 Sep 2015 12:25:01 +0000 (15:25 +0300)]
Reorder sections in doc/index.md

8 years agoconvert TODOs to FIXMEs
Niko Matsakis [Tue, 1 Sep 2015 20:55:40 +0000 (16:55 -0400)]
convert TODOs to FIXMEs

8 years agofix EUV delegate to take advantage of defaults. This also
Niko Matsakis [Tue, 1 Sep 2015 15:31:09 +0000 (11:31 -0400)]
fix EUV delegate to take advantage of defaults. This also
works around a stage0 bug that has since been fixed.

8 years agoplumbing to automatically run MIR for crates where it works;
Niko Matsakis [Tue, 18 Aug 2015 22:02:14 +0000 (18:02 -0400)]
plumbing to automatically run MIR for crates where it works;
this serves as a poor man's unit test infrastructure until
MIR is more built up

8 years agoadd MIR crate and link it into the driver
Niko Matsakis [Tue, 18 Aug 2015 22:01:44 +0000 (18:01 -0400)]
add MIR crate and link it into the driver

8 years agoadd -Z always-build-mir option
Niko Matsakis [Tue, 18 Aug 2015 22:00:17 +0000 (18:00 -0400)]
add -Z always-build-mir option