]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRollup merge of #24170 - omo:omo-typo-fix, r=steveklabnik
Manish Goregaokar [Thu, 9 Apr 2015 10:25:12 +0000 (15:55 +0530)]
Rollup merge of #24170 - omo:omo-typo-fix, r=steveklabnik

 Can anyone take a look? Very trivial.

9 years agoRollup merge of #24221 - nrc:debug-loc, r=sfackler
Manish Goregaokar [Thu, 9 Apr 2015 10:25:05 +0000 (15:55 +0530)]
Rollup merge of #24221 - nrc:debug-loc, r=sfackler

9 years agoRollup merge of #24218 - lstat:remove-ignore-tidy, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:24:58 +0000 (15:54 +0530)]
Rollup merge of #24218 - lstat:remove-ignore-tidy, r=alexcrichton

 This is a really minor issue. I noticed some tests no longer need the ignore
tidy comment directive.

A quick grep turned up the following files:

    src/test/compile-fail/bad-mid-path-type-params.rs
    src/test/compile-fail/bad-sized.rs
    src/test/compile-fail/coherence-default-trait-impl.rs
    src/test/compile-fail/coherence-orphan.rs
    src/test/compile-fail/issue-8767.rs
    src/test/compile-fail/lint-stability.rs
    src/test/compile-fail/lint-uppercase-variables.rs
    src/test/compile-fail/typeck-default-trait-impl-outside-crate.rs
    src/test/compile-fail/use-after-move-implicity-coerced-object.rs
    src/test/debuginfo/gdb-pretty-std.rs

It didn't seem like it was worth opening an issue for this, but if that is not
the case (i.e. it is required), I'll open one up. Thanks!

9 years agoRollup merge of #24216 - alexcrichton:stabilize-from-raw-os-error, r=aturon
Manish Goregaokar [Thu, 9 Apr 2015 10:24:43 +0000 (15:54 +0530)]
Rollup merge of #24216 - alexcrichton:stabilize-from-raw-os-error, r=aturon

 This commit stabilizes the old `io::Error::from_os_error` after being renamed to
use the `raw_os_error` terminology instead. This function is often useful when
writing bindings to OS functions but only actually converting to an I/O error at
a later point.

9 years agoRollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturon
Manish Goregaokar [Thu, 9 Apr 2015 10:24:36 +0000 (15:54 +0530)]
Rollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturon

 This method hasn't really changed since is inception, and it can often be a
nice performance win for some situations. This method also imposes no burden on
implementors or users of `Clone` as it's just a default method on the side.

9 years agoRollup merge of #24212 - alexcrichton:destabilize-begin-unwind, r=huonw
Manish Goregaokar [Thu, 9 Apr 2015 10:24:28 +0000 (15:54 +0530)]
Rollup merge of #24212 - alexcrichton:destabilize-begin-unwind, r=huonw

 Now that we have a `#[allow_internal_unstable]` attribute for macros there's no
need for these two `begin_unwind` functions to be stable. Right now the `panic!`
interface is the only one we wish to stabilize, so remove the stability markers
from these functions.

While this is a breaking change, it is highly unlikely to break any actual code.
It is recommended to use the `panic!` macro instead if it breaks explicit calls
into `std::rt`.

[breaking-change]
cc #24208

9 years agoRollup merge of #24207 - kmcallister:llvm-plugin, r=brson
Manish Goregaokar [Thu, 9 Apr 2015 10:24:18 +0000 (15:54 +0530)]
Rollup merge of #24207 - kmcallister:llvm-plugin, r=brson

 r? @brson

I'm using this to integrate rustc with [american-fuzzy-lop](http://lcamtuf.coredump.cx/afl/). Building with afl instrumentation is no different from loading any other plugin library.

I'd like this PR to include a `run-make` test with a custom LLVM pass; however I'm not sure it's worth the trouble of building C++ code and linking LLVM from the test suite (are there existing tests that do this?)

9 years agoRollup merge of #24205 - brson:debug, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:24:11 +0000 (15:54 +0530)]
Rollup merge of #24205 - brson:debug, r=alexcrichton

 This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per #17665. It does not add a `--enable-release` flag since that would be a no-op.

cc @nrc

Fixes https://github.com/rust-lang/rust/issues/22390
Fixes https://github.com/rust-lang/rust/issues/17081
Partially addresses https://github.com/rust-lang/rust/issues/17665

9 years agoRollup merge of #24193 - lstat:needstest, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:24:04 +0000 (15:54 +0530)]
Rollup merge of #24193 - lstat:needstest, r=alexcrichton

 Closes #22289
Closes #22370
Closes #22384

9 years agoRollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix
Manish Goregaokar [Thu, 9 Apr 2015 10:23:59 +0000 (15:53 +0530)]
Rollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix

 Modify the ExprUseVisitor to walk each part of an AutoRef, and in
particular to treat an AutoUnsize as as kind of \"instantaneous\" borrow
of the value being unsized. This prevents us from feeding uninitialized
data.

This caused a problem for the eager reborrow of comparison traits,
because that wound up introducing a \"double AutoRef\", which was not
being thoroughly checked before but turned out not to type check.
Fortunately, we can just remove that \"eager reborrow\" as it is no longer
needed now that `PartialEq` doesn't force both LHS and RHS to have the
same type (and even if we did have this problem, the better way would be
to lean on introducing a common supertype).

Fixes #20791.

r? @nrc

9 years agoRollup merge of #24176 - kballard:bufreader-seek-impl, r=aturon
Manish Goregaokar [Thu, 9 Apr 2015 10:23:48 +0000 (15:53 +0530)]
Rollup merge of #24176 - kballard:bufreader-seek-impl, r=aturon

9 years agoRollup merge of #24175 - dhuseby:bitrig_fixing_tests_2, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:23:43 +0000 (15:53 +0530)]
Rollup merge of #24175 - dhuseby:bitrig_fixing_tests_2, r=alexcrichton

 I'm not sure why this is failing.  This patch disables this test until I can figure out what is wrong.

9 years agoRollup merge of #24171 - rillian:rustup, r=brson
Manish Goregaokar [Thu, 9 Apr 2015 10:23:36 +0000 (15:53 +0530)]
Rollup merge of #24171 - rillian:rustup, r=brson

 The idea here is if you don't want rust in /usr/local
you can put something like this is your .profile:

```
export RUSTUP_PREFIX=$HOME/.local/rust
export PATH=$PATH:${RUSTUP_PREFIX}/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${RUSTUP_PREFIX}/lib
```
Then when you run rustup, it will update the install
in ${RUSTUP_PREFIX} without having to remember to pass
an explicit --prefix argument every time.

9 years agoDebug impls for a few things in syntax::codemap
Nick Cameron [Thu, 9 Apr 2015 06:25:48 +0000 (18:25 +1200)]
Debug impls for a few things in syntax::codemap

9 years agoAuto merge of #24168 - kballard:clone-for-extern-c-unsafe-fns, r=alexcrichton
bors [Thu, 9 Apr 2015 04:56:23 +0000 (04:56 +0000)]
Auto merge of #24168 - kballard:clone-for-extern-c-unsafe-fns, r=alexcrichton

We only implemented Clone on `extern "Rust" fn`s (for up to 8
parameters). This didn't cover `extern "C"` or `unsafe` (or
`unsafe extern "C"`) `fn`s, but there's no reason why they shouldn't be
cloneable as well.

The new impls are marked unstable because the existing impl for `extern
"Rust" fn`s is.

Fixes #24161.

9 years agoImplement io::Seek for io::BufWriter<W> where W: io::Seek
Kevin Ballard [Wed, 8 Apr 2015 00:29:33 +0000 (17:29 -0700)]
Implement io::Seek for io::BufWriter<W> where W: io::Seek

Seeking the `BufWriter` writes out its internal buffer before seeking.

9 years agoImplement io::Seek for io::BufReader<R> where R: io::Seek
Kevin Ballard [Tue, 7 Apr 2015 23:01:21 +0000 (16:01 -0700)]
Implement io::Seek for io::BufReader<R> where R: io::Seek

Seeking the `BufReader` discards the internal buffer (and adjusts the
offset appropriately when seeking with `SeekFrom::Current(_)`).

9 years agoDon't deoptimize llvm when --enable-debug
Brian Anderson [Thu, 9 Apr 2015 01:01:46 +0000 (18:01 -0700)]
Don't deoptimize llvm when --enable-debug

libLTO fails to link here.

9 years agoAuto merge of #24158 - sanxiyn:cast, r=nrc
bors [Thu, 9 Apr 2015 01:00:37 +0000 (01:00 +0000)]
Auto merge of #24158 - sanxiyn:cast, r=nrc

Fix #13993.
Fix #17167.

9 years agoRemove pretty-expanded from failing tests
Alex Crichton [Wed, 8 Apr 2015 23:27:10 +0000 (16:27 -0700)]
Remove pretty-expanded from failing tests

This commit removes pretty-expanded from all tests that wind up calling panic!
one way or another now that its internals are unstable.

9 years agostd: Stabilize io::Error::from_raw_os_error
Alex Crichton [Wed, 8 Apr 2015 23:41:14 +0000 (16:41 -0700)]
std: Stabilize io::Error::from_raw_os_error

This commit stabilizes the old `io::Error::from_os_error` after being renamed to
use the `raw_os_error` terminology instead. This function is often useful when
writing bindings to OS functions but only actually converting to an I/O error at
a later point.

9 years agostd: Stabilize Clone::clone_from
Alex Crichton [Wed, 8 Apr 2015 23:38:38 +0000 (16:38 -0700)]
std: Stabilize Clone::clone_from

This method hasn't really changed since is inception, and it can often be a
nice performance win for some situations. This method also imposes no burden on
implementors or users of `Clone` as it's just a default method on the side.

9 years agostd: Destabilize the internals of panic!
Alex Crichton [Wed, 8 Apr 2015 22:48:46 +0000 (15:48 -0700)]
std: Destabilize the internals of panic!

Now that we have a `#[allow_internal_unstable]` attribute for macros there's no
need for these two `begin_unwind` functions to be stable. Right now the `panic!`
interface is the only one we wish to stabilize, so remove the stability markers
from these functions.

While this is a breaking change, it is highly unlikely to break any actual code.
It is recommended to use the `panic!` macro instead if it breaks explicit calls
into `std::rt`.

[breaking-change]
cc #24208

9 years agoRemove `ignore-tidy-linelength` from tests that no longer need it
Luke Gallagher [Wed, 8 Apr 2015 22:20:51 +0000 (08:20 +1000)]
Remove `ignore-tidy-linelength` from tests that no longer need it

9 years agoconfigure: Add --enable-debug-jemalloc
Brian Anderson [Wed, 8 Apr 2015 22:12:08 +0000 (15:12 -0700)]
configure: Add --enable-debug-jemalloc

9 years agoAuto merge of #24144 - richo:ptr-formatter, r=alexcrichton
bors [Wed, 8 Apr 2015 22:08:31 +0000 (22:08 +0000)]
Auto merge of #24144 - richo:ptr-formatter, r=alexcrichton

~~I believe this should fix the issue. Opening a PR to ensure noone duplicates effort, I'm running check now.~~

Closes #24091

9 years agoAdd --enable-debug to control multiple perf options
Brian Anderson [Wed, 8 Apr 2015 21:21:36 +0000 (14:21 -0700)]
Add --enable-debug to control multiple perf options

9 years agoAllow plugins to register LLVM passes
Keegan McAllister [Wed, 8 Apr 2015 19:52:58 +0000 (12:52 -0700)]
Allow plugins to register LLVM passes

9 years agoconfigure: Add --enable-debuginfo
Brian Anderson [Wed, 8 Apr 2015 20:57:37 +0000 (13:57 -0700)]
configure: Add --enable-debuginfo

9 years agoconfigure: Clarify --enable-debug-assertions status message
Brian Anderson [Wed, 8 Apr 2015 20:31:26 +0000 (13:31 -0700)]
configure: Clarify --enable-debug-assertions status message

9 years agoconfigure: Disable LLVM asserts by default
Brian Anderson [Wed, 8 Apr 2015 20:27:12 +0000 (13:27 -0700)]
configure: Disable LLVM asserts by default

9 years agoconfigure: Clarify help message for --enable-debug-assertions
Brian Anderson [Wed, 8 Apr 2015 20:25:20 +0000 (13:25 -0700)]
configure: Clarify help message for --enable-debug-assertions

9 years agoconfigure: Disable debug assertions by default
Brian Anderson [Wed, 8 Apr 2015 20:23:44 +0000 (13:23 -0700)]
configure: Disable debug assertions by default

9 years agoconfigure: Rename --enable-debug to --enable-debug-assertions
Brian Anderson [Wed, 8 Apr 2015 20:17:46 +0000 (13:17 -0700)]
configure: Rename --enable-debug to --enable-debug-assertions

9 years agoconfigure: Remove obsolete --disable-verify option
Brian Anderson [Wed, 8 Apr 2015 19:16:45 +0000 (12:16 -0700)]
configure: Remove obsolete --disable-verify option

rust-installer never verifies.

9 years agoconfigure: Remove obsolete --nightly flag
Brian Anderson [Wed, 8 Apr 2015 19:06:29 +0000 (12:06 -0700)]
configure: Remove obsolete --nightly flag

9 years agoAuto merge of #24029 - nagisa:print-locking, r=alexcrichton
bors [Wed, 8 Apr 2015 19:03:09 +0000 (19:03 +0000)]
Auto merge of #24029 - nagisa:print-locking, r=alexcrichton

write_fmt calls write for each formatted field. The default implementation of write_fmt is used,
which will call write on not-yet-locked stdout (and write locking after), therefore making print!
in multithreaded environment still interleave contents of two separate prints.

I’m not sure whether we want to do this change, though, because it has the same deadlock hazard which we tried to avoid by not locking inside write_fmt itself (see [this comment](https://github.com/rust-lang/rust/blob/80def6c2447d23a624e611417f24cf0ab2a5a676/src/libstd/io/stdio.rs#L267)).

Spotted on [reddit].

cc @alexcrichton

[reddit]: http://www.reddit.com/r/rust/comments/31comh/println_with_multiple_threads/

9 years agoImplement reentrant mutexes and make stdio use them
Simonas Kazlauskas [Fri, 3 Apr 2015 21:46:54 +0000 (00:46 +0300)]
Implement reentrant mutexes and make stdio use them

write_fmt calls write for each formatted field. The default implementation of write_fmt is used,
which will call write on not-yet-locked stdout (and write locking after), therefore making print!
in multithreaded environment still interleave contents of two separate prints.

This patch implements reentrant mutexes, changes stdio handles to use these mutexes and overrides
write_fmt to lock the stdio handle for the whole duration of the call.

9 years agoAuto merge of #24195 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 8 Apr 2015 15:59:10 +0000 (15:59 +0000)]
Auto merge of #24195 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #24143, #24149, #24167, #24178
- Failed merges:

9 years agoRollup merge of #24178 - steveklabnik:new_toc, r=nikomatsakis
Steve Klabnik [Wed, 8 Apr 2015 15:34:12 +0000 (11:34 -0400)]
Rollup merge of #24178 - steveklabnik:new_toc, r=nikomatsakis

Basically, the overall structure is this:

* Getting Started - getting an environment up and running
* Learn Rust - project-based learning the basics
* Effective Rust - higher level concepts that lead to writing good rust
* Syntax and Semantics - chunks of exactly what it sounds like
* Nightly Rust - unstable stuff, a staging area for documenting features
* Glossary - self-explanatory

There's a number of weaknesses with the current TOC, but I'll just focus on the strengths of the new one:

We start off with getting our environment set up. That's "getting started".

Then, we basically present you with two choices: do you want to start small, with bits of syntax? Or do you want to dive in with projects?

I'm guessing more people will choose the second, so that's the next part: "Learn Rust." I don't have any chapters here, but this would have an updated guessing game, a tutorial on building a little `wc` clone, and something else I haven't decided yet. Lots of options. But the idea is to just dive in and get your hands dirty. I'll heavily link to the 'syntax and semantics' sections that are relevant.

Then, a section I'm calling 'Effective Rust'. it feels greedy to steal that title, so I'm hoping to give it another name. These are higher-level things than syntax that Rust programmers should know: error handling is a great example. Most of these are sort of 'how do I use the standard library together' kinds of things. This also contains informations about systems programming that those new to it might not know: the stack vs the heap, for example.

Then, "Syntax and Semantics." This has one section for each bit of Rust. Small, focused, but explains _everything_. These are positioned to be almost entirely in-order, but heavily cross-link, so you can go out of order if you want to, but you can also use it as a reference.

Next, "Nightly Rust," where documenting unstable things goes. If we want to get good feedback on new features, they'll need to be documented, but we don't want to taint the main docs, so that's what this is for.

Finally, the glossary. Straightforward enough.

--------------------------------

This is going to be a terrible PR to review, so I just did the TOC re-organization, with basically no editing. So it'll be a bit jumbled at first. But next steps are to go through and edit / revise / tweak / add stuff to get it in tip-top shape for 1.0!

9 years agoRollup merge of #24167 - hauleth:remove-incorrect-example-from-mpsc, r=steveklabnik
Steve Klabnik [Wed, 8 Apr 2015 15:34:12 +0000 (11:34 -0400)]
Rollup merge of #24167 - hauleth:remove-incorrect-example-from-mpsc, r=steveklabnik

As beta is now released and is "suggested" version of `rustc` then there should be no code (in documentation) that will not compile with it. This one does not.

So according to [this great talk](http://delete-your-code.herokuapp.com/), I am doing what should be done.

9 years agoRollup merge of #24149 - bombless:update-faq, r=steveklabnik
Steve Klabnik [Wed, 8 Apr 2015 15:34:12 +0000 (11:34 -0400)]
Rollup merge of #24149 - bombless:update-faq, r=steveklabnik

I think "let is used to introduce variables" is incorrent.
You can use
```rust
match (42, true) {
    (x, y) => { /* ... */ }
}
```
to replace
```rust
let x = 42;
let y = true;
```
so it's nothing special for `let`.

9 years agoRollup merge of #24143 - michaelsproul:extended-errors, r=pnkfelix
Steve Klabnik [Wed, 8 Apr 2015 15:34:11 +0000 (11:34 -0400)]
Rollup merge of #24143 - michaelsproul:extended-errors, r=pnkfelix

I've taken another look at extended errors - fixing up the printing and adding a few more for match expressions.

With regards to printing, the previous behaviour was to just print the error message string directly, despite it containing indentation which caused it to overflow the standard terminal width of 80 columns (try `rustc --explain E0004`). The first approach I considered was to strip the leading whitespace from each line and lay out the text dynamically, inserting spaces in between. This approach became quite messy when taking multi-paragraph errors into account (and seemed overkill). The approach I settled on removes the indentation in the string itself and begins each message with a newline that is stripped before printing.

I feel like complete extended errors would be nice to have for 1.0.0 and I'm happy to spearhead an effort to get them written. Brian got me onto writing them at an SF meetup and I think it shouldn't be too hard to get the remaining 80 or so written with the help of people who don't really work on compiler innards.

9 years agoModify the ExprUseVisitor to walk each part of an AutoRef, and in
Niko Matsakis [Wed, 8 Apr 2015 08:31:51 +0000 (04:31 -0400)]
Modify the ExprUseVisitor to walk each part of an AutoRef, and in
particular to treat an AutoUnsize as as kind of "instantaneous" borrow
of the value being unsized. This prevents us from feeding uninitialized
data.

This caused a problem for the eager reborrow of comparison traits,
because that wound up introducing a "double AutoRef", which was not
being thoroughly checked before but turned out not to type check.
Fortunately, we can just remove that "eager reborrow" as it is no longer
needed now that `PartialEq` doesn't force both LHS and RHS to have the
same type (and even if we did have this problem, the better way would be
to lean on introducing a common supertype).

9 years agoAdd tests for #22289, #22370 and #22384
Luke Gallagher [Wed, 8 Apr 2015 13:23:43 +0000 (23:23 +1000)]
Add tests for #22289, #22370 and #22384

Closes #22289
Closes #22370
Closes #22384

9 years agoAuto merge of #24021 - pnkfelix:fn-params-outlive-body, r=nikomatsakis
bors [Wed, 8 Apr 2015 12:57:58 +0000 (12:57 +0000)]
Auto merge of #24021 - pnkfelix:fn-params-outlive-body, r=nikomatsakis

Encode more precise scoping rules for function params

Function params outlive everything in the body (incl temporaries).  Thus if we assign them their own `CodeExtent`, the region inference can properly show that it is sound to have temporaries with destructors that reference the parameters (because such temporaries will be dropped before the parameters are dropped).

Fix #23338

9 years agoAddress review nit by making `map_id` take an `FnMut`.
Felix S. Klock II [Wed, 8 Apr 2015 11:55:01 +0000 (13:55 +0200)]
Address review nit by making `map_id` take an `FnMut`.

9 years agoAuto merge of #23998 - nrc:impl-self, r=nikomatsakis
bors [Wed, 8 Apr 2015 09:58:05 +0000 (09:58 +0000)]
Auto merge of #23998 - nrc:impl-self, r=nikomatsakis

Closes #23909

r? @nikomatsakis (or anyone else, really)

9 years agoAuto merge of #24120 - aturon:range-perf, r=alexcrichton
bors [Wed, 8 Apr 2015 07:02:06 +0000 (07:02 +0000)]
Auto merge of #24120 - aturon:range-perf, r=alexcrichton

A recent change to the implementation of range iterators meant that,
even when stepping by 1, the iterators *always* involved checked
arithmetic.

This commit reverts to the earlier behavior (while retaining the
refactoring into traits).

Fixes #24095
Closes #24119
cc #24014

r? @alexcrichton

9 years agoAddress review comments
Seo Sanghyeon [Wed, 8 Apr 2015 04:55:18 +0000 (13:55 +0900)]
Address review comments

9 years agoalloc: impl fmt::Pointer for Rc, Arc and Box
Richo Healey [Tue, 7 Apr 2015 07:40:22 +0000 (00:40 -0700)]
alloc: impl fmt::Pointer for Rc, Arc and Box

Closes #24091

9 years agoAuto merge of #24078 - whipsch:extra-token-msg, r=huonw
bors [Wed, 8 Apr 2015 04:10:12 +0000 (04:10 +0000)]
Auto merge of #24078 - whipsch:extra-token-msg, r=huonw

Addresses issue #22425.  See `src/test/compile-fail/macro-incomplete-parse.rs` for a relevant test:

    macro-incomplete-parse.rs:15:9: 15:10 error: macro expansion ignores token `,` and any following
    macro-incomplete-parse.rs:15         , //~ ERROR macro expansion ignores token `,`
                                         ^
    macro-incomplete-parse.rs:27:1: 27:17 note: caused by the macro expansion here; the usage of `ignored_item` is likely invalid in this context
    macro-incomplete-parse.rs:27 ignored_item!();
                                 ^~~~~~~~~~~~~~~~
    macro-incomplete-parse.rs:20:14: 20:15 error: macro expansion ignores token `,` and any following
    macro-incomplete-parse.rs:20     () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
                                              ^
    macro-incomplete-parse.rs:30:5: 30:21 note: caused by the macro expansion here; the usage of `ignored_expr` is likely invalid in this context
    macro-incomplete-parse.rs:30     ignored_expr!();
                                     ^~~~~~~~~~~~~~~~
    macro-incomplete-parse.rs:24:14: 24:15 error: macro expansion ignores token `,` and any following
    macro-incomplete-parse.rs:24     () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
                                              ^
    macro-incomplete-parse.rs:32:9: 32:23 note: caused by the macro expansion here; the usage of `ignored_pat` is likely invalid in this context
    macro-incomplete-parse.rs:32         ignored_pat!() => (),
                                         ^~~~~~~~~~~~~~

This does not address the case of improper expansion inside of an impl { } as seen in issue #21607.

I'm not sure if the note text is ideal, but it can be refined if needed.

9 years agoUpdate "`let` is used to introduce variables" paragraph
York Xiang [Wed, 8 Apr 2015 02:29:11 +0000 (10:29 +0800)]
Update "`let` is used to introduce variables" paragraph

9 years agoImport real content.
Steve Klabnik [Wed, 8 Apr 2015 02:16:02 +0000 (22:16 -0400)]
Import real content.

9 years agoAuto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichton
bors [Wed, 8 Apr 2015 00:42:10 +0000 (00:42 +0000)]
Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichton

Previously it could not be implemented for types outside `libcore/iter.rs` due
to coherence issues.

9 years agodisabling a test that is failing on bitrig.
Dave Huseby [Tue, 7 Apr 2015 23:03:14 +0000 (16:03 -0700)]
disabling a test that is failing on bitrig.

9 years agoNew TOC
Steve Klabnik [Tue, 7 Apr 2015 23:44:49 +0000 (19:44 -0400)]
New TOC

9 years agoFix range performance regression
Aaron Turon [Mon, 6 Apr 2015 18:07:20 +0000 (11:07 -0700)]
Fix range performance regression

A recent change to the implementation of range iterators meant that,
even when stepping by 1, the iterators *always* involved checked
arithmetic.

This commit reverts to the earlier behavior (while retaining the
refactoring into traits).

Fixes #24095
cc #24014

9 years agoMake `sum` and `product` inherent methods on `Iterator`
Tobias Bucher [Mon, 6 Apr 2015 15:43:50 +0000 (17:43 +0200)]
Make `sum` and `product` inherent methods on `Iterator`

In addition to being nicer, this also allows you to use `sum` and `product` for
iterators yielding custom types aside from the standard integers.

Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this
is a breaking change.

[breaking-change]

9 years agorustup: let RUSTUP_PREFIX env override default prefix.
Ralph Giles [Tue, 7 Apr 2015 21:05:02 +0000 (14:05 -0700)]
rustup: let RUSTUP_PREFIX env override default prefix.

The idea here is if you don't want rust in /usr/local
you can put something like this is your .profile:

export RUSTUP_PREFIX=$HOME/.local/rust
export PATH=$PATH:${RUSTUP_PREFIX}/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${RUSTUP_PREFIX}/lib

Then when you run rustup, it will update the install
in ${RUSTUP_PREFIX} without having to remember to pass
an explicit --prefix argument every time.

9 years agoFix a typo
Hajime Morrita [Tue, 7 Apr 2015 20:19:17 +0000 (13:19 -0700)]
Fix a typo

9 years agoAuto merge of #24169 - Manishearth:rollup, r=Manishearth
bors [Tue, 7 Apr 2015 19:49:59 +0000 (19:49 +0000)]
Auto merge of #24169 - Manishearth:rollup, r=Manishearth

- Successful merges: #24132, #24139, #24147, #24148, #24150, #24166
- Failed merges:

9 years agoRollup merge of #24166 - lgvz:email, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 19:49:38 +0000 (01:19 +0530)]
Rollup merge of #24166 - lgvz:email, r=steveklabnik

9 years agoRollup merge of #24150 - wg:master, r=alexcrichton
Manish Goregaokar [Tue, 7 Apr 2015 19:49:38 +0000 (01:19 +0530)]
Rollup merge of #24150 - wg:master, r=alexcrichton

This fix allows the gdb debuginfo tests to pass on FreeBSD when using the newer 7.8 package.

9 years agoRollup merge of #24148 - xfq:patch-2, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 19:49:38 +0000 (01:19 +0530)]
Rollup merge of #24148 - xfq:patch-2, r=steveklabnik

People use programming language *implementations* like Ruby MRI, CPython, and SpiderMonkey for executing programs.

9 years agoRollup merge of #24147 - lstat:needstest-22560, r=alexcrichton
Manish Goregaokar [Tue, 7 Apr 2015 19:49:38 +0000 (01:19 +0530)]
Rollup merge of #24147 - lstat:needstest-22560, r=alexcrichton

Closes #22560

9 years agoRollup merge of #24139 - xfq:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 19:49:37 +0000 (01:19 +0530)]
Rollup merge of #24139 - xfq:patch-1, r=steveklabnik

Use HTTPS where possible to avoid plaintext HTTP connections.

9 years agoRollup merge of #24132 - kwantam:master, r=alexcrichton
Manish Goregaokar [Tue, 7 Apr 2015 19:49:37 +0000 (01:19 +0530)]
Rollup merge of #24132 - kwantam:master, r=alexcrichton

@mahkoh points out in #15628 that unicode.py does not use
normative data for Grapheme classes. This pr fixes that issue,
and does some minor cleanup of the unicode.py script.

In addition, GC_RegionalIndicator is renamed GC_Regional_Indicator
in order to stay in line with the Unicode class name definitions.
I have updated refs in u_str.rs, and verified that there are no
refs elsewhere in the codebase. However, in principle someone
using the unicode tables for their own purposes might see breakage
from this.

9 years agoRemove another invalid example
Łukasz Niemier [Tue, 7 Apr 2015 19:46:14 +0000 (21:46 +0200)]
Remove another invalid example

9 years agoAdd Clone impls for extern "C" and unsafe fns
Kevin Ballard [Tue, 7 Apr 2015 19:36:39 +0000 (12:36 -0700)]
Add Clone impls for extern "C" and unsafe fns

We only implemented Clone on `extern "Rust" fn`s (for up to 8
parameters). This didn't cover `extern "C"` or `unsafe` (or `unsafe
extern "C"`) `fn`s, but there's no reason why they shouldn't be
cloneable as well.

The new impls are marked unstable because the existing impl for `extern
"Rust" fn`s is.

Fixes #24161.

9 years agoRemove incorrect example from docs
Łukasz Niemier [Tue, 7 Apr 2015 18:35:54 +0000 (20:35 +0200)]
Remove incorrect example from docs

9 years agoChange my email
Tero Hänninen [Tue, 7 Apr 2015 18:21:46 +0000 (21:21 +0300)]
Change my email

9 years agoAdd more extended error messages for match exprs.
Michael Sproul [Tue, 7 Apr 2015 06:49:40 +0000 (23:49 -0700)]
Add more extended error messages for match exprs.

9 years agoAuto merge of #24156 - Manishearth:rollup, r=Manishearth
bors [Tue, 7 Apr 2015 16:44:11 +0000 (16:44 +0000)]
Auto merge of #24156 - Manishearth:rollup, r=Manishearth

9 years agodoc ignore (fixup #24059)
Manish Goregaokar [Tue, 7 Apr 2015 16:40:55 +0000 (22:10 +0530)]
doc ignore (fixup #24059)

9 years agoCheck casts from fat pointer
Seo Sanghyeon [Tue, 7 Apr 2015 15:45:57 +0000 (00:45 +0900)]
Check casts from fat pointer

9 years agoCheck casts from float
Seo Sanghyeon [Tue, 7 Apr 2015 13:45:10 +0000 (22:45 +0900)]
Check casts from float

9 years agoRollup merge of #24113 - mbrubeck:doc-edit, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 12:43:24 +0000 (18:13 +0530)]
Rollup merge of #24113 - mbrubeck:doc-edit, r=steveklabnik

 * Fix broken \"module-level documentation\" link on the [`trait Any` docs](http://doc.rust-lang.org/std/any/trait.Any.html) and related broken markup on the [`std::any` docs](http://doc.rust-lang.org/std/any/index.html).

* Remove an outdated or incorrect notice in the `BufRead::lines` docs. There is no such `read_string` function, and `lines` never returns an error.

r? @steveklabnik

9 years agoRollup merge of #24112 - joshtriplett:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 12:43:12 +0000 (18:13 +0530)]
Rollup merge of #24112 - joshtriplett:patch-1, r=steveklabnik

 traits.md said:

If we add a `use` line right above `main` and make the right things public,
everything is fine:

However, the use line was actually placed at the top of the file instead.  Move
the use line to right above main.  That also makes the example more evocative
of cases where the module is defined in a separate file.

9 years agoRollup merge of #24110 - tbu-:pr_doc_fix_add, r=alexcrichton
Manish Goregaokar [Tue, 7 Apr 2015 12:43:04 +0000 (18:13 +0530)]
Rollup merge of #24110 - tbu-:pr_doc_fix_add, r=alexcrichton

9 years agoRollup merge of #24088 - GuillaumeGomez:patch-1, r=alexcrichton
Manish Goregaokar [Tue, 7 Apr 2015 12:42:55 +0000 (18:12 +0530)]
Rollup merge of #24088 - GuillaumeGomez:patch-1, r=alexcrichton

 Fixes #24060.

9 years agoRollup merge of #24059 - nikomatsakis:issue-22914-phantomdata-docs, r=huon
Manish Goregaokar [Tue, 7 Apr 2015 12:42:47 +0000 (18:12 +0530)]
Rollup merge of #24059 - nikomatsakis:issue-22914-phantomdata-docs, r=huon

 This probably needs a bit more work, but I wanted to try and capture some common use cases and be a bit more helpful.

r? @huonw
cc @steveklabnik

9 years agoRollup merge of #24057 - nikomatsakis:lifetime-shadowing-hard-error, r=huon
Manish Goregaokar [Tue, 7 Apr 2015 12:42:40 +0000 (18:12 +0530)]
Rollup merge of #24057 - nikomatsakis:lifetime-shadowing-hard-error, r=huon

9 years agoRollup merge of #24042 - callahad:bug_24030, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 12:42:32 +0000 (18:12 +0530)]
Rollup merge of #24042 - callahad:bug_24030, r=steveklabnik

 Fixes #24030

Of the four code samples with modules in TRPL:

    - 2 use `mod test`
    - 2 use `mod tests`

We should be consistent here, but which is right? The stdlib is split:

    $ grep -r 'mod tests {' src/lib* | wc -l
          63
    $ grep -r 'mod test {'  src/lib* | wc -l
          58

Subjectively, I like the plural, but both the language reference and the
style guide recommend the singular. So we'll go with that here, for now.

r? @steveklabnik

9 years agoRollup merge of #23277 - aochagavia:intro, r=steveklabnik
Manish Goregaokar [Tue, 7 Apr 2015 12:42:22 +0000 (18:12 +0530)]
Rollup merge of #23277 - aochagavia:intro, r=steveklabnik

 cc @steveklabnik

9 years agoSplit check_cast to a separate file
Seo Sanghyeon [Tue, 7 Apr 2015 12:05:22 +0000 (21:05 +0900)]
Split check_cast to a separate file

9 years agoAdd `ignore-tidy-linelength` and fix formatting
Luke Gallagher [Tue, 7 Apr 2015 11:37:16 +0000 (21:37 +1000)]
Add `ignore-tidy-linelength` and fix formatting

9 years agoFix charset of debuginfo test on FreeBSD
Will [Tue, 7 Apr 2015 11:41:34 +0000 (20:41 +0900)]
Fix charset of debuginfo test on FreeBSD

9 years agoAuto merge of #23277 - aochagavia:intro, r=steveklabnik
bors [Tue, 7 Apr 2015 11:34:38 +0000 (11:34 +0000)]
Auto merge of #23277 - aochagavia:intro, r=steveklabnik

cc @steveklabnik

9 years agoUpdate hello-world.md
Xue Fuqiao [Tue, 7 Apr 2015 10:07:10 +0000 (18:07 +0800)]
Update hello-world.md

People use programming language *implementations* like Ruby MRI, CPython, and SpiderMonkey for executing programs.

9 years agoAdd test for #22560
Luke Gallagher [Tue, 7 Apr 2015 01:31:28 +0000 (11:31 +1000)]
Add test for #22560

Closes #22560

9 years agoAuto merge of #24116 - zaeleus:rustdoc-codespan, r=alexcrichton
bors [Tue, 7 Apr 2015 07:41:32 +0000 (07:41 +0000)]
Auto merge of #24116 - zaeleus:rustdoc-codespan, r=alexcrichton

Because the current style for `code` in rustdoc is to prewrap whitespace, code spans that are hard wrapped in the source documentation are prematurely wrapped when rendered in HTML. [For example][2],

```
/// ...
/// type can be borrowed as multiple different types. In particular, `Vec<T>:
/// Borrow<Vec<T>>` and `Vec<T>: Borrow<[T]>`.
```

renders as

![screen shot 2015-04-06 at 12 11 21](https://cloud.githubusercontent.com/assets/191331/7008216/2706b3b0-dc56-11e4-941e-1b0154fcbc5c.png)

because "`Vec<T>: Borrow<Vec<T>>`" wraps to the next line in the source.

CommonMark 0.18 [[1]] specifies "interior spaces and line endings are collapsed into single spaces" for code spans, which would actually prevent this issue, but hoedown does not currently conform to the
CommonMark spec.

The added span-level callback attempts to adhere to how whitespace is handled as described by CommonMark, fixing the issue of early, unintentional wrapping of code spans in rendered HTML.

[1]: http://spec.commonmark.org/0.18/
[2]: https://doc.rust-lang.org/std/borrow/trait.Borrow.html

9 years agoWork with assoc types in a super trait.
Nick Cameron [Tue, 7 Apr 2015 05:59:10 +0000 (17:59 +1200)]
Work with assoc types in a super trait.

And fix a bug with type param visibility though the Self rib.

9 years agoUpdate intro.md
Xue Fuqiao [Tue, 7 Apr 2015 05:35:26 +0000 (13:35 +0800)]
Update intro.md

Use HTTPS where possible to avoid plaintext HTTP connections.

9 years agoAuto merge of #24101 - remram44:fix-rustdoc-passes-help, r=nikomatsakis
bors [Tue, 7 Apr 2015 04:52:03 +0000 (04:52 +0000)]
Auto merge of #24101 - remram44:fix-rustdoc-passes-help, r=nikomatsakis

The current help string ("space separated list") suggests that `--passes "pass1 pass2"` is expected; the orrect usage is `--passes pass1 --passes pass2`.

9 years agoProvide context for macro expansions which result in unparsed tokens.
Will Hipschman [Sat, 4 Apr 2015 20:13:57 +0000 (13:13 -0700)]
Provide context for macro expansions which result in unparsed tokens.

Issue #22425

9 years agoAuto merge of #23952 - Kimundi:more_string_pattern, r=alexcrichton
bors [Tue, 7 Apr 2015 00:57:08 +0000 (00:57 +0000)]
Auto merge of #23952 - Kimundi:more_string_pattern, r=alexcrichton

This adds the missing methods and turns `str::pattern` in a user facing module, as per RFC.

This also contains some big internal refactorings:
- string iterator pairs are implemented with a central macro to reduce redundancy
- Moved all tests from `coretest::str` into `collectionstest::str` and left a note to prevent the two sets of tests drifting apart further.

See https://github.com/rust-lang/rust/issues/22477

9 years agouse normative source for Grapheme class data
kwantam [Mon, 6 Apr 2015 23:42:18 +0000 (19:42 -0400)]
use normative source for Grapheme class data

@mahkoh points out in #15628 that unicode.py does not use
normative data for Grapheme classes. This pr fixes that issue.

In addition, GC_RegionalIndicator is renamed GC_Regional_Indicator
in order to stay in line with the Unicode class name definitions.
I have updated refs in u_str.rs, and verified that there are no
refs elsewhere in the codebase. However, in principle someone
using the unicode tables for their own purposes might see breakage
from this.

9 years agoAuto merge of #23857 - phildawes:libsyntax_nopanic, r=nikomatsakis
bors [Mon, 6 Apr 2015 22:08:01 +0000 (22:08 +0000)]
Auto merge of #23857 - phildawes:libsyntax_nopanic, r=nikomatsakis

Hello!

I've been working towards a libsyntax without panics. See:
http://internals.rust-lang.org/t/changing-libsyntax-to-use-result-instead-of-panic/1670

This patch changes the internals of parser.rs to use Result<> rather than panicing. It keeps the following old-style panicing functions as a facade:
parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt

I left these functions because I wasn't sure what to do about the quote_* macros or how many syntax-extensions would break if these and quoting macros returned Result.

The gyst of the rest of the patch is:

 - Functions in parse/parser.rs return PResult<> rather than panicing
 - Other functions in libsyntax call panic! explicitly if they rely on panicing behaviour.
 - I added a macro 'panictry!()' to act as scaffolding for callers while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()).

Am I on the right track?  I'd quite like to get something merged soon as keeping this rebased in the face of libsyntax changes is a lot of work. Please let me know what changes you'd like to see to make this happen.

Thanks!, Phil

9 years agoAuto merge of #23655 - gereeter:rustc-remove-ident, r=sanxiyn
bors [Mon, 6 Apr 2015 19:20:39 +0000 (19:20 +0000)]
Auto merge of #23655 - gereeter:rustc-remove-ident, r=sanxiyn

...of #6993.

cc @pcwalton