]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoremove confusing 1i32
Steve Klabnik [Mon, 15 Jun 2015 16:42:07 +0000 (12:42 -0400)]
remove confusing 1i32

The font can make this hard to read, and we don't even strictly need
the annotation, so let's just remove it

Fixes #26287

9 years agoAuto merge of #26307 - nrc:save-bugs, r=cmr
bors [Mon, 15 Jun 2015 09:02:31 +0000 (09:02 +0000)]
Auto merge of #26307 - nrc:save-bugs, r=cmr

r? @brson (or anyone, really)

9 years agoAuto merge of #26168 - sfackler:stdout-panic, r=alexcrichton
bors [Mon, 15 Jun 2015 06:44:42 +0000 (06:44 +0000)]
Auto merge of #26168 - sfackler:stdout-panic, r=alexcrichton

Closes #25977

The various `stdfoo_raw` methods in std::io now return `io::Result`s,
since they may not exist on Windows. They will always return `Ok` on
Unix-like platforms.

[breaking-change]

9 years agosave-analysis: fix a couple of span bugs
Nick Cameron [Mon, 15 Jun 2015 05:58:10 +0000 (17:58 +1200)]
save-analysis: fix a couple of span bugs

9 years agoAuto merge of #25359 - thepowersgang:result-expect-2, r=alexcrichton
bors [Mon, 15 Jun 2015 05:11:53 +0000 (05:11 +0000)]
Auto merge of #25359 - thepowersgang:result-expect-2, r=alexcrichton

As it says in the title. I've added an `expect` method to `Result` that allows printing both an error message (e.g. what operation was attempted), and the error value. This is separate from the `unwrap` and `ok().expect("message")` behaviours.

9 years agolibcore/Result - RFC#1119 Add an 'expect' method to Result
John Hodge [Sat, 13 Jun 2015 14:34:58 +0000 (22:34 +0800)]
libcore/Result - RFC#1119 Add an 'expect' method to Result

9 years agoImplement RFC 1014
Steven Fackler [Wed, 10 Jun 2015 04:39:36 +0000 (21:39 -0700)]
Implement RFC 1014

Closes #25977

The various `stdfoo_raw` methods in std::io now return `io::Result`s,
since they may not exist on Windows. They will always return `Ok` on
Unix-like platforms.

[breaking-change]

9 years agoAuto merge of #26290 - michaelsproul:url-line-limit, r=alexcrichton
bors [Mon, 15 Jun 2015 01:57:17 +0000 (01:57 +0000)]
Auto merge of #26290 - michaelsproul:url-line-limit, r=alexcrichton

The plugin that enforces error explanation line-length is a bit restrictive, particularly when attempting to use URLs in explanations (cf #26163).

Jashank will still have to do some mucking around with `#[cfg(not(stage0))]` attributes or else wait until a snapshot with this commit lands.

9 years agoAuto merge of #26265 - retep998:heapalloc, r=alexcrichton
bors [Mon, 15 Jun 2015 00:24:31 +0000 (00:24 +0000)]
Auto merge of #26265 - retep998:heapalloc, r=alexcrichton

This removes our dependency on the CRT for memory allocation.

9 years agoAuto merge of #26110 - nrc:save-api-3, r=brson
bors [Sun, 14 Jun 2015 22:47:55 +0000 (22:47 +0000)]
Auto merge of #26110 - nrc:save-api-3, r=brson

r? @huonw

9 years agoRebasing and bug fixing
Nick Cameron [Sun, 14 Jun 2015 22:06:01 +0000 (10:06 +1200)]
Rebasing and bug fixing

9 years agoAuto merge of #26213 - semarie:openbsd-morestack, r=alexcrichton
bors [Sun, 14 Jun 2015 21:15:32 +0000 (21:15 +0000)]
Auto merge of #26213 - semarie:openbsd-morestack, r=alexcrichton

don't try to bind __morestack symbol under OpenBSD as the platform don't
have morestack support.

r? @alexcrichton

it unbreak build under OpenBSD. Does some others platforms don't have morestack too ? They should be impacted by this problem too.

9 years agosave-analysis: use a macro for 'downcasting'
Nick Cameron [Mon, 8 Jun 2015 22:36:30 +0000 (10:36 +1200)]
save-analysis: use a macro for 'downcasting'

9 years agosave-analysis: API-ify struct lits
Nick Cameron [Mon, 8 Jun 2015 21:51:54 +0000 (09:51 +1200)]
save-analysis: API-ify struct lits

9 years agosave-analysis: merge StructRef and TypeRef
Nick Cameron [Mon, 8 Jun 2015 05:47:52 +0000 (17:47 +1200)]
save-analysis: merge StructRef and TypeRef

9 years agosave-analysis: API-ify impls
Nick Cameron [Fri, 5 Jun 2015 05:50:04 +0000 (17:50 +1200)]
save-analysis: API-ify impls

9 years agosave-analysis: move fields to the API
Nick Cameron [Fri, 5 Jun 2015 04:03:48 +0000 (16:03 +1200)]
save-analysis: move fields to the API

9 years agoAuto merge of #26071 - petrochenkov:assert1, r=alexcrichton
bors [Sun, 14 Jun 2015 19:42:26 +0000 (19:42 +0000)]
Auto merge of #26071 - petrochenkov:assert1, r=alexcrichton

`assert_eq!` has better diagnostics than `assert!` and is more helpful when something actually breaks, but the diagnostics has it's price - `assert_eq!` generate some formatting code which is slower to compile and possibly run.
[My measurements](https://internals.rust-lang.org/t/assert-a-b-or-assert-eq-a-b/1367/12?u=petrochenkov) show that presence of this formatting code doesn't affect compilation + execution time of the test suite significantly, so `assert_eq!` can be used instead of `assert!` consistently.

(Some tests doesn't reside in src/test, they are not affected by these changes, I'll probably open a separate PR for them later)

9 years agoAuto merge of #26296 - aidanhs:aphs-fix-musl-make-install, r=alexcrichton
bors [Sun, 14 Jun 2015 17:18:25 +0000 (17:18 +0000)]
Auto merge of #26296 - aidanhs:aphs-fix-musl-make-install, r=alexcrichton

musl only creates rlib files for stdlib linking so we need to ignore the `CFG_LIB_GLOB_` setting, otherwise we an error:
```
$ make --debug VERBOSE=1 dist-tar-bins
[...]
            Successfully remade target file `prepare-target-x86_64-unknown-linux-gnu-host-x86_64-unknown-linux-gnu-2-dir-x86_64-unknown-linux-gnu'.
             File `prepare-target-x86_64-unknown-linux-musl-host-x86_64-unknown-linux-gnu-2-dir-x86_64-unknown-linux-gnu' does not exist.
            Must remake target `prepare-target-x86_64-unknown-linux-musl-host-x86_64-unknown-linux-gnu-2-dir-x86_64-unknown-linux-gnu'.
umask 022 && mkdir -p tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknown-linux-musl/lib
umask 022 && mkdir -p tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknown-linux-gnu/bin
LIB_NAME="liblibc-d8ace771.rlib"; MATCHES=""; if [ -n "$MATCHES" ]; then echo "warning: one or libraries matching Rust library 'liblibc-*.rlib'" && echo "  (other than '$LIB_NAME' itself) alre
ady present"     && echo "  at destination tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknown-linux-musl/lib:"      && echo $MATCHES ; fi
install -m644 `ls -drt1 x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-*.rlib` tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unk
nown-linux-musl/lib/
LIB_NAME=""; MATCHES=""; if [ -n "$MATCHES" ]; then echo "warning: one or libraries matching Rust library 'libstd-*.so'" && echo "  (other than '$LIB_NAME' itself) already present"     && echo
 "  at destination tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknown-linux-musl/lib:"      && echo $MATCHES ; fi
install -m644 `ls -drt1 x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-*.so` tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknow
n-linux-musl/lib/
ls: cannot access x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-*.so: No such file or directory
install: missing destination file operand after ‘tmp/dist/rustc-1.2.0-dev-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknown-linux-musl/lib/’
Try 'install --help' for more information.
make: *** [prepare-target-x86_64-unknown-linux-musl-host-x86_64-unknown-linux-gnu-2-dir-x86_64-unknown-linux-gnu] Error 1
```

`CFG_INSTALL_ONLY_RLIB_` is provided for this reason and fixes `make install` and `make dist`.

9 years agomusl only uses rlib files for stdlib linking
Aidan Hobson Sayers [Sun, 14 Jun 2015 15:18:51 +0000 (16:18 +0100)]
musl only uses rlib files for stdlib linking

9 years agoAuto merge of #26252 - bluss:relative-paths, r=alexcrichton
bors [Sun, 14 Jun 2015 11:20:36 +0000 (11:20 +0000)]
Auto merge of #26252 - bluss:relative-paths, r=alexcrichton

mk: Build crates with relative source file paths

The path we pass to rustc will be visible in panic messages and
backtraces: they will be user visible!

Avoid junk in these paths by passing relative paths to rustc.

For most advanced users, `libcore` or `libstd` in the path will be
a clue to the location -- inside our code, not theirs.

Store both the relative path to the source as well as the absolute.
Use the relative path where it matters, compiling the main crates,
instead of changing all of the build process to cope with relative
paths.

Example output after this patch:

```
$ ./testunwrap
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:362
$ RUST_BACKTRACE=1 ./testunwrap
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:362
stack backtrace:
   1:     0x7ff59c1e9956 - sys::backtrace::write::h67a542fd2b201576des
                        at ../src/libstd/sys/unix/backtrace.rs:158
   2:     0x7ff59c1ed5b6 - panicking::on_panic::h3d21c41cdd5c12d41Xw
                        at ../src/libstd/panicking.rs:58
   3:     0x7ff59c1e7b6e - rt::unwind::begin_unwind_inner::h9f3a5440cebb8baeLDw
                        at ../src/libstd/rt/unwind/mod.rs:273
   4:     0x7ff59c1e7f84 - rt::unwind::begin_unwind_fmt::h4fe8a903e0c296b0RCw
                        at ../src/libstd/rt/unwind/mod.rs:212
   5:     0x7ff59c1eced7 - rust_begin_unwind
   6:     0x7ff59c22c11a - panicking::panic_fmt::h00b0cd49c98a9220i5B
                        at ../src/libcore/panicking.rs:64
   7:     0x7ff59c22b9e0 - panicking::panic::hf549420c0ee03339P3B
                        at ../src/libcore/panicking.rs:45
   8:     0x7ff59c1e621d - option::Option<T>::unwrap::h501963526474862829
   9:     0x7ff59c1e61b1 - main::hb5c91ce92347d1e6eaa
  10:     0x7ff59c1f1c18 - rust_try_inner
  11:     0x7ff59c1f1c05 - rust_try
  12:     0x7ff59c1ef374 - rt::lang_start::h7e51e19c6677cffe5Sw
                        at ../src/libstd/rt/unwind/mod.rs:147
                        at ../src/libstd/rt/unwind/mod.rs:130
                        at ../src/libstd/rt/mod.rs:128
  13:     0x7ff59c1e628e - main
  14:     0x7ff59b3f6b44 - __libc_start_main
  15:     0x7ff59c1e6078 - <unknown>
  16:                0x0 - <unknown>
```

9 years agodiagnostics: Allow long URLs in error explanations.
Michael Sproul [Sun, 14 Jun 2015 08:46:32 +0000 (18:46 +1000)]
diagnostics: Allow long URLs in error explanations.

9 years agoinverse the logic in code inclusion
Sébastien Marie [Thu, 11 Jun 2015 06:12:07 +0000 (08:12 +0200)]
inverse the logic in code inclusion

instead of enumerate the (long) list of platforms to exclude, use only
the short list of platforms to include.

should fixes __morestack symbol problem under openbsd

9 years agoAuto merge of #26285 - rick68:patch-3, r=alexcrichton
bors [Sun, 14 Jun 2015 04:21:47 +0000 (04:21 +0000)]
Auto merge of #26285 - rick68:patch-3, r=alexcrichton

`FormatError` is not exist anymore.

9 years agoUpdate mod.rs
Wei-Ming Yang [Sun, 14 Jun 2015 03:32:04 +0000 (11:32 +0800)]
Update mod.rs

`FormatError` is not exist anymore.

9 years agoAuto merge of #26278 - tamird:compiletest, r=alexcrichton
bors [Sat, 13 Jun 2015 23:35:28 +0000 (23:35 +0000)]
Auto merge of #26278 - tamird:compiletest, r=alexcrichton

9 years agoAuto merge of #26250 - steveklabnik:remove_html_literals_test, r=alexcrichton
bors [Sat, 13 Jun 2015 22:03:42 +0000 (22:03 +0000)]
Auto merge of #26250 - steveklabnik:remove_html_literals_test, r=alexcrichton

This test now works again

Fixes #20673

r? @alexcrichton

9 years agoAuto merge of #26249 - steveklabnik:remove_extern_panic, r=alexcrichton
bors [Sat, 13 Jun 2015 20:33:53 +0000 (20:33 +0000)]
Auto merge of #26249 - steveklabnik:remove_extern_panic, r=alexcrichton

This test has an interesting history, because of fail -> panic. It was
originally called extern-fail.rs:
https://github.com/rust-lang/rust/commits/master/src/test/run-fail/extern-fail.rs

It lived for a while, but was disabled in August 2013:
https://github.com/rust-lang/rust/commit/ce95b01014391f29a655d165d9e6d31449ceb835

As you can see, that failure was not specific to this test, however,
this code does stuff with the runtime, which was removed. Given that
it hasn't even been able to compile in a long time, we should just
remove it.

r? @brson

9 years agoSwitch to direct HeapAlloc on Windows when not using jemalloc
Peter Atashian [Sat, 13 Jun 2015 19:13:16 +0000 (15:13 -0400)]
Switch to direct HeapAlloc on Windows when not using jemalloc

Signed-off-by: Peter Atashian <retep998@gmail.com>
9 years agoAuto merge of #26277 - aidanhs:aphs-dont-make-random-directories, r=alexcrichton
bors [Sat, 13 Jun 2015 17:14:51 +0000 (17:14 +0000)]
Auto merge of #26277 - aidanhs:aphs-dont-make-random-directories, r=alexcrichton

The last commit is optional. If you opt not to take it I can improve on the 'this is magic' comment.

9 years agocompiletest: remove JIT
Tamir Duberstein [Sat, 13 Jun 2015 16:53:07 +0000 (12:53 -0400)]
compiletest: remove JIT

9 years agoReplace nop hack, explain substitution reasoning
Aidan Hobson Sayers [Sat, 13 Jun 2015 16:07:23 +0000 (17:07 +0100)]
Replace nop hack, explain substitution reasoning

9 years agonop hack required for PREPARE_DIR (PREPARE_MAN for safety)
Aidan Hobson Sayers [Sat, 13 Jun 2015 15:49:25 +0000 (16:49 +0100)]
nop hack required for PREPARE_DIR (PREPARE_MAN for safety)

Fixes #26274

9 years agoNo need to double-silence
Aidan Hobson Sayers [Sat, 13 Jun 2015 15:48:19 +0000 (16:48 +0100)]
No need to double-silence

9 years agoAuto merge of #26272 - Manishearth:rollup, r=Manishearth
bors [Sat, 13 Jun 2015 14:02:25 +0000 (14:02 +0000)]
Auto merge of #26272 - Manishearth:rollup, r=Manishearth

- Successful merges: #26255, #26256, #26257, #26259, #26260
- Failed merges:

9 years agoRollup merge of #26260 - tshepang:improve-example, r=steveklabnik
Manish Goregaokar [Sat, 13 Jun 2015 12:33:56 +0000 (18:03 +0530)]
Rollup merge of #26260 - tshepang:improve-example, r=steveklabnik

9 years agoRollup merge of #26259 - tshepang:case-examples, r=steveklabnik
Manish Goregaokar [Sat, 13 Jun 2015 12:33:56 +0000 (18:03 +0530)]
Rollup merge of #26259 - tshepang:case-examples, r=steveklabnik

9 years agoRollup merge of #26257 - Tonkpils:patch-1, r=alexcrichton
Manish Goregaokar [Sat, 13 Jun 2015 12:33:55 +0000 (18:03 +0530)]
Rollup merge of #26257 - Tonkpils:patch-1, r=alexcrichton

9 years agoRollup merge of #26256 - steveklabnik:gh25915, r=alexcrichton
Manish Goregaokar [Sat, 13 Jun 2015 12:33:55 +0000 (18:03 +0530)]
Rollup merge of #26256 - steveklabnik:gh25915, r=alexcrichton

Fixes #25915

9 years agoRollup merge of #26255 - steveklabnik:gh25499, r=alexcrichton
Manish Goregaokar [Sat, 13 Jun 2015 12:33:55 +0000 (18:03 +0530)]
Rollup merge of #26255 - steveklabnik:gh25499, r=alexcrichton

Fixes #25499

9 years agoUse `assert_eq!` instead of `assert!` in tests
petrochenkov [Sun, 7 Jun 2015 18:00:38 +0000 (21:00 +0300)]
Use `assert_eq!` instead of `assert!` in tests

9 years agoAuto merge of #26267 - eefriedman:split-tyarray, r=eddyb
bors [Sat, 13 Jun 2015 11:42:24 +0000 (11:42 +0000)]
Auto merge of #26267 - eefriedman:split-tyarray, r=eddyb

Arrays and slices are closely related, but not that closely; making the
separation more explicit is generally more clear.

9 years agoAuto merge of #26253 - steveklabnik:remove_old_ignored_tests, r=brson
bors [Sat, 13 Jun 2015 10:08:51 +0000 (10:08 +0000)]
Auto merge of #26253 - steveklabnik:remove_old_ignored_tests, r=brson

Two commits here: one which removes a bunch of tests, and re-enables a few that work.

Second updates the syntax of one of the failing tests. It still doesn't pass, but at least it compiles.

9 years agoAuto merge of #26118 - tshepang:define-trait, r=steveklabnik
bors [Sat, 13 Jun 2015 08:34:12 +0000 (08:34 +0000)]
Auto merge of #26118 - tshepang:define-trait, r=steveklabnik

I saw a variation of this definition in [an article](http://pcwalton.github.io/blog/2012/08/08/a-gentle-introduction-to-traits-in-rust) by @pcwalton.

9 years agoAuto merge of #26108 - Marwes:field_pun_docs, r=steveklabnik
bors [Sat, 13 Jun 2015 07:00:26 +0000 (07:00 +0000)]
Auto merge of #26108 - Marwes:field_pun_docs, r=steveklabnik

Adds a mention for the short form pattern syntax. Now without creating a PR to my own fork!

#25779

9 years agoAuto merge of #26248 - steveklabnik:remove_2061, r=alexcrichton
bors [Sat, 13 Jun 2015 03:29:40 +0000 (03:29 +0000)]
Auto merge of #26248 - steveklabnik:remove_2061, r=alexcrichton

This test was added on Nov 1, 2012:
https://github.com/rust-lang/rust/commit/0069bd2f4612b744ab3731b4c1db13c2f3202185#diff-b516ff69faf8886c48e6f5e833c2548c

and then ignored on the same day:
https://github.com/rust-lang/rust/commit/a90020fe8dd8be8615df82e6294408bfed82a767#diff-b516ff69faf8886c48e6f5e833c2548c

and never unignored again.

9 years agoAuto merge of #26247 - steveklabnik:remove_4120, r=alexcrichton
bors [Sat, 13 Jun 2015 01:23:26 +0000 (01:23 +0000)]
Auto merge of #26247 - steveklabnik:remove_4120, r=alexcrichton

This test originated from an ICE in Rust 0.4:
https://github.com/rust-lang/rust/commit/373504a7ac6801293ae65316625ace667842f5b8#diff-214656000770dff71c8165d051c3f027

it was ignored one day later:
https://github.com/rust-lang/rust/commit/1fa2b9980fabff3227d5e5915d1180a0f6922d37#diff-214656000770dff71c8165d051c3f027

and then never enabled again. I think we're safe without it.

9 years agoSplit TyArray into TyArray and TySlice.
Eli Friedman [Fri, 12 Jun 2015 23:50:13 +0000 (16:50 -0700)]
Split TyArray into TyArray and TySlice.

Arrays and slices are closely related, but not that closely; making the
separation more explicit is generally more clear.

9 years agomk: Build crates with relative paths to rustc
Ulrik Sverdrup [Fri, 12 Jun 2015 17:40:07 +0000 (19:40 +0200)]
mk: Build crates with relative paths to rustc

The path we pass to rustc will be visible in panic messages and
backtraces: they will be user visible!

Avoid junk in these paths by passing relative paths to rustc.

For most advanced users, `libcore` or `libstd` in the path will be
a clue to the location -- inside our code, not theirs.

Store both the relative path to the source as well as the absolute.
Use the relative path where it matters, compiling the main crates,
instead of changing all of the build process to cope with relative
paths.

Example output after this patch:

```
$ ./testunwrap
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:362
$ RUST_BACKTRACE=1 ./testunwrap
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:362
stack backtrace:
   1:     0x7ff59c1e9956 - sys::backtrace::write::h67a542fd2b201576des
                        at ../src/libstd/sys/unix/backtrace.rs:158
   2:     0x7ff59c1ed5b6 - panicking::on_panic::h3d21c41cdd5c12d41Xw
                        at ../src/libstd/panicking.rs:58
   3:     0x7ff59c1e7b6e - rt::unwind::begin_unwind_inner::h9f3a5440cebb8baeLDw
                        at ../src/libstd/rt/unwind/mod.rs:273
   4:     0x7ff59c1e7f84 - rt::unwind::begin_unwind_fmt::h4fe8a903e0c296b0RCw
                        at ../src/libstd/rt/unwind/mod.rs:212
   5:     0x7ff59c1eced7 - rust_begin_unwind
   6:     0x7ff59c22c11a - panicking::panic_fmt::h00b0cd49c98a9220i5B
                        at ../src/libcore/panicking.rs:64
   7:     0x7ff59c22b9e0 - panicking::panic::hf549420c0ee03339P3B
                        at ../src/libcore/panicking.rs:45
   8:     0x7ff59c1e621d - option::Option<T>::unwrap::h501963526474862829
   9:     0x7ff59c1e61b1 - main::hb5c91ce92347d1e6eaa
  10:     0x7ff59c1f1c18 - rust_try_inner
  11:     0x7ff59c1f1c05 - rust_try
  12:     0x7ff59c1ef374 - rt::lang_start::h7e51e19c6677cffe5Sw
                        at ../src/libstd/rt/unwind/mod.rs:147
                        at ../src/libstd/rt/unwind/mod.rs:130
                        at ../src/libstd/rt/mod.rs:128
  13:     0x7ff59c1e628e - main
  14:     0x7ff59b3f6b44 - __libc_start_main
  15:     0x7ff59c1e6078 - <unknown>
  16:                0x0 - <unknown>
```

9 years agoAuto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturon
bors [Fri, 12 Jun 2015 23:05:06 +0000 (23:05 +0000)]
Auto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturon

This is a revert of PR #26008 which caused the unintended breakage reported in #26096. We may want to add these implementations in the long run, but for now this revert allows us to take some more time to evaluate the impact of such a change (e.g. run it through crater).

Closes #26096

9 years agodoc: 'c' feels more suitable than 'i' for representing characters
Tshepang Lekhonkhobe [Fri, 12 Jun 2015 22:01:16 +0000 (00:01 +0200)]
doc: 'c' feels more suitable than 'i' for representing characters

9 years agodoc: improve escape_unicode example
Tshepang Lekhonkhobe [Fri, 12 Jun 2015 21:58:32 +0000 (23:58 +0200)]
doc: improve escape_unicode example

Looks better without all that wasted whitespace

9 years agodoc: add examples for to_uppercase and to_lowercase
Tshepang Lekhonkhobe [Fri, 12 Jun 2015 21:47:54 +0000 (23:47 +0200)]
doc: add examples for to_uppercase and to_lowercase

9 years agoAuto merge of #25844 - alexcrichton:stabilize-fs-features, r=aturon
bors [Fri, 12 Jun 2015 21:31:37 +0000 (21:31 +0000)]
Auto merge of #25844 - alexcrichton:stabilize-fs-features, r=aturon

This commit stabilizes the following APIs, slating them all to be cherry-picked
into the 1.1 release.

* fs::FileType (and transitively the derived trait implementations)
* fs::Metadata::file_type
* fs::FileType::is_dir
* fs::FileType::is_file
* fs::FileType::is_symlink
* fs::DirEntry::metadata
* fs::DirEntry::file_type
* fs::DirEntry::file_name
* fs::set_permissions
* fs::symlink_metadata
* os::raw::{self, *}
* os::{android, bitrig, linux, ...}::raw::{self, *}
* os::{android, bitrig, linux, ...}::fs::MetadataExt
* os::{android, bitrig, linux, ...}::fs::MetadataExt::as_raw_stat
* os::unix::fs::PermissionsExt
* os::unix::fs::PermissionsExt::mode
* os::unix::fs::PermissionsExt::set_mode
* os::unix::fs::PermissionsExt::from_mode
* os::unix::fs::OpenOptionsExt
* os::unix::fs::OpenOptionsExt::mode
* os::unix::fs::DirEntryExt
* os::unix::fs::DirEntryExt::ino
* os::windows::fs::MetadataExt
* os::windows::fs::MetadataExt::file_attributes
* os::windows::fs::MetadataExt::creation_time
* os::windows::fs::MetadataExt::last_access_time
* os::windows::fs::MetadataExt::last_write_time
* os::windows::fs::MetadataExt::file_size

The `os::unix::fs::Metadata` structure was also removed entirely, moving all of
its associated methods into the `os::unix::fs::MetadataExt` trait instead. The
methods are all marked as `#[stable]` still.

As some minor cleanup, some deprecated and unstable fs apis were also removed:

* File::path
* Metadata::accessed
* Metadata::modified

Features that were explicitly left unstable include:

* fs::WalkDir - the semantics of this were not considered in the recent fs
  expansion RFC.
* fs::DirBuilder - it's still not 100% clear if the naming is right here and if
  the set of functionality exposed is appropriate.
* fs::canonicalize - the implementation on Windows here is specifically in
  question as it always returns a verbatim path. Additionally the Unix
  implementation is susceptible to buffer overflows on long paths unfortunately.
* fs::PathExt - as this is just a convenience trait, it is not stabilized at
  this time.
* fs::set_file_times - this funciton is still waiting on a time abstraction.

9 years agousize -> u32 to match previous example
Leo Correa [Fri, 12 Jun 2015 19:59:39 +0000 (15:59 -0400)]
usize -> u32 to match previous example

9 years agoAuto merge of #26232 - eefriedman:rename-sty, r=nrc
bors [Fri, 12 Jun 2015 19:57:27 +0000 (19:57 +0000)]
Auto merge of #26232 - eefriedman:rename-sty, r=nrc

Use camel-case naming, and use names which actually make sense in modern Rust.

9 years agoFix up wording in lifetime elision docs
Steve Klabnik [Fri, 12 Jun 2015 19:05:09 +0000 (15:05 -0400)]
Fix up wording in lifetime elision docs

Fixes #25915

9 years agoRemove unstable feature from TRPL: iterators
Steve Klabnik [Fri, 12 Jun 2015 19:00:15 +0000 (15:00 -0400)]
Remove unstable feature from TRPL: iterators

Fixes #25499

9 years agoAuto merge of #26221 - sanxiyn:wf-span, r=arielb1
bors [Fri, 12 Jun 2015 18:25:55 +0000 (18:25 +0000)]
Auto merge of #26221 - sanxiyn:wf-span, r=arielb1

When checking field types of struct or enum definitions, use spans for field types instead of the entire item.

9 years agoRe-enable html literals test
Steve Klabnik [Fri, 12 Jun 2015 18:19:05 +0000 (14:19 -0400)]
Re-enable html literals test

It's now passing again.

Fixes #20673

9 years agoUpdate dead-code-closure-bang
Steve Klabnik [Fri, 12 Jun 2015 18:15:57 +0000 (14:15 -0400)]
Update dead-code-closure-bang

This stdlib function went away, so update it to use current syntax.

9 years agoignore-test cleanup
Steve Klabnik [Fri, 12 Jun 2015 17:36:41 +0000 (13:36 -0400)]
ignore-test cleanup

Most of these are old, but some specific messages for specific tests:

* trait-contravariant-self.rs: failed due to a soundess hole:
  https://github.com/rust-lang/rust/commit/05e3248a7974f55b64f75a2483b37ff8c001a4ff

* process-detatch: https://github.com/rust-lang/rust/commit/15966c3c1f99810ac81053769651776a67181dae
  says "this test is being ignored until signals are implemented" That's
  not happening for a long time, and when it is, we'll write tests for
  it.

* deep-vector{,2}.rs: "too big for our poor macro infrastructure", and has
  been ignored over a year.

* borrowck-nested-calls.rs's FIXME #6268 was closed in favor of
  rust-lang/rfcs#811

* issue-15167.rs works properly now
* issue-9737.rs works properly now
* match-var-hygiene.rs works properly now

Addresses a chunk of #3965

9 years agoCleanup: rename middle::ty::sty and its variants.
Eli Friedman [Thu, 11 Jun 2015 23:21:46 +0000 (16:21 -0700)]
Cleanup: rename middle::ty::sty and its variants.

Use camel-case naming, and use names which actually make sense in modern Rust.

9 years agoRemove old runtime panic test
Steve Klabnik [Fri, 12 Jun 2015 17:11:17 +0000 (13:11 -0400)]
Remove old runtime panic test

This test has an interesting history, because of fail -> panic. It was
originally called extern-fail.rs:
https://github.com/rust-lang/rust/commits/master/src/test/run-fail/extern-fail.rs

It lived for a while, but was disabled in August 2013:
https://github.com/rust-lang/rust/commit/ce95b01014391f29a655d165d9e6d31449ceb835

As you can see, that failure was not specific to this test, however,
this code does stuff with the runtime, which was removed. Given that
it hasn't even been able to compile in a long time, we should just
remove it.

9 years agoRemove ignored test for #2061
Steve Klabnik [Fri, 12 Jun 2015 17:02:50 +0000 (13:02 -0400)]
Remove ignored test for #2061

This test was added on Nov 1, 2012:
https://github.com/rust-lang/rust/commit/0069bd2f4612b744ab3731b4c1db13c2f3202185#diff-b516ff69faf8886c48e6f5e833c2548c

and then ignored on the same day:
https://github.com/rust-lang/rust/commit/a90020fe8dd8be8615df82e6294408bfed82a767#diff-b516ff69faf8886c48e6f5e833c2548c

and never unignored again.

9 years agoRemove ignore'd test for old ICE
Steve Klabnik [Fri, 12 Jun 2015 16:42:41 +0000 (12:42 -0400)]
Remove ignore'd test for old ICE

This test originated from an ICE in Rust 0.4:
https://github.com/rust-lang/rust/commit/373504a7ac6801293ae65316625ace667842f5b8#diff-214656000770dff71c8165d051c3f027

it was ignored one day later:
https://github.com/rust-lang/rust/commit/1fa2b9980fabff3227d5e5915d1180a0f6922d37#diff-214656000770dff71c8165d051c3f027

and then never enabled again. I think we're safe without it.

9 years agoMention the short form pattern syntax in the book
Markus Westerlind [Mon, 8 Jun 2015 21:18:32 +0000 (23:18 +0200)]
Mention the short form pattern syntax in the book

Explains short form pattern syntax and then introduces the longer
pattern matching as a rebinding of the fields instead.

 #25779

9 years agoAuto merge of #26245 - mbrubeck:extern, r=steveklabnik
bors [Fri, 12 Jun 2015 15:15:11 +0000 (15:15 +0000)]
Auto merge of #26245 - mbrubeck:extern, r=steveklabnik

r? @steveklabnik

9 years ago[reference] Fix typo in extern fn section
Matt Brubeck [Fri, 12 Jun 2015 15:08:48 +0000 (08:08 -0700)]
[reference] Fix typo in extern fn section

9 years agoAdd tests for tuple-like structs and dictionary-like enum variants
Seo Sanghyeon [Fri, 12 Jun 2015 12:09:17 +0000 (21:09 +0900)]
Add tests for tuple-like structs and dictionary-like enum variants

9 years agoUse more precise span when checking type definitions
Seo Sanghyeon [Thu, 11 Jun 2015 16:44:42 +0000 (01:44 +0900)]
Use more precise span when checking type definitions

9 years agoAuto merge of #26238 - Manishearth:rollup, r=Manishearth
bors [Fri, 12 Jun 2015 06:25:49 +0000 (06:25 +0000)]
Auto merge of #26238 - Manishearth:rollup, r=Manishearth

- Successful merges: #24495, #26229, #26231
- Failed merges:

9 years agoRollup merge of #26231 - reem:patch-2, r=Gankro
Manish Goregaokar [Fri, 12 Jun 2015 06:25:37 +0000 (11:55 +0530)]
Rollup merge of #26231 - reem:patch-2, r=Gankro

r? @steveklabnik

9 years agoRollup merge of #26229 - Stebalien:versionless-book, r=steveklabnik
Manish Goregaokar [Fri, 12 Jun 2015 06:25:37 +0000 (11:55 +0530)]
Rollup merge of #26229 - Stebalien:versionless-book, r=steveklabnik

They're forever doomed to be out-of-date. Also, don't assume the user is
installing a particular version.

r? @steveklabnik

9 years agoRollup merge of #24495 - nathanl:nathanl-explain-bin-flag, r=steveklabnik
Manish Goregaokar [Fri, 12 Jun 2015 06:25:37 +0000 (11:55 +0530)]
Rollup merge of #24495 - nathanl:nathanl-explain-bin-flag, r=steveklabnik

Explain the --bin flag in terms of the difference
between shipping binary and library code

I'm not sure if my explanation is even quite correct, but as a newbie coming from Ruby, this is my best guess. (In Rubyland, libraries always ship with the source code because there's no other form you can ship. :) )

9 years agoAuto merge of #26224 - mcast:doc-travis2buildbot, r=steveklabnik
bors [Fri, 12 Jun 2015 04:38:02 +0000 (04:38 +0000)]
Auto merge of #26224 - mcast:doc-travis2buildbot, r=steveklabnik

Suggesting this because I was confused by what is now visible from the Travis CI / buildbot split.

Found the hint  in bors comments on d911936d
Couldn't find anything on https://internals.rust-lang.org/

9 years agoAuto merge of #26226 - alexcrichton:fix-msvc-dist, r=brson
bors [Fri, 12 Jun 2015 01:36:55 +0000 (01:36 +0000)]
Auto merge of #26226 - alexcrichton:fix-msvc-dist, r=brson

Right now the distribution tarball for MSVC only includes the *.dll files for
the supporting libraries, but not the corresponding *.lib files which allow
actually linking to the dll. This means that the current MSVC nightlies cannot
produce dynamically linked binaries as the *.lib files are not available to link
against.

This commit modifies the `LIB_GLOB` used to copy the files around to include the
`lib` variant of the `dll`.

9 years agoAuto merge of #26225 - arielb1:raw-self, r=eddyb
bors [Fri, 12 Jun 2015 00:00:27 +0000 (00:00 +0000)]
Auto merge of #26225 - arielb1:raw-self, r=eddyb

This can't be made to work with the current setup.

Technically a [breaking-change], but a simple bug fix.

Fixes #26194.

9 years agoAdd Terminal.com to the list of companies using rust in production.
Jonathan Reem [Thu, 11 Jun 2015 23:07:34 +0000 (16:07 -0700)]
Add Terminal.com to the list of companies using rust in production.

9 years agoAuto merge of #26199 - swgillespie:issue-26092, r=alexcrichton
bors [Thu, 11 Jun 2015 21:35:10 +0000 (21:35 +0000)]
Auto merge of #26199 - swgillespie:issue-26092, r=alexcrichton

`driver::build_output_filenames` calls `file_stem` on a PathBuf obtained from the output file compiler flag. It's possible to pass the empty string to this compiler flag. When file_stem is called on an empty Path, it returns None, which is unwrapped and the compiler panics.

This change modifies the `unwrap` to an `unwrap_or` so that the empty string is passed through the compilation pipeline until it reaches `trans::back::write_output_file`, which will emit an appropriate error.

Instead of panicking, the error that is emitted now is:

```
$ rustc -o "" thing.rs
error: could not write output to : No such file or directory
```

The `:` is a little strange, but it /is/ reporting the filename (the empty string) correctly, I suppose. Both gcc and clang hand the output file to ld, which emits a similar error message when faced with the empty string as an output file:

```
$ clang -o "" thing.c
ld: can't open output file for writing: , errno=2 for architecture x86_64
```

This PR also adds a test for this, in `run-make`. This fixes issue #26092.

9 years agoDon't link to specific versions of rust in the book.
Steven Allen [Thu, 11 Jun 2015 21:30:04 +0000 (17:30 -0400)]
Don't link to specific versions of rust in the book.

They're forever doomed to be out-of-date. Also, don't assume the user is
installing a particular version.

9 years agomk: Tweak the LIB_GLOB for MSVC
Alex Crichton [Thu, 11 Jun 2015 20:50:56 +0000 (13:50 -0700)]
mk: Tweak the LIB_GLOB for MSVC

Right now the distribution tarball for MSVC only includes the *.dll files for
the supporting libraries, but not the corresponding *.lib files which allow
actually linking to the dll. This means that the current MSVC nightlies cannot
produce dynamically linked binaries as the *.lib files are not available to link
against.

This commit modifies the `LIB_GLOB` used to copy the files around to include the
`lib` variant of the `dll`.

9 years agoPrevent raw pointers from being used as an explicit self
Ariel Ben-Yehuda [Thu, 11 Jun 2015 20:45:27 +0000 (23:45 +0300)]
Prevent raw pointers from being used as an explicit self

This can't be made to work with the current setup.

Fixes #26194.

9 years agopoint to buildbot
Matthew Astley [Thu, 11 Jun 2015 09:26:19 +0000 (10:26 +0100)]
point to buildbot

Since 7b6ecc00

9 years agoAuto merge of #26190 - Veedrac:no-iter, r=alexcrichton
bors [Thu, 11 Jun 2015 18:10:08 +0000 (18:10 +0000)]
Auto merge of #26190 - Veedrac:no-iter, r=alexcrichton

Pull request for #26188.

9 years agoAuto merge of #26212 - Manishearth:rollup, r=Manishearth
bors [Thu, 11 Jun 2015 16:33:53 +0000 (16:33 +0000)]
Auto merge of #26212 - Manishearth:rollup, r=Manishearth

- Successful merges: #26181, #26184, #26189, #26191, #26195, #26202
- Failed merges:

9 years agoAuto merge of #26197 - dhuseby:fixing_morestack_breakage, r=brson
bors [Thu, 11 Jun 2015 14:57:13 +0000 (14:57 +0000)]
Auto merge of #26197 - dhuseby:fixing_morestack_breakage, r=brson

Revision 021e483 broke the BSD builds.  This fixes it for Bitrig and probably the others.

9 years agoExplain the `--bin` flag more clearly
Nathan Long [Thu, 16 Apr 2015 10:16:52 +0000 (06:16 -0400)]
Explain the `--bin` flag more clearly

9 years agoAuto merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton
bors [Thu, 11 Jun 2015 13:17:19 +0000 (13:17 +0000)]
Auto merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton

These errors all relate to type checking, specifically the number of function arguments, and occur in librustc_typeck::check::check_argument_types.

Resolves part of #24407.

9 years agoConver reborrows to .iter() calls where appropriate
Joshua Landau [Thu, 11 Jun 2015 12:56:07 +0000 (13:56 +0100)]
Conver reborrows to .iter() calls where appropriate

9 years agoAuto merge of #26177 - jooert:fix26169, r=alexcrichton
bors [Thu, 11 Jun 2015 11:41:24 +0000 (11:41 +0000)]
Auto merge of #26177 - jooert:fix26169, r=alexcrichton

Closes #26169.

r? @steveklabnik

9 years agoAuto merge of #26172 - nham:add_E0116, r=alexcrichton
bors [Thu, 11 Jun 2015 10:06:38 +0000 (10:06 +0000)]
Auto merge of #26172 - nham:add_E0116, r=alexcrichton

Also improves the wording of the E0133 description.

cc #24407

9 years agoAuto merge of #26159 - alexcrichton:tweak-process-lowering-raising, r=brson
bors [Thu, 11 Jun 2015 08:22:39 +0000 (08:22 +0000)]
Auto merge of #26159 - alexcrichton:tweak-process-lowering-raising, r=brson

* Slate these features to be stable in 1.2 instead of 1.1 (not being backported)
* Have the `FromRawFd` implementations follow the contract of the `FromRawFd`
  trait by taking ownership of the primitive specified.
* Refactor the implementations slightly to remove the `unreachable!` blocks as
  well as separating the stdio representation of `std::process` from
  `std::sys::process`.

cc #25494

9 years agoRollup merge of #26202 - nham:revise_E0072, r=alexcrichton
Manish Goregaokar [Thu, 11 Jun 2015 07:20:54 +0000 (12:50 +0530)]
Rollup merge of #26202 - nham:revise_E0072, r=alexcrichton

Converts the size calculation in the explanation from a fenced code block to an indented one. I think it looks better when not rendered, and is the same rendered.

9 years agoRollup merge of #26195 - tshepang:patch-1, r=alexcrichton
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26195 - tshepang:patch-1, r=alexcrichton

9 years agoRollup merge of #26191 - jimblandy:master, r=steveklabnik
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26191 - jimblandy:master, r=steveklabnik

In the discussion of returning closures, it seems like the example code got simplified, but only the later copies got fixed. The final working code has `factory` returning `|x| x + num`, but the earlier code has `|x| vec.push(x)`.

The first form seemed to have more distracting characteristics, and the code wasn't right anyway, so I changed them to all use the second form, and updated the error messages.

r? @steveklabnik

9 years agoRollup merge of #26189 - bluss:iter-once-clone, r=Gankro
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26189 - bluss:iter-once-clone, r=Gankro

core: impl Clone for option::IntoIter and iter::Once

9 years agoRollup merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton

These errors all relate to type checking, specifically the number of function arguments, and occur in librustc_typeck::check::check_argument_types.

Resolves part of #24407.

9 years agoRollup merge of #26181 - Stebalien:fix-26178, r=steveklabnik
Manish Goregaokar [Thu, 11 Jun 2015 07:20:52 +0000 (12:50 +0530)]
Rollup merge of #26181 - Stebalien:fix-26178, r=steveklabnik

The list of in-production users is probably incomplete. It's based on a [post](https://www.reddit.com/r/rust/comments/2x567m/who_is_using_rust_or_what_projects_that_are/cox7eby) by /u/mozilla_kmc

closes #26178

9 years agoAuto merge of #26155 - dhuseby:fixing_bitrig_net_tests, r=alexcrichton
bors [Thu, 11 Jun 2015 06:46:25 +0000 (06:46 +0000)]
Auto merge of #26155 - dhuseby:fixing_bitrig_net_tests, r=alexcrichton

… congruent due to rounding errors

@semarie this affected both openbsd and bitrig.  it seems the correct solution is to switch to fixed point arithmetic in the timeout code, the same as freebsd.