]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #35920 - GuillaumeGomez:err_codes, r=jonathandturner
Jonathan Turner [Wed, 24 Aug 2016 17:35:29 +0000 (10:35 -0700)]
Rollup merge of #35920 - GuillaumeGomez:err_codes, r=jonathandturner

Err codes

r? @jonathandturner

7 years agoRollup merge of #35876 - matthew-piziak:sub-examples, r=GuillaumeGomez
Jonathan Turner [Wed, 24 Aug 2016 17:35:29 +0000 (10:35 -0700)]
Rollup merge of #35876 - matthew-piziak:sub-examples, r=GuillaumeGomez

more evocative examples for `Sub` and `SubAssign`

These examples are exactly analogous to those in PRs #35709 and #35806. I'll probably remove the `fn main` wrappers for `Add` and `Sub` once this is merged in.

Part of #29365.

r? @steveklabnik

7 years agoAdd new error code tests
Guillaume Gomez [Tue, 23 Aug 2016 13:35:59 +0000 (15:35 +0200)]
Add new error code tests

7 years agoAdd error code test checkup
Guillaume Gomez [Tue, 23 Aug 2016 13:35:26 +0000 (15:35 +0200)]
Add error code test checkup

7 years agoAdd E0478 error explanation
Guillaume Gomez [Tue, 23 Aug 2016 13:35:10 +0000 (15:35 +0200)]
Add E0478 error explanation

7 years agoAuto merge of #35748 - michaelwoerister:fix-rust-gdb-py-version-check, r=brson
bors [Wed, 24 Aug 2016 05:52:29 +0000 (22:52 -0700)]
Auto merge of #35748 - michaelwoerister:fix-rust-gdb-py-version-check, r=brson

Make version check in gdb_rust_pretty_printing.py more compatible.

Some versions of Python don't support the `major` field on the object returned by `sys.version_info`.

Fixes #35724

r? @brson

7 years agoAuto merge of #35951 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 23 Aug 2016 23:28:20 +0000 (16:28 -0700)]
Auto merge of #35951 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #35910, #35912, #35913, #35936, #35939, #35949
- Failed merges: #35395

7 years agoRollup merge of #35949 - tshepang:excess, r=GuillaumeGomez
Guillaume Gomez [Tue, 23 Aug 2016 20:48:03 +0000 (22:48 +0200)]
Rollup merge of #35949 - tshepang:excess, r=GuillaumeGomez

doc: one line too many

7 years agoRollup merge of #35939 - creativcoder:e0195, r=jonathandturner
Guillaume Gomez [Tue, 23 Aug 2016 20:48:03 +0000 (22:48 +0200)]
Rollup merge of #35939 - creativcoder:e0195, r=jonathandturner

Update E0195 to new error format

Fixes #35511
Part of #35233

r? @jonathandturner

7 years agoRollup merge of #35936 - matthew-piziak:div-rational-example, r=GuillaumeGomez
Guillaume Gomez [Tue, 23 Aug 2016 20:48:03 +0000 (22:48 +0200)]
Rollup merge of #35936 - matthew-piziak:div-rational-example, r=GuillaumeGomez

replace `Div` example with something more evocative of division

Analogous to PR #35860.

r? @GuillaumeGomez

7 years agoRollup merge of #35913 - frewsxcv:panic, r=steveklabnik
Guillaume Gomez [Tue, 23 Aug 2016 20:48:02 +0000 (22:48 +0200)]
Rollup merge of #35913 - frewsxcv:panic, r=steveklabnik

Mark panicking tests as `should_panic` instead of `no_run`.

None

7 years agoRollup merge of #35912 - brson:rust-installer, r=alexcrichton
Guillaume Gomez [Tue, 23 Aug 2016 20:48:02 +0000 (22:48 +0200)]
Rollup merge of #35912 - brson:rust-installer, r=alexcrichton

Update rust-installer. Fixes #35840

cc @Diggsey

7 years agoRollup merge of #35910 - tbu-:pr_weird_linebreak, r=alexcrichton
Guillaume Gomez [Tue, 23 Aug 2016 20:48:02 +0000 (22:48 +0200)]
Rollup merge of #35910 - tbu-:pr_weird_linebreak, r=alexcrichton

Change a weird line break in `core::str`

7 years agodoc: one line too many
Tshepang Lekhonkhobe [Tue, 23 Aug 2016 20:31:44 +0000 (22:31 +0200)]
doc: one line too many

7 years agoAuto merge of #35854 - nikomatsakis:incr-comp-cache-hash-35549, r=mw
bors [Tue, 23 Aug 2016 18:53:17 +0000 (11:53 -0700)]
Auto merge of #35854 - nikomatsakis:incr-comp-cache-hash-35549, r=mw

compute and cache HIR hashes at beginning

This avoids the compile-time overhead of computing them twice.  It also fixes
an issue where the hash computed after typeck is differen than the hash before,
because typeck mutates the def-map in place.

Fixes #35549.
Fixes #35593.

Some performance measurements suggest this `HashesMap` is very small in memory (unobservable via `-Z time-passes`) and very cheap to construct. I do see some (very minor) performance wins in the incremental case after the first run -- the first run costs more because loading the dep-graph didn't have any hashing to do in that case. Example timings from two runs  of `libsyntex-syntax` -- the (1) indicates first run, (2) indicates second run, and (*) indicates both together:

| Phase | Master | Branch |
| ---- | ---- | ---- |
| compute_hashes_map (1) | N/A | 0.343 |
| load_dep_graph (1) | 0 | 0 |
| serialize dep graph (1) | 4.190 | 3.920 |
| total (1) | 4.190 | 4.260 |
| compute_hashes_map (2) | N/A | 0.344 |
| load_dep_graph (2) | 0.592 | 0.252 |
| serialize dep graph (2) | 4.119 | 3.779 |
| total (2) | 4.71 | 4.375 |
| total (*) | 8.9 | 8.635 |

r? @michaelwoerister

7 years agofix stray comment
Niko Matsakis [Tue, 23 Aug 2016 17:29:28 +0000 (13:29 -0400)]
fix stray comment

7 years agopacify the mercilous tidy
Niko Matsakis [Tue, 23 Aug 2016 17:28:50 +0000 (13:28 -0400)]
pacify the mercilous tidy

7 years agoUpdate E0195 to new error format
Rahul Sharma [Wed, 10 Aug 2016 10:34:11 +0000 (16:04 +0530)]
Update E0195 to new error format

7 years agoreplace `Div` example with something more evocative of division
Matthew Piziak [Tue, 23 Aug 2016 16:09:06 +0000 (12:09 -0400)]
replace `Div` example with something more evocative of division

Analogous to PR #35860.

r? @GuillaumeGomez

7 years agoconsider DepNode::Krate to be an input
Niko Matsakis [Tue, 23 Aug 2016 15:57:27 +0000 (11:57 -0400)]
consider DepNode::Krate to be an input

This seems not only more correct but allows us to write tests that check
whether the krate hash as a whole is clean/dirty

7 years agoAuto merge of #35656 - Stebalien:fused, r=alexcrichton
bors [Tue, 23 Aug 2016 14:46:52 +0000 (07:46 -0700)]
Auto merge of #35656 - Stebalien:fused, r=alexcrichton

Implement 1581 (FusedIterator)

* [ ] Implement on patterns. See https://github.com/rust-lang/rust/issues/27721#issuecomment-239638642.
* [ ] Handle OS Iterators. A bunch of iterators (`Args`, `Env`, etc.) in libstd wrap platform specific iterators. The current ones all appear to be well-behaved but can we assume that future ones will be?
* [ ] Does someone want to audit this? On first glance, all of the iterators on which I implemented `FusedIterator` appear to be well-behaved but there are a *lot* of them so a second pair of eyes would be nice.
* I haven't touched rustc internal iterators (or the internal rand) because rustc doesn't actually call `fuse()`.
* `FusedIterator` can't be implemented on `std::io::{Bytes, Chars}`.

Closes: #35602 (Tracking Issue)
Implements: rust-lang/rfcs#1581

7 years agomake svh independent of item ordering
Niko Matsakis [Tue, 23 Aug 2016 14:42:46 +0000 (10:42 -0400)]
make svh independent of item ordering

7 years agocache def-path hashes across all items
Niko Matsakis [Tue, 23 Aug 2016 11:56:34 +0000 (07:56 -0400)]
cache def-path hashes across all items

This seems like approx a 2x win on syntex_syntax.

7 years agorename HashesMap to IncrementalHashesMap
Niko Matsakis [Tue, 23 Aug 2016 11:47:14 +0000 (07:47 -0400)]
rename HashesMap to IncrementalHashesMap

7 years agoadd regression test for #35593
Niko Matsakis [Tue, 23 Aug 2016 11:40:53 +0000 (07:40 -0400)]
add regression test for #35593

Fixes #35593

7 years agoAuto merge of #35627 - apasel422:coerce-cell, r=alexcrichton
bors [Tue, 23 Aug 2016 11:16:28 +0000 (04:16 -0700)]
Auto merge of #35627 - apasel422:coerce-cell, r=alexcrichton

Implement `CoerceUnsized` for `{Cell, RefCell, UnsafeCell}`

These impls are analogous to the one for `NonZero`. It's occasionally useful to be able to coerce the cell types when they're being used inside another abstraction. See Manishearth/rust-gc#17 for an example.

r? @eddyb

7 years agoAuto merge of #35766 - brson:bump, r=alexcrichton
bors [Tue, 23 Aug 2016 03:51:54 +0000 (20:51 -0700)]
Auto merge of #35766 - brson:bump, r=alexcrichton

Upgrade bootstrap compiler to 1.12

r? @alexcrichton

7 years agoMark panicking tests as `should_panic` instead of `no_run`.
Corey Farwell [Tue, 23 Aug 2016 00:39:20 +0000 (20:39 -0400)]
Mark panicking tests as `should_panic` instead of `no_run`.

7 years agoUpdate rust-installer. Fixes #35840
Brian Anderson [Tue, 23 Aug 2016 00:38:26 +0000 (00:38 +0000)]
Update rust-installer. Fixes #35840

7 years agoChange a weird line break in `core::str`
Tobias Bucher [Tue, 23 Aug 2016 00:05:53 +0000 (02:05 +0200)]
Change a weird line break in `core::str`

7 years agoUpdate cargo bootstrap rev and add fix for cargo#3005
Brian Anderson [Mon, 22 Aug 2016 19:32:54 +0000 (19:32 +0000)]
Update cargo bootstrap rev and add fix for cargo#3005

7 years agoAuto merge of #35908 - jonathandturner:rollup, r=jonathandturner
bors [Mon, 22 Aug 2016 23:59:28 +0000 (16:59 -0700)]
Auto merge of #35908 - jonathandturner:rollup, r=jonathandturner

Rollup of 20 pull requests

- Successful merges: #35360, #35526, #35809, #35817, #35820, #35824, #35835, #35841, #35842, #35858, #35860, #35861, #35864, #35878, #35879, #35881, #35882, #35889, #35891, #35901
- Failed merges: #35395

7 years agoRollup merge of #35901 - terrynsun:configs, r=steveklabnik
Jonathan Turner [Mon, 22 Aug 2016 22:34:23 +0000 (15:34 -0700)]
Rollup merge of #35901 - terrynsun:configs, r=steveklabnik

Add sublime-rust to CONFIGS.md.

Just noticed it was missing!

r? @steveklabnik

7 years agoRollup merge of #35891 - munyari:book, r=steveklabnik
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35891 - munyari:book, r=steveklabnik

Add reference to `Self` in traits chapter (book)

Addresses #31891

"r? @steveklabnik

7 years agoRollup merge of #35889 - alevy:patch-1, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35889 - alevy:patch-1, r=GuillaumeGomez

Minor type in CONTRIBUTING.md

A single missing article

7 years agoRollup merge of #35882 - petrochenkov:patch-2, r=eddyb
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35882 - petrochenkov:patch-2, r=eddyb

rustc: Fix outdated comment

cc https://github.com/rust-lang/rust/issues/35870#issuecomment-241282692

r? @eddyb

7 years agoRollup merge of #35881 - matthew-piziak:rc-would-unwrap-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35881 - matthew-piziak:rc-would-unwrap-example, r=GuillaumeGomez

add example for `Rc::would_unwrap`

Part of #29372

r? @steveklabnik

7 years agoRollup merge of #35879 - CryZe:patch-2, r=apasel422
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35879 - CryZe:patch-2, r=apasel422

Fix "Furthermore" Typo in String Docs

It used to say "Furtheremore" instead of "Furthermore".

7 years agoRollup merge of #35878 - matthew-piziak:ptr-assertions, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35878 - matthew-piziak:ptr-assertions, r=GuillaumeGomez

replace `println!` statements with `assert!`ions in `std::ptr` examples

r? @steveklabnik

7 years agoRollup merge of #35864 - matthew-piziak:index-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35864 - matthew-piziak:index-example, r=GuillaumeGomez

replace `Index` example with something more evocative of indexing

r? @steveklabnik

7 years agoRollup merge of #35861 - matthew-piziak:rem-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35861 - matthew-piziak:rem-example, r=GuillaumeGomez

replace `Rem` example with something more evocative

r? @steveklabnik

7 years agoRollup merge of #35860 - matthew-piziak:mul-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35860 - matthew-piziak:mul-example, r=GuillaumeGomez

replace `Mul` example with something more evocative of multiplication

I may have gone a bit overboard on this one. Numbers are fun.

7 years agoRollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez

E0435, E0437 & E0438 New Error Format

Part of #35801 , #35802 and #35803
r? @GuillaumeGomez

Hi! Please review the changes.

7 years agoRollup merge of #35842 - apasel422:typo, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:20 +0000 (15:34 -0700)]
Rollup merge of #35842 - apasel422:typo, r=GuillaumeGomez

Fix typos in unix/rwlock.rs

r? @steveklabnik

7 years agoRollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:20 +0000 (15:34 -0700)]
Rollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez

Update E0424 to the new error format

Fixes #35797.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #35835 - crypto-universe:E0426, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:20 +0000 (15:34 -0700)]
Rollup merge of #35835 - crypto-universe:E0426, r=jonathandturner

New format for E0426

Issue #35799 as a part of issue #35233
r? jonathandturner

7 years agoRollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner

Err codes

r? @jonathandturner

7 years agoRollup merge of #35820 - knight42:update-error-msg, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35820 - knight42:update-error-msg, r=jonathandturner

Updated E0054, E0423 & E0432 to new error format

Fixes #35791, #35796 and #35344, as part of #35233

r? @jonathandturner

7 years agoRollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner

Update E0503 to the new format

Fixes #35703
Part of #35233

r? @jonathandturner

7 years agoRollup merge of #35809 - matthew-piziak:bitwise-and-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35809 - matthew-piziak:bitwise-and-example, r=GuillaumeGomez

replace `BitAnd` example with something more evocative of bitwise AND

7 years agoRollup merge of #35526 - munyari:e0033, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35526 - munyari:e0033, r=jonathandturner

Update E0033 to the new error format

Part of #35233

Addresses #35498
"r? @jonathandturner

7 years agoRollup merge of #35360 - medzin:E0388, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:18 +0000 (15:34 -0700)]
Rollup merge of #35360 - medzin:E0388, r=jonathandturner

Updated error message E0388

Fixes #35339 as part of #35233.

r? @GuillaumeGomez

7 years agoUpdated error message E0388
Adam Medziński [Fri, 5 Aug 2016 09:27:59 +0000 (11:27 +0200)]
Updated error message E0388

7 years agomore evocative examples for `Sub` and `SubAssign`
Matthew Piziak [Sun, 21 Aug 2016 20:01:27 +0000 (16:01 -0400)]
more evocative examples for `Sub` and `SubAssign`

These examples are exactly analogous to those in PRs #35709 and #35806. I'll probably remove the `fn main` wrappers for `Add` and `Sub` once this is merged in.

Part of #29365.

r? @steveklabnik

7 years agoreplace `BitAnd` example with something more evocative of bitwise AND
Matthew Piziak [Thu, 18 Aug 2016 21:19:17 +0000 (17:19 -0400)]
replace `BitAnd` example with something more evocative of bitwise AND

reformat method chain according to ubsan Rustic Style Guide

https://ubsan.github.io/style/

7 years agoreplace `Mul` example with something more evocative of multiplication
Matthew Piziak [Sat, 20 Aug 2016 18:14:04 +0000 (14:14 -0400)]
replace `Mul` example with something more evocative of multiplication

I may have gone a bit overboard on this one. Numbers are fun.

tone down the error message

7 years agoCorrect failing book test
Panashe M. Fundira [Mon, 22 Aug 2016 16:10:02 +0000 (12:10 -0400)]
Correct failing book test

7 years agoAuto merge of #35871 - bluss:cstring-new, r=alexcrichton
bors [Mon, 22 Aug 2016 15:29:41 +0000 (08:29 -0700)]
Auto merge of #35871 - bluss:cstring-new, r=alexcrichton

cstring: avoid excessive growth just to 0-terminate

Based on following what happens in CString::new("string literal"):

1. Using `Into<Vec<u8>>`, a Vec is allocated with capacity exactly equal
   to the string's input length.
2. By `v.push(0)`, the Vec is grown to twice capacity, since it was full.
3. By `v.into_boxed_slice()`, the Vec capacity is shrunk to fit the length again.

If we use `.reserve_exact(1)` just before the push, then we avoid the
capacity doubling that we're going to have to shrink anyway.

Growing by just 1 byte means that the step (2) is less likely to have to
move the memory to a larger allocation chunk, and that the step (3) does
not have to reallocate.

Addresses part of #35838

7 years agoRemove E0455 test (for now)
ggomez [Mon, 22 Aug 2016 12:53:28 +0000 (14:53 +0200)]
Remove E0455 test (for now)

7 years agoAuto merge of #35848 - Mark-Simulacrum:make-tidy-in-tree, r=alexcrichton
bors [Mon, 22 Aug 2016 12:39:53 +0000 (05:39 -0700)]
Auto merge of #35848 - Mark-Simulacrum:make-tidy-in-tree, r=alexcrichton

Check that executable file is in-tree before failing tidy check

I silenced stdout and stderr for ls-files, not sure if that's appropriate (is `make tidy` intended to give debugging information)? Otherwise it prints each file it find to stdout/stderr, which currently prints nothing (only executable files are checked).

I have not done major testing regarding the behavior of ls-files when the file is ignored, but judging by the man page everything should be fine.

I've duplicated the code which makes the path git-friendly from the `Cargo.lock` checking code; I can extract that into a common helper if wanted (it's only two lines).

Fixes #35689.

7 years ago Updated E0423 to new format
Knight [Mon, 22 Aug 2016 05:57:37 +0000 (13:57 +0800)]
 Updated E0423 to new format

7 years ago Updated E0432 to new format
Knight [Mon, 22 Aug 2016 05:57:10 +0000 (13:57 +0800)]
 Updated E0432 to new format

7 years agoUpdated E0054 to new format
Knight [Mon, 22 Aug 2016 05:51:21 +0000 (13:51 +0800)]
Updated E0054 to new format

7 years agoAuto merge of #35821 - nbaksalyar:solaris-trans-fix, r=alexcrichton
bors [Mon, 22 Aug 2016 05:30:46 +0000 (22:30 -0700)]
Auto merge of #35821 - nbaksalyar:solaris-trans-fix, r=alexcrichton

Fix linker on Solaris/Illumos

This patch provides a fix for the `GnuLinker::export_symbols` function that currently relies on a `--retain-symbols-file` option which is not supported by the Solaris & Illumos linker.

Instead, a [version script](https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html) is used on this platform to achieve the same goal. Here's an example of a similar approach in LLVM's CMake script: https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/AddLLVM.cmake#L88-L94.

Perhaps other platforms like OpenBSD could benefit from this as well. /cc @semarie

7 years agoAdd sublime-rust to CONFIGS.md.
Terry Sun [Mon, 22 Aug 2016 05:19:44 +0000 (01:19 -0400)]
Add sublime-rust to CONFIGS.md.

7 years agoAdd reference to `Self` in traits chapter (book)
Panashe M. Fundira [Mon, 22 Aug 2016 03:09:18 +0000 (23:09 -0400)]
Add reference to `Self` in traits chapter (book)

7 years agoMinor type in CONTRIBUTING.md
Amit Levy [Mon, 22 Aug 2016 02:42:33 +0000 (22:42 -0400)]
Minor type in CONTRIBUTING.md

A single missing article

7 years agoAuto merge of #35777 - nrc:carrier3, r=@nikomatsakis
bors [Sun, 21 Aug 2016 22:12:43 +0000 (15:12 -0700)]
Auto merge of #35777 - nrc:carrier3, r=@nikomatsakis

Carrier trait (third attempt)

This adds a `Carrier` trait to operate with `?`. The only public implementation is for `Result`, so effectively the trait does not exist, however, it ensures future compatibility for the `?` operator. This is not intended to be used, nor is it intended to be a long-term solution.

Although this exact PR has not been through Crater, I do not expect it to be a breaking change based on putting numerous similar PRs though Crater in the past.

cc:
* [? tracking issue](https://github.com/rust-lang/rust/issues/31436)
* [previous PR](https://github.com/rust-lang/rust/pull/35056)
* [RFC issue](https://github.com/rust-lang/rfcs/issues/1718) for discussion of long-term Carrier trait solutions.

r? @nikomatsakis

7 years agoFix type error with `?` in existing code.
Nick Cameron [Sun, 21 Aug 2016 21:31:26 +0000 (09:31 +1200)]
Fix type error with `?` in existing code.

7 years agorustc: Fix outdated comment
Vadim Petrochenkov [Sun, 21 Aug 2016 21:21:13 +0000 (00:21 +0300)]
rustc: Fix outdated comment

7 years agoadd example for `Rc::would_unwrap`
Matthew Piziak [Sun, 21 Aug 2016 21:18:21 +0000 (17:18 -0400)]
add example for `Rc::would_unwrap`

Part of #29372

r? @steveklabnik

7 years agoFix "Furthermore" Typo in String Docs
Christopher Serr [Sun, 21 Aug 2016 20:51:37 +0000 (22:51 +0200)]
Fix "Furthermore" Typo in String Docs

It used to say "Furtheremore" instead of "Furthermore".

7 years agoreplace `println!` statements with `assert!`ions in `std::ptr` examples
Matthew Piziak [Sun, 21 Aug 2016 20:49:09 +0000 (16:49 -0400)]
replace `println!` statements with `assert!`ions in `std::ptr` examples

r? @steveklabnik

7 years agoAuto merge of #35776 - jseyfried:more_groundwork, r=nrc
bors [Sun, 21 Aug 2016 18:03:48 +0000 (11:03 -0700)]
Auto merge of #35776 - jseyfried:more_groundwork, r=nrc

resolve: More groundwork for `item_like_imports` (RFC 1560)

r? @nrc

7 years agoUpdate lib.rs
Shyam Sundar B [Sun, 21 Aug 2016 13:13:58 +0000 (18:43 +0530)]
Update lib.rs
Update lib.rs
Update lib.rs
Update E0438.rs
Update E0437.rs
Update E0435.rs

7 years agocstring: avoid excessive growth just to 0-terminate
Ulrik Sverdrup [Sun, 21 Aug 2016 11:33:28 +0000 (13:33 +0200)]
cstring: avoid excessive growth just to 0-terminate

Based on following what happens in CString::new("string literal"):

1. Using `Into<Vec<u8>>`, a Vec is allocated with capacity exactly equal
   to the string's input length.
2. By `v.push(0)`, the Vec is grown to twice capacity, since it was full.
3. By `v.into_boxed_slice()`, the Vec capacity is shrunk to fit the length again.

If we use `.reserve_exact(1)` just before the push, then we avoid the
capacity doubling that we're going to have to shrink anyway.

Growing by just 1 byte means that the step (2) is less likely to have to
move the memory to a larger allocation chunk, and that the step (3) does
not have to reallocate.

7 years agoUpdate E0503 to the new format
Wesley Wiser [Sun, 21 Aug 2016 01:07:19 +0000 (21:07 -0400)]
Update E0503 to the new format

Fixes #35703
Part of #35233

7 years agoreplace `Index` example with something more evocative of indexing
Matthew Piziak [Sat, 20 Aug 2016 20:39:40 +0000 (16:39 -0400)]
replace `Index` example with something more evocative of indexing

r? @steveklabnik

7 years agoUpdate E0424 to the new error format
Johannes Löthberg [Sat, 20 Aug 2016 00:41:51 +0000 (02:41 +0200)]
Update E0424 to the new error format

Fixes #35797.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
7 years agoreplace `Rem` example with something more evocative
Matthew Piziak [Sat, 20 Aug 2016 19:21:36 +0000 (15:21 -0400)]
replace `Rem` example with something more evocative

r? @steveklabnik

7 years agohash the traits-in-scope determinstically
Niko Matsakis [Sat, 20 Aug 2016 15:52:01 +0000 (11:52 -0400)]
hash the traits-in-scope determinstically

Experimentally, this fixes the poor re-use observed in
libsyntex-syntax. I'm not sure how to make a regression test for this,
though, given the non-deterministic nature of it.

7 years agoAuto merge of #35857 - jonathandturner:rollup, r=jonathandturner
bors [Sat, 20 Aug 2016 14:09:53 +0000 (07:09 -0700)]
Auto merge of #35857 - jonathandturner:rollup, r=jonathandturner

Rollup of 19 pull requests

- Successful merges: #35234, #35701, #35709, #35710, #35775, #35778, #35780, #35781, #35794, #35800, #35804, #35806, #35811, #35812, #35818, #35827, #35830, #35831, #35839
- Failed merges: #35759

7 years agoRollup merge of #35839 - jonathandturner:error_touchup, r=Aatch
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35839 - jonathandturner:error_touchup, r=Aatch

Wording fixes in error messages

This PR is largely wording fixes to existing PRs that I found going back through the ones that have already been updated.  Sometimes seeing the message in context made me think "oh there's a better wording!"

There's one additional fix.  This will also prevent the secondary underlining of derive call (since they look like macros to the system in the way I was using):

```
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
  --> src/test/compile-fail/E0184.rs:11:10
   |
11 | #[derive(Copy)] //~ ERROR E0184
   |          ^^^^
   |          |
   |          in this macro invocation
```

Is now just:

```
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
  --> src/test/compile-fail/E0184.rs:11:10
   |
11 | #[derive(Copy)] //~ ERROR E0184
   |          ^^^^
```

7 years agoRollup merge of #35831 - trixnz:error-428, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35831 - trixnz:error-428, r=jonathandturner

Update E0428 to new format

Fixes #35798 as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35830 - matthew-piziak:not-example, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35830 - matthew-piziak:not-example, r=steveklabnik

replace `Neg` example with something more evocative of negation

7 years agoRollup merge of #35827 - matthew-piziak:neg-example, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35827 - matthew-piziak:neg-example, r=steveklabnik

replace `Not` example with something more evocative

7 years agoRollup merge of #35818 - wdv4758h:E0133-label, r=Aatch
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
Rollup merge of #35818 - wdv4758h:E0133-label, r=Aatch

Fix label messages for E0133

Issue #35789

7 years agoRollup merge of #35812 - mlayne:E0232, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
Rollup merge of #35812 - mlayne:E0232, r=jonathandturner

Update error format for E0232

Fixes #35795, as part of #35233.

Excited to make my first contribution to rustc!

r? @jonathandturner

7 years agoRollup merge of #35811 - jonathandturner:fix_rustbuild_version_test, r=alexcrichton
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
Rollup merge of #35811 - jonathandturner:fix_rustbuild_version_test, r=alexcrichton

Add workaround to detect correct compiler version

This adds a workaround which fixes a rustbuild issue where the wrong compiler is checked for the version number.  The bug would arise if you build the system correctly then changed to any other version (eg doing a `git pull`).  After changing to the new version, building would fail and complain that crates were built with the wrong compiler.

There are actually two compilers at play, the bootstrapping compiler (called the "snapshot" compiler) and the actual compiler being built (the "real" compiler).  In the case of this issue, the wrong compiler was being checked for version mismatch.

r? @alexcrichton

7 years agoRollup merge of #35806 - matthew-piziak:addassign-example, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
Rollup merge of #35806 - matthew-piziak:addassign-example, r=steveklabnik

replace `AddAssign` example with something more evocative of addition

This is analogous to PR #35709 for the `Add` trait.

7 years agoRollup merge of #35804 - pliniker:master, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35804 - pliniker:master, r=jonathandturner

Update error message for E0084

Fixes #35792 as part of #35233

r? @jonathandturner

7 years agoRollup merge of #35800 - matthew-piziak:mul-div-examples, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35800 - matthew-piziak:mul-div-examples, r=steveklabnik

demonstrate `RHS != Self` use cases for `Mul` and `Div`

Vector-scalar multipication is a good usecase for this. Thanks #rust!

7 years agoRollup merge of #35794 - cantino:fix-typo, r=apasel422
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35794 - cantino:fix-typo, r=apasel422

Fix minor typo

Minor typo in the book.

7 years agoRollup merge of #35781 - ErikUggeldahl:spellingfix, r=apasel422
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35781 - ErikUggeldahl:spellingfix, r=apasel422

Very minor spelling fix in the book

Changed datastructure to data structure.

r? @steveklabnik

7 years agoRollup merge of #35780 - clementmiao:E0396_new_err_format, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35780 - clementmiao:E0396_new_err_format, r=jonathandturner

updated E0396 to new error format

Updated E0396 to new error format.
Part of #35233
Fixes #35779

Thanks again for letting me help!

r? @jonathandturner

7 years agoRollup merge of #35778 - clementmiao:E0395_new_error_format, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
Rollup merge of #35778 - clementmiao:E0395_new_error_format, r=jonathandturner

updated E0395 to new error format

Updated E0395 to new error format.
Part of #35233
Fixes #35693

Thanks again for letting me help!

r? @jonathandturner

7 years agoRollup merge of #35775 - frewsxcv:os-str-doc-examples, r=GuillaumeGomez
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
Rollup merge of #35775 - frewsxcv:os-str-doc-examples, r=GuillaumeGomez

Add a few doc examples for `std::ffi::OsStr`.

7 years agoRollup merge of #35710 - matthew-piziak:explicit-drop, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
Rollup merge of #35710 - matthew-piziak:explicit-drop, r=steveklabnik

note that calling drop() explicitly is a compiler error

Part of #29365

7 years agoRollup merge of #35709 - matthew-piziak:add-trait-example, r=GuillaumeGomez
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
Rollup merge of #35709 - matthew-piziak:add-trait-example, r=GuillaumeGomez

replace `Add` example with something more evocative of addition

Currently most of the operator traits use trivial implementation
examples that only perform side effects. Honestly, that might not be too
bad for the sake of documentation; but anyway, here's a proposal to move
a slightly modified version of the module-level point-addition example
into the `Add` documentation, since it's more evocative of addition
semantics.

Part of #29365

7 years agoRollup merge of #35701 - matthew-piziak:rangefull-example-error, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:33 +0000 (07:09 -0700)]
Rollup merge of #35701 - matthew-piziak:rangefull-example-error, r=steveklabnik

explicitly show how iterating over `..` fails

I've also removed the `main()` wrapper, which I believe is extraneous.
LMK if that's incorrect.