]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRemove style guide.
Steve Klabnik [Fri, 29 Jul 2016 22:56:09 +0000 (18:56 -0400)]
Remove style guide.

We originally imported this into the repository with the intent of
fixing it up. Instead, nothing happened.

Its appearance on rust-lang.org makes it seem semi-official, but it's
not. The rustfmt strike team will end up producing something like this
anyway, and leaving it around does nothing but mislead people.

7 years agoAuto merge of #35884 - habnabit:freebsd-arc4rand, r=alexcrichton
bors [Thu, 25 Aug 2016 15:32:19 +0000 (08:32 -0700)]
Auto merge of #35884 - habnabit:freebsd-arc4rand, r=alexcrichton

Use arc4rand(9) on FreeBSD

From rust-lang-nursery/rand#112:

>After reading through #30691 it seems that there's general agreement that using OS-provided facilities for seeding rust userland processes is fine as long as it doesn't use too much from libc. FreeBSD's `arc4random_buf(3)` is not only a whole lot of libc code, but also not even currently exposed in the libc crate. Fortunately, the mechanism `arc4random_buf(3)` et al. use for getting entropy from the kernel ([`arc4rand(9)`](https://www.freebsd.org/cgi/man.cgi?query=arc4random&apropos=0&sektion=9&manpath=FreeBSD+10.3-RELEASE&arch=default&format=html)) is exposed via `sysctl(3)` with constants that are already in the libc crate.

>I haven't found too much documentation on `KERN_ARND`—it's missing or only briefly described in most of the places that cover sysctl mibs. But, from digging through the kernel source, it appears that the sysctl used in this PR is very close to just calling `arc4rand(9)` directly (with `reseed` set to 0 and no way to change it).

I expected [rand](/rust-lang-nursery/rand) to reply quicker, so I tried submitting it there first. It's been a few weeks with no comment, so I don't know the state of it, but maybe someone will see it here and have an opinion. This is basically the same patch. It pains me to duplicate the code but I guess it hasn't been factored out into just one place yet.

7 years agoAuto merge of #35979 - Manishearth:rollup, r=Manishearth
bors [Thu, 25 Aug 2016 11:35:52 +0000 (04:35 -0700)]
Auto merge of #35979 - Manishearth:rollup, r=Manishearth

Rollup of 6 pull requests

- Successful merges: #35238, #35867, #35885, #35916, #35947, #35955
- Failed merges:

7 years agoRollup merge of #35955 - frewsxcv:idiomatic-methods, r=eddyb
Manish Goregaokar [Thu, 25 Aug 2016 08:22:53 +0000 (13:52 +0530)]
Rollup merge of #35955 - frewsxcv:idiomatic-methods, r=eddyb

Use idiomatic names for string-related methods names.

None

7 years agoRollup merge of #35947 - SimonSapin:decodeutf8-error-handling, r=alexcrichton
Manish Goregaokar [Thu, 25 Aug 2016 08:22:53 +0000 (13:52 +0530)]
Rollup merge of #35947 - SimonSapin:decodeutf8-error-handling, r=alexcrichton

Yield Err in char::decode_utf8 per Unicode, like String::from_utf8_lossy

r? @alexcrichton

7 years agoRollup merge of #35916 - eddyb:mir-no-dead-allocas, r=Aatch
Manish Goregaokar [Thu, 25 Aug 2016 08:22:52 +0000 (13:52 +0530)]
Rollup merge of #35916 - eddyb:mir-no-dead-allocas, r=Aatch

rustc_trans: do not generate allocas for unused locals.

This fixes a regression observed in a [`mio` test](https://travis-ci.org/carllerche/mio/jobs/152142886) which was referencing a 4MB `const` array.
Even though MIR rvalue promotion would promote the borrow of the array, a dead temp was left behind.
As the array doesn't have an immediate type, an `alloca` was generated for it, even though it had no uses.

The fix is pretty dumb: assume that locals need to be borrowed or assigned before being used.
And if it can't be used, it doesn't get an `alloca`, even if the type would otherwise demand it.
This could change in the future, but all the MIR we generate now doesn't break that rule.

7 years agoRollup merge of #35867 - frewsxcv:rustdoc-cleanup, r=alexcrichton
Manish Goregaokar [Thu, 25 Aug 2016 08:22:52 +0000 (13:52 +0530)]
Rollup merge of #35867 - frewsxcv:rustdoc-cleanup, r=alexcrichton

Various refactorings in the rustdoc module.

None

7 years agoRollup merge of #35238 - vadimcn:macro-debug-locs, r=michaelwoerister
Manish Goregaokar [Thu, 25 Aug 2016 08:22:52 +0000 (13:52 +0530)]
Rollup merge of #35238 - vadimcn:macro-debug-locs, r=michaelwoerister

Fix debug line number info for macro expansions.

Macro expansions result in code tagged with completely different debug locations than the surrounding expressions.  This wrecks havoc on debugger's ability the step over source lines.
This change fixes the problem by tagging expanded code as "inlined" at the macro expansion site, which allows the debugger to sort it out.
Note that only the outermost expansion is currently handled, stepping into a macro will still result in stepping craziness.

r? @eddyb

7 years agoFix debug line info for macro expansions.
Vadim Chugunov [Thu, 25 Aug 2016 02:34:31 +0000 (19:34 -0700)]
Fix debug line info for macro expansions.

Macro expansions produce code tagged with debug locations that are completely different from the surrounding expressions.  This wrecks havoc on debugger's ability the step over source lines.

In order to have a good line stepping behavior in debugger, we overwrite debug locations of macro expansions with that of the outermost expansion site.

7 years agoImplement `From<ast::FloatTy>` for `PrimitiveType`.
Corey Farwell [Tue, 23 Aug 2016 23:41:14 +0000 (19:41 -0400)]
Implement `From<ast::FloatTy>` for `PrimitiveType`.

7 years agoImplement `From<ast::UintTy>` for `PrimitiveType`.
Corey Farwell [Tue, 23 Aug 2016 23:22:18 +0000 (19:22 -0400)]
Implement `From<ast::UintTy>` for `PrimitiveType`.

7 years agoImplement `From<ast::IntTy>` for `PrimitiveType`.
Corey Farwell [Tue, 23 Aug 2016 23:12:24 +0000 (19:12 -0400)]
Implement `From<ast::IntTy>` for `PrimitiveType`.

7 years agoRemove unnecessary 'Primitive' prefix on `PrimitiveType` enum variants.
Corey Farwell [Tue, 23 Aug 2016 22:51:56 +0000 (18:51 -0400)]
Remove unnecessary 'Primitive' prefix on `PrimitiveType` enum variants.

7 years agoStop reexporting `PrimitiveType` enum in librustdoc.
Corey Farwell [Tue, 23 Aug 2016 22:48:10 +0000 (18:48 -0400)]
Stop reexporting `PrimitiveType` enum in librustdoc.

7 years agoMigrate ItemType::from_type_kind to convert::From.
Corey Farwell [Sat, 20 Aug 2016 19:55:43 +0000 (15:55 -0400)]
Migrate ItemType::from_type_kind to convert::From.

7 years agoMigrate ItemType::from_item to convert::From.
Corey Farwell [Sat, 20 Aug 2016 18:22:16 +0000 (14:22 -0400)]
Migrate ItemType::from_item to convert::From.

7 years agoMigrate Context::maybe_ignore_item method to standalone function.
Corey Farwell [Sat, 20 Aug 2016 18:22:08 +0000 (14:22 -0400)]
Migrate Context::maybe_ignore_item method to standalone function.

The method wasn't using any `self` data from Context, so it seemed
miseading to implement it as a method.

7 years agoMove ItemEnum → Generics logic into method on ItemEnum.
Corey Farwell [Sat, 20 Aug 2016 17:36:52 +0000 (13:36 -0400)]
Move ItemEnum → Generics logic into method on ItemEnum.

7 years agoAuto merge of #35814 - alexcrichton:armv7-no-neon, r=brson
bors [Thu, 25 Aug 2016 06:05:47 +0000 (23:05 -0700)]
Auto merge of #35814 - alexcrichton:armv7-no-neon, r=brson

rustc: Don't enable NEON by default on armv7 Linux

One of the primary platforms for the `armv7-unknown-linux-gnueabihf` target,
Linux distributions, do not enable NEON extensions by default. This PR disables
that feature by defualt but enables the `d16` feature which enables VFP3D16 that
distributions do enable.

Closes #35590

7 years agoAuto merge of #35971 - jonathandturner:rollup, r=jonathandturner
bors [Thu, 25 Aug 2016 01:42:24 +0000 (18:42 -0700)]
Auto merge of #35971 - jonathandturner:rollup, r=jonathandturner

Rollup of 4 pull requests

- Successful merges: #35876, #35920, #35948, #35961
- Failed merges: #35395

7 years agoAuto merge of #35764 - eddyb:byegone, r=nikomatsakis
bors [Wed, 24 Aug 2016 21:57:34 +0000 (14:57 -0700)]
Auto merge of #35764 - eddyb:byegone, r=nikomatsakis

Remove the old AST-based backend from rustc_trans.

Starting with Rust 1.13, `--disable-orbit` , `-Z orbit=off` and `#[rustc_no_mir]` have been removed.
Only the new MIR backend is left in the compiler, and only early const_eval uses ASTs from other crates.

Filling drop (previously "zeroing drop"), `#[unsafe_no_drop_flag]` and associated unstable APIs are gone.
Implementing `Drop` doesn't add a flag anymore to the type, all of the dynamic drop is function local.
This is a [breaking-change], please use `Option::None` and/or `mem::forget` if you are unsure about your ability to prevent/control the drop of a value. In the future, `union` will be usable in some such cases.

**NOTE**: DO NOT MERGE before we get the new beta as the stage0, there's some cruft to remove.

All of this will massively simplify any efforts to implement (and as such it blocks) features such as `union`s, safe use of `#[packed]` or new type layout optimizations, not to mention many other experiments.

7 years agoRollup merge of #35961 - 0xmohit:pr/error-codes-E0445-E0454, r=GuillaumeGomez
Jonathan Turner [Wed, 24 Aug 2016 17:35:29 +0000 (10:35 -0700)]
Rollup merge of #35961 - 0xmohit:pr/error-codes-E0445-E0454, r=GuillaumeGomez

Update E0445 and E0454 to new error format

Fixes #35922.
Fixes #35930.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #35948 - tshepang:missing-comma, r=steveklabnik
Jonathan Turner [Wed, 24 Aug 2016 17:35:29 +0000 (10:35 -0700)]
Rollup merge of #35948 - tshepang:missing-comma, r=steveklabnik

reference: add trailing commas

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 agoAuto merge of #35883 - durka:gh35849, r=eddyb
bors [Wed, 24 Aug 2016 17:29:12 +0000 (10:29 -0700)]
Auto merge of #35883 - durka:gh35849, r=eddyb

typeck: use NoExpectation to check return type of diverging fn

Fixes #35849.

Thanks @eddyb.

7 years agoUpdate E0445 and E0454 to new error format
Mohit Agarwal [Wed, 24 Aug 2016 12:13:51 +0000 (17:43 +0530)]
Update E0445 and E0454 to new error format

Fixes #35922.
Fixes #35930.
Part of #35233.

r? @GuillaumeGomez

7 years agoRemove AST from metadata except for consts and const fns.
Eduard Burtescu [Wed, 17 Aug 2016 19:50:55 +0000 (22:50 +0300)]
Remove AST from metadata except for consts and const fns.

7 years agoRemove drop flags from structs and enums implementing Drop.
Eduard Burtescu [Tue, 23 Aug 2016 07:39:30 +0000 (10:39 +0300)]
Remove drop flags from structs and enums implementing Drop.

7 years agorustc_trans: remove the bulk of old trans and most of its support code.
Eduard Burtescu [Tue, 16 Aug 2016 14:41:38 +0000 (17:41 +0300)]
rustc_trans: remove the bulk of old trans and most of its support code.

7 years agoDisable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit.
Eduard Burtescu [Wed, 24 Aug 2016 03:36:37 +0000 (06:36 +0300)]
Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit.

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 agoReuse iterator to avoid unnecessary creation.
Corey Farwell [Wed, 24 Aug 2016 01:34:53 +0000 (21:34 -0400)]
Reuse iterator to avoid unnecessary creation.

7 years agoUse idiomatic names for string-related methods names.
Corey Farwell [Wed, 24 Aug 2016 01:27:20 +0000 (21:27 -0400)]
Use idiomatic names for string-related methods names.

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 agoreference: add trailing commas
Tshepang Lekhonkhobe [Tue, 23 Aug 2016 20:25:40 +0000 (22:25 +0200)]
reference: add trailing commas

7 years agoYield Err in char::decode_utf8 per Unicode, like String::from_utf8_lossy
Simon Sapin [Tue, 23 Aug 2016 20:09:59 +0000 (22:09 +0200)]
Yield Err in char::decode_utf8 per Unicode, like String::from_utf8_lossy

7 years agoUse a macro in test_decode_utf8 to preserve line numbers in panic messages.
Simon Sapin [Tue, 23 Aug 2016 15:26:34 +0000 (17:26 +0200)]
Use a macro in test_decode_utf8 to preserve line numbers in panic messages.

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 agotypeck: use NoExpectation to check return type of diverging fn
Alex Burka [Sun, 21 Aug 2016 22:45:25 +0000 (22:45 +0000)]
typeck: use NoExpectation to check return type of diverging fn

This fixes #35849, a regression introduced by the typeck refactoring
around TyNever/!.

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 agorustc_trans: do not generate allocas for unused locals.
Eduard Burtescu [Tue, 23 Aug 2016 06:07:23 +0000 (09:07 +0300)]
rustc_trans: do not generate allocas for unused locals.

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