]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agolibstd: add example for PathBuf::push
Kevin Butler [Mon, 9 Nov 2015 03:42:22 +0000 (03:42 +0000)]
libstd: add example for PathBuf::push

8 years agoAuto merge of #29684 - stepancheg:size-hint, r=Gankro
bors [Sun, 8 Nov 2015 22:01:44 +0000 (22:01 +0000)]
Auto merge of #29684 - stepancheg:size-hint, r=Gankro

* `size_hint()` cannot be relied upon to perform memory unsafe operations

Same applies to `len()` function of `ExactSizeIterator` trait.

8 years agoAuto merge of #29686 - jrburke:docs-error-handling-search-case, r=BurntSushi
bors [Sun, 8 Nov 2015 20:20:16 +0000 (20:20 +0000)]
Auto merge of #29686 - jrburke:docs-error-handling-search-case, r=BurntSushi

In src/doc/trpl/error-handling.md, in this section:

It mentions three steps, to "convert this to proper error handling", the last one being:

3. Handle the error in main.

However, it is not shown. This pull request adds a code example showing how `main`'s call to `search` should use case analysis. I am still very much new to learning Rust, so this may not be idiomatic. Happy to make changes with guidance.

8 years agoAuto merge of #29690 - tbu-:pr_doc_env_home_dir, r=Manishearth
bors [Sun, 8 Nov 2015 18:37:18 +0000 (18:37 +0000)]
Auto merge of #29690 - tbu-:pr_doc_env_home_dir, r=Manishearth

8 years agoExplain that size_hint cannot be trusted
Stepan Koltsov [Sun, 8 Nov 2015 02:30:21 +0000 (05:30 +0300)]
Explain that size_hint cannot be trusted

Same applies to `len()` function of `ExactSizeIterator` trait.

8 years agodoc: error-handling.md: main case analysis for search
jrburke [Sun, 8 Nov 2015 05:36:57 +0000 (21:36 -0800)]
doc: error-handling.md: main case analysis for search

8 years agoAuto merge of #29692 - jwworth:pull-request/fix-typo, r=apasel422
bors [Sun, 8 Nov 2015 15:56:03 +0000 (15:56 +0000)]
Auto merge of #29692 - jwworth:pull-request/fix-typo, r=apasel422

Fixes the double word 'be'.

8 years agoFix double word 'be'
Jake Worth [Sun, 8 Nov 2015 15:39:01 +0000 (09:39 -0600)]
Fix double word 'be'

8 years agoSpell out the fallback of `std::env::home_dir` on POSIX
Tobias Bucher [Sun, 8 Nov 2015 15:34:16 +0000 (15:34 +0000)]
Spell out the fallback of `std::env::home_dir` on POSIX

8 years agoAuto merge of #29683 - apasel422:typos, r=steveklabnik
bors [Sun, 8 Nov 2015 05:31:21 +0000 (05:31 +0000)]
Auto merge of #29683 - apasel422:typos, r=steveklabnik

r? @steveklabnik

8 years agoAuto merge of #29681 - vadimcn:fix-dist, r=alexcrichton
bors [Sun, 8 Nov 2015 02:34:24 +0000 (02:34 +0000)]
Auto merge of #29681 - vadimcn:fix-dist, r=alexcrichton

Resolves  #29672.   This happened because rust runtime startup objects, rsbegin.o and rsend.o, were not included in the target libraries package for -windows-gnu.

r? @alexcrichton

8 years agoRemove duplicate words from docs
Andrew Paseltiner [Sun, 8 Nov 2015 02:28:13 +0000 (21:28 -0500)]
Remove duplicate words from docs

8 years agoMake sure rsbegin.o and rsend.o get packaged with target lib artifacts.
Vadim Chugunov [Sun, 8 Nov 2015 01:44:44 +0000 (17:44 -0800)]
Make sure rsbegin.o and rsend.o get packaged with target lib artifacts.
Also, unified libc startup objects finding logic with that of the `-musl` target, since conceptually they were doing the same thing.

8 years agoAuto merge of #29674 - inrustwetrust:flag_alignment, r=alexcrichton
bors [Sat, 7 Nov 2015 23:45:14 +0000 (23:45 +0000)]
Auto merge of #29674 - inrustwetrust:flag_alignment, r=alexcrichton

The `enable-nonzeroing-move-hints` flag name was too long and caused misalignment of the help text.
Now calculating the needed padding dynamically from the available flags instead.

8 years agoAuto merge of #29678 - jwworth:pull-request/fix-typo, r=apasel422
bors [Sat, 7 Nov 2015 18:49:42 +0000 (18:49 +0000)]
Auto merge of #29678 - jwworth:pull-request/fix-typo, r=apasel422

Fixes the typo 'is is'.

8 years agoFix typo
Jake Worth [Sat, 7 Nov 2015 18:27:58 +0000 (12:27 -0600)]
Fix typo

8 years agoAuto merge of #29671 - ollie27:patch-1, r=bluss
bors [Sat, 7 Nov 2015 13:31:10 +0000 (13:31 +0000)]
Auto merge of #29671 - ollie27:patch-1, r=bluss

8 years agoFixed text alignment for output of "rustc -Z help"
inrustwetrust [Sat, 7 Nov 2015 13:00:55 +0000 (14:00 +0100)]
Fixed text alignment for output of "rustc -Z help"

8 years agoUpdate list of array implementations in src/libstd/primitive_docs.rs
Oliver Middleton [Sat, 7 Nov 2015 12:01:11 +0000 (12:01 +0000)]
Update list of array implementations in src/libstd/primitive_docs.rs

8 years agoAuto merge of #29662 - rust-lang:brson-patch-2, r=steveklabnik
bors [Sat, 7 Nov 2015 06:18:39 +0000 (06:18 +0000)]
Auto merge of #29662 - rust-lang:brson-patch-2, r=steveklabnik

r? @steveklabnik

8 years agoDirect security bugs to the security policy.
Brian Anderson [Fri, 6 Nov 2015 22:05:19 +0000 (14:05 -0800)]
Direct security bugs to the security policy.

8 years agoAuto merge of #29666 - Manishearth:rollup, r=Manishearth
bors [Sat, 7 Nov 2015 02:26:45 +0000 (02:26 +0000)]
Auto merge of #29666 - Manishearth:rollup, r=Manishearth

- Successful merges: #29617, #29622, #29656, #29659, #29660
- Failed merges:

8 years agoRollup merge of #29660 - steveklabnik:gh28461, r=brson
Manish Goregaokar [Sat, 7 Nov 2015 01:14:46 +0000 (06:44 +0530)]
Rollup merge of #29660 - steveklabnik:gh28461, r=brson

Fixes #28461

8 years agoRollup merge of #29659 - angelsl:crt-rebase, r=alexcrichton
Manish Goregaokar [Sat, 7 Nov 2015 01:14:46 +0000 (06:44 +0530)]
Rollup merge of #29659 - angelsl:crt-rebase, r=alexcrichton

cc: @vadimcn @vhbit

r? @alexcrichton

8 years agoRollup merge of #29656 - arcnmx:static-extern, r=alexcrichton
Manish Goregaokar [Sat, 7 Nov 2015 01:14:45 +0000 (06:44 +0530)]
Rollup merge of #29656 - arcnmx:static-extern, r=alexcrichton

This is currently done for functions but not public static symbols.

8 years agoRollup merge of #29622 - steveklabnik:gh29621, r=bstrie
Manish Goregaokar [Sat, 7 Nov 2015 01:14:45 +0000 (06:44 +0530)]
Rollup merge of #29622 - steveklabnik:gh29621, r=bstrie

Now that thread::sleep is a real thing, let's use it

Fixes #29621

r? @bstrie

8 years agoRollup merge of #29617 - steveklabnik:gh29591, r=alexcrichton
Manish Goregaokar [Sat, 7 Nov 2015 01:14:45 +0000 (06:44 +0530)]
Rollup merge of #29617 - steveklabnik:gh29591, r=alexcrichton

Fixes #29591

8 years agoAuto merge of #29551 - arcnmx:target-family, r=alexcrichton
bors [Sat, 7 Nov 2015 00:42:10 +0000 (00:42 +0000)]
Auto merge of #29551 - arcnmx:target-family, r=alexcrichton

Allow the changing of `target_family` through flexible configuration. The whole computing world isn't just a binary of *nix and Windows! Makes porting `libstd` and co to new platforms a lot less painful.

8 years agoAuto merge of #29462 - alexcrichton:refactor-process-ret, r=aturon
bors [Fri, 6 Nov 2015 22:57:37 +0000 (22:57 +0000)]
Auto merge of #29462 - alexcrichton:refactor-process-ret, r=aturon

* Store the native representation directly in the `ExitStatus` structure instead
  of a "parsed version" (mostly for Unix).
* On Windows, be more robust against processes exiting with the status of 259.
  Unfortunately this exit code corresponds to `STILL_ACTIVE`, causing libstd to
  think the process was still alive, causing an infinite loop. Instead the loop
  is removed altogether and `WaitForSingleObject` is used to wait for the
  process to exit.

8 years agostd: Refactor process exit code handling slightly
Alex Crichton [Thu, 29 Oct 2015 20:45:56 +0000 (13:45 -0700)]
std: Refactor process exit code handling slightly

* Store the native representation directly in the `ExitStatus` structure instead
  of a "parsed version" (mostly for Unix).
* On Windows, be more robust against processes exiting with the status of 259.
  Unfortunately this exit code corresponds to `STILL_ACTIVE`, causing libstd to
  think the process was still alive, causing an infinite loop. Instead the loop
  is removed altogether and `WaitForSingleObject` is used to wait for the
  process to exit.

8 years agoAuto merge of #29582 - oli-obk:token_tree, r=sfackler
bors [Fri, 6 Nov 2015 21:11:06 +0000 (21:11 +0000)]
Auto merge of #29582 - oli-obk:token_tree, r=sfackler

8 years agosleep_ms -> sleep
Steve Klabnik [Thu, 5 Nov 2015 16:29:36 +0000 (17:29 +0100)]
sleep_ms -> sleep

Now that thread::sleep is a real thing, let's use it

Fixes #29621

8 years agoAdd multi-line string literals to TRPL
Steve Klabnik [Thu, 5 Nov 2015 14:58:08 +0000 (15:58 +0100)]
Add multi-line string literals to TRPL

Fixes #29591

8 years agoMake a note about "gigabyte"
Steve Klabnik [Fri, 6 Nov 2015 16:42:53 +0000 (17:42 +0100)]
Make a note about "gigabyte"

Fixes #28461

8 years agoAuto merge of #29657 - defuz:patch-2, r=steveklabnik
bors [Fri, 6 Nov 2015 16:42:03 +0000 (16:42 +0000)]
Auto merge of #29657 - defuz:patch-2, r=steveklabnik

r? @steveklabnik

8 years agoUpdate compiler-rt
angelsl [Fri, 6 Nov 2015 16:26:44 +0000 (00:26 +0800)]
Update compiler-rt

8 years agoAuto merge of #29643 - petrochenkov:stability5, r=alexcrichton
bors [Fri, 6 Nov 2015 14:57:41 +0000 (14:57 +0000)]
Auto merge of #29643 - petrochenkov:stability5, r=alexcrichton

Also remove `stable` stability annotations from inherent impls

(There will be a warning for useless stability annotations soon.)

r? @Gankro

8 years agoremove `Tt` prefix from TokenType variants
Oliver Schneider [Fri, 6 Nov 2015 13:52:02 +0000 (14:52 +0100)]
remove `Tt` prefix from TokenType variants

[breaking change]

8 years agoAuto merge of #29620 - petrochenkov:reachable2, r=alexcrichton
bors [Fri, 6 Nov 2015 13:13:08 +0000 (13:13 +0000)]
Auto merge of #29620 - petrochenkov:reachable2, r=alexcrichton

Handle them in `middle::reachable` instead (no optimizations so far, just drop all trait impl items into the reachable set, as before). Addresses the concerns from https://github.com/rust-lang/rust/pull/29291#discussion_r43672413
\+ In `middle::reachable` don't treat impls of `Drop` specially, they are subsumed by the general impl treatment.
\+ Add some tests checking reachability of trait methods written in UFCS form
\+ Minor refactoring in the second commit

r? @alexcrichton

8 years agoOpps, fix incorrect call
Ivan Ivaschenko [Fri, 6 Nov 2015 11:52:17 +0000 (13:52 +0200)]
Opps, fix incorrect call

8 years agoRename me in AUTHORS.txt
Ivan Ivaschenko [Fri, 6 Nov 2015 11:48:24 +0000 (13:48 +0200)]
Rename me in AUTHORS.txt

8 years agoRemoving the hack from error handling chapter, which is does not make sense anymore.
Ivan Ivaschenko [Fri, 6 Nov 2015 11:44:42 +0000 (13:44 +0200)]
Removing the hack from error handling chapter, which is does not make sense anymore.

8 years agoAuto merge of #29615 - steveklabnik:lol_strings, r=alexcrichton
bors [Fri, 6 Nov 2015 11:28:07 +0000 (11:28 +0000)]
Auto merge of #29615 - steveklabnik:lol_strings, r=alexcrichton

&format!("...") is the same as "" if we're not doing any interpolation,
and doesn't allocate an intermediate String.

8 years agoPreserve public static items across LTO
arcnmx [Fri, 6 Nov 2015 09:51:03 +0000 (04:51 -0500)]
Preserve public static items across LTO

8 years agoAuto merge of #29604 - bstrie:de_ms, r=alexcrichton
bors [Fri, 6 Nov 2015 09:42:17 +0000 (09:42 +0000)]
Auto merge of #29604 - bstrie:de_ms, r=alexcrichton

8 years agoAuto merge of #29600 - Ryman:rustdoc_better_testnames, r=alexcrichton
bors [Fri, 6 Nov 2015 07:58:27 +0000 (07:58 +0000)]
Auto merge of #29600 - Ryman:rustdoc_better_testnames, r=alexcrichton

Old doctest names
```bash
test sync::atomic::load_0 ... ok
test sync::atomic::load_0 ... ok
test sync::atomic::load_0 ... ok
test sync::atomic::load_0 ... ok
```

New doctest names
```bash
test sync::atomic::AtomicBool::load_0 ... ok
test sync::atomic::AtomicIsize::load_0 ... ok
test sync::atomic::AtomicPtr<T>::load_0 ... ok
test sync::atomic::AtomicUsize::load_0 ... ok
```

8 years agoAuto merge of #29588 - nikomatsakis:mir-switch, r=aatch
bors [Fri, 6 Nov 2015 06:13:59 +0000 (06:13 +0000)]
Auto merge of #29588 - nikomatsakis:mir-switch, r=aatch

Introduce a `SwitchInt` and restructure pattern matching to collect integers and characters into one master switch. This is aimed at #29227, but is not a complete fix. Whereas before we generated an if-else-if chain and, at least on my machine, just failed to compile, we now spend ~9sec compiling `rustc_abuse`. AFAICT this is basically just due to a need for more micro-optimization of the matching process: perf shows a fair amount of time just spent iterating over the candidate list. Still, it seemed worth opening a PR with this step alone, since it's a big step forward.

8 years agoAuto merge of #29491 - alexcrichton:avoid-stdio-tls, r=brson
bors [Fri, 6 Nov 2015 04:29:11 +0000 (04:29 +0000)]
Auto merge of #29491 - alexcrichton:avoid-stdio-tls, r=brson

Currently if a print happens while a thread is being torn down it may cause a
panic if the LOCAL_STDOUT TLS slot has been destroyed by that point. This adds a
guard to check and prints to the process stdout if that's the case (as we do for
if the slot is already borrowed).

Closes #29488

8 years agoAuto merge of #29653 - alexcrichton:fix-distcheck-again-zomg, r=brson
bors [Fri, 6 Nov 2015 02:41:20 +0000 (02:41 +0000)]
Auto merge of #29653 - alexcrichton:fix-distcheck-again-zomg, r=brson

The recent change of libdir on windows was accidentally not propagated to
`make dist` and related commands. This commit touches that up!

Closes #29640

8 years agoAuto merge of #29305 - alexcrichton:bad-getenv, r=brson
bors [Fri, 6 Nov 2015 00:56:08 +0000 (00:56 +0000)]
Auto merge of #29305 - alexcrichton:bad-getenv, r=brson

As discovered in #29298, `env::set_var("", "")` will panic, but it turns out
that it *also* deadlocks on Unix systems. This happens because if a panic
happens while holding the environment lock, we then go try to read
RUST_BACKTRACE, grabbing the environment lock, causing a deadlock.

Specifically, the changes made here are:

* The environment lock is pushed into `std::sys` instead of `std::env`. This
  also only puts it in the Unix implementation, not Windows where the functions
  are already threadsafe.
* The `std::sys` implementation now returns `io::Result` so panics are
  explicitly at the `std::env` level.

8 years agomk: Account for libdir change on windows
Alex Crichton [Fri, 6 Nov 2015 00:06:25 +0000 (16:06 -0800)]
mk: Account for libdir change on windows

The recent change of libdir on windows was accidentally not propagated to
`make dist` and related commands. This commit touches that up!

Closes #29640

8 years agolibrustdoc: improve testnames for doctests
Kevin Butler [Wed, 4 Nov 2015 23:41:33 +0000 (23:41 +0000)]
librustdoc: improve testnames for doctests

8 years agoAuto merge of #29648 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 5 Nov 2015 21:51:29 +0000 (21:51 +0000)]
Auto merge of #29648 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #29609, #29611, #29613, #29614, #29619, #29624, #29630
- Failed merges:

8 years agoRollup merge of #29630 - apasel422:marker, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 21:28:50 +0000 (22:28 +0100)]
Rollup merge of #29630 - apasel422:marker, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #29624 - rilut:patch-1, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29624 - rilut:patch-1, r=steveklabnik

Thanks.
r? @steveklabnik

8 years agoRollup merge of #29619 - steveklabnik:gh28824, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29619 - steveklabnik:gh28824, r=alexcrichton

Fixes #28824

8 years agoRollup merge of #29614 - bluss:vec-drop-comment, r=Gankro
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29614 - bluss:vec-drop-comment, r=Gankro

vec: Remove old comment in Vec::drop

This comment was leftover from an earlier revision of a PR, something
that never was merged. There is no ZST special casing in Vec::drop.

8 years agoRollup merge of #29613 - steveklabnik:29506, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29613 - steveklabnik:29506, r=alexcrichton

in favor of just expect()

Fixes #29506

8 years agoRollup merge of #29611 - steveklabnik:gh25918, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 21:28:49 +0000 (22:28 +0100)]
Rollup merge of #29611 - steveklabnik:gh25918, r=alexcrichton

Originally, this was my 30 minute introduction, and we eventually made
it the opener to the book. But as #25918 has shown, the example I use
here has some issues. The good news is that Rust makes heap allocation
syntatically expensive, but the bad news is that that means showing
equivalent programs from Rust and other languages is difficult. After
thinking about it, I'm not sure this section is pulling its weight, and
since it has problems, I'd rather just pull it than try to re-write it
right now. I think the book is fine without it.

FIxes #25918

8 years agoRollup merge of #29609 - ivan:rustdoc-ctrl-s, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 21:28:48 +0000 (22:28 +0100)]
Rollup merge of #29609 - ivan:rustdoc-ctrl-s, r=steveklabnik

Rustdoc pages with a search box inadvertently override `ctrl-s` in addition to the intended `s` and `S` keys.  You can test this in at least Firefox and Chrome (tested: Windows): press `ctrl-s` on http://doc.rust-lang.org/std/.  The search box is focused when instead the browser's save feature should be activated.  This PR fixes `ctrl-s` and possibly other browser shortcuts.

8 years agoRemove stability annotations from trait impl items
Vadim Petrochenkov [Thu, 5 Nov 2015 21:13:46 +0000 (00:13 +0300)]
Remove stability annotations from trait impl items

Remove `stable` stability annotations from inherent impls

8 years agoAuto merge of #29583 - dotdash:mir_small_agg, r=nikomatsakis
bors [Thu, 5 Nov 2015 20:06:13 +0000 (20:06 +0000)]
Auto merge of #29583 - dotdash:mir_small_agg, r=nikomatsakis

Fix handling of small aggregate function arguments and assignments of temporaries to lvalues.

8 years agoTidy `core::marker` doc summaries
Andrew Paseltiner [Thu, 5 Nov 2015 18:29:46 +0000 (13:29 -0500)]
Tidy `core::marker` doc summaries

8 years agoAuto merge of #29565 - sfackler:issue-29540, r=huonw
bors [Thu, 5 Nov 2015 18:15:26 +0000 (18:15 +0000)]
Auto merge of #29565 - sfackler:issue-29540, r=huonw

Closes #29540

r? @huonw

8 years agodoc(lib.rs): fix #L79 with inline link syntax
Rizky Luthfianto [Thu, 5 Nov 2015 17:15:32 +0000 (00:15 +0700)]
doc(lib.rs): fix #L79 with inline link syntax

8 years agoConvert TODO into FIXME
Niko Matsakis [Thu, 5 Nov 2015 16:54:24 +0000 (11:54 -0500)]
Convert TODO into FIXME

8 years agoAuto merge of #29593 - ben0x539:reflect-doc-comment, r=steveklabnik
bors [Thu, 5 Nov 2015 16:29:07 +0000 (16:29 +0000)]
Auto merge of #29593 - ben0x539:reflect-doc-comment, r=steveklabnik

Rustdoc takes the first paragraph as a summary, so having a huge
paragraph that ends with introducing an example looked somewhat wrong on
the module page.

8 years agoBeef up macro designator docs
Steve Klabnik [Thu, 5 Nov 2015 15:46:56 +0000 (16:46 +0100)]
Beef up macro designator docs

Fixes #28824

8 years ago`EmbargoVisitor::reexports` isn't needed
Vadim Petrochenkov [Thu, 5 Nov 2015 15:42:48 +0000 (18:42 +0300)]
`EmbargoVisitor::reexports` isn't needed

8 years agoFix handling of fat pointer function arguments
Björn Steinbrink [Thu, 5 Nov 2015 15:18:45 +0000 (16:18 +0100)]
Fix handling of fat pointer function arguments

The store for the "extra" data went to the wrong destination.

8 years agorustc_privacy: Do not export items needed solely for the reachability analysis
Vadim Petrochenkov [Thu, 5 Nov 2015 15:17:33 +0000 (18:17 +0300)]
rustc_privacy: Do not export items needed solely for the reachability analysis

Process them in middle::reachable instead
Add tests for reachability of trait methods written in UFCS form

8 years agoremove excess string allocation
Steve Klabnik [Thu, 5 Nov 2015 14:30:32 +0000 (15:30 +0100)]
remove excess string allocation

&format!("...") is the same as "" if we're not doing any interpolation,
and doesn't allocate an intermediate String.

8 years agovec: Remove old comment in Vec::drop
Ulrik Sverdrup [Thu, 5 Nov 2015 13:37:45 +0000 (14:37 +0100)]
vec: Remove old comment in Vec::drop

This comment was leftover from an earlier revision of a PR, something
that never was merged. There is no ZST special casing in Vec::drop.

8 years agoRemove .ok().expect()
Steve Klabnik [Thu, 5 Nov 2015 13:40:50 +0000 (14:40 +0100)]
Remove .ok().expect()

in favor of just expect()

Fixes #29506

8 years agoRemove short intro from README
Steve Klabnik [Thu, 5 Nov 2015 13:04:39 +0000 (14:04 +0100)]
Remove short intro from README

Originally, this was my 30 minute introduction, and we eventually made
it the opener to the book. But as #25918 has shown, the example I use
here has some issues. The good news is that Rust makes heap allocation
syntatically expensive, but the bad news is that that means showing
equivalent programs from Rust and other languages is difficult. After
thinking about it, I'm not sure this section is pulling its weight, and
since it has problems, I'd rather just pull it than try to re-write it
right now. I think the book is fine without it.

FIxes #25918

8 years agoAuto merge of #29610 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 5 Nov 2015 12:49:44 +0000 (12:49 +0000)]
Auto merge of #29610 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #29416, #29537, #29538, #29539, #29567, #29568, #29571, #29579
- Failed merges:

8 years agodocs for Reflect: blank line after first sentence
Benjamin Herr [Wed, 4 Nov 2015 22:37:27 +0000 (23:37 +0100)]
docs for Reflect: blank line after first sentence

Rustdoc takes the first paragraph as a summary, so having a huge
paragraph that ends with introducing an example looked somewhat wrong on
the module page.

8 years agoRollup merge of #29579 - steveklabnik:gh27322, r=apasel422
Steve Klabnik [Thu, 5 Nov 2015 11:43:03 +0000 (12:43 +0100)]
Rollup merge of #29579 - steveklabnik:gh27322, r=apasel422

Fixes #27322

8 years agoRollup merge of #29571 - steveklabnik:gh29322, r=apasel422
Steve Klabnik [Thu, 5 Nov 2015 11:43:03 +0000 (12:43 +0100)]
Rollup merge of #29571 - steveklabnik:gh29322, r=apasel422

Fixes #29322

8 years agoRollup merge of #29568 - steveklabnik:gh24591, r=apasel422
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29568 - steveklabnik:gh24591, r=apasel422

Fixes #24591

8 years agoRollup merge of #29567 - Toby-S:patch-1, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29567 - Toby-S:patch-1, r=steveklabnik

Reword "Writing the logic" paragraph to prevent `unwrap` being confused for a macro (and other small changes to improve the flow of the paragraph).

cc @steveklabnik

8 years agoRollup merge of #29539 - shepmaster:empty-iterator-docs, r=Gankro
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29539 - shepmaster:empty-iterator-docs, r=Gankro

8 years agoRollup merge of #29538 - steveklabnik:ch1_edits, r=brson
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29538 - steveklabnik:ch1_edits, r=brson

I did some preliminary editing work with No Starch on the first chapter of the book, and here's some of the results. We're going to want to return to this later when @brson etc's new rustup work is done, so this is mostly just a first pass.

But, we agreed that having separate chapters for each of this bit of intro is a bit excessive. So let's move all of this intro stuff into one chapter.

I'd appreciate a careful review of this, as there was also some confusion about some things, which resulted in me taking one huge markdown file apart and splitting it back up, as well as some editor issues, so I _think_ this looks good, but double checking things matters!

/cc @aturon

8 years agoRollup merge of #29537 - bltavares:issue-24954, r=steveklabnik
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29537 - bltavares:issue-24954, r=steveklabnik

Closes #24954

8 years agoRollup merge of #29416 - brson:relnotes, r=alexcrichton
Steve Klabnik [Thu, 5 Nov 2015 11:43:02 +0000 (12:43 +0100)]
Rollup merge of #29416 - brson:relnotes, r=alexcrichton

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md)

More highlights would be good. I intend to go through and hyperlink all the APIs still.

8 years agolibrustdoc: don't override ctrl-s and other browser shortcuts
Ivan Kozik [Thu, 5 Nov 2015 10:39:02 +0000 (10:39 +0000)]
librustdoc: don't override ctrl-s and other browser shortcuts

8 years agoAuto merge of #28887 - steveklabnik:gh28851, r=alexcrichton
bors [Thu, 5 Nov 2015 10:30:02 +0000 (10:30 +0000)]
Auto merge of #28887 - steveklabnik:gh28851, r=alexcrichton

If you try to put something that's bigger than a char into a char
literal, you get an error:

    fn main() {
        let c = 'ஶ்ரீ';
    }

    error: unterminated character constant:

This is a very compiler-centric message. Yes, it's technically
'unterminated', but that's not what you, the user did wrong.

Instead, this commit changes it to

    error: character literal that's larger than a char:

As this actually tells you what went wrong.

Fixes #28851

8 years agoFixes as per @brson's review
Steve Klabnik [Thu, 5 Nov 2015 08:45:38 +0000 (09:45 +0100)]
Fixes as per @brson's review

8 years agoImprove error message for char literals
Steve Klabnik [Wed, 7 Oct 2015 16:26:50 +0000 (12:26 -0400)]
Improve error message for char literals

If you try to put something that's bigger than a char into a char
literal, you get an error:

    fn main() {
        let c = 'ஶ்ரீ';
    }

    error: unterminated character constant:

This is a very compiler-centric message. Yes, it's technically
'unterminated', but that's not what you, the user did wrong.

Instead, this commit changes it to

    error: character literal may only contain one codepoint

As this actually tells you what went wrong.

Fixes #28851

8 years agoAuto merge of #29581 - gereeter:unwrap-defmap-refcell, r=nrc
bors [Thu, 5 Nov 2015 04:24:01 +0000 (04:24 +0000)]
Auto merge of #29581 - gereeter:unwrap-defmap-refcell, r=nrc

This is basically a more conservative recreation of #24096.

8 years agoDeprecate `_ms` functions that predate the `Duration` API
Ben Striegel [Thu, 5 Nov 2015 01:11:01 +0000 (17:11 -0800)]
Deprecate `_ms` functions that predate the `Duration` API

8 years agoRemove use of RefCell<DefMap> in the simpler parts of pat_util
Jonathan S [Wed, 4 Nov 2015 12:26:00 +0000 (06:26 -0600)]
Remove use of RefCell<DefMap> in the simpler parts of pat_util

8 years agoRemove use of RefCell<DefMap> in resolve_lifetime
Jonathan S [Wed, 4 Nov 2015 06:26:41 +0000 (00:26 -0600)]
Remove use of RefCell<DefMap> in resolve_lifetime

8 years agoRemove use of RefCell<DefMap> in check_static_recursion
Jonathan S [Wed, 4 Nov 2015 06:20:31 +0000 (00:20 -0600)]
Remove use of RefCell<DefMap> in check_static_recursion

8 years agoUnwrap the RefCell around DefMap
Jonathan S [Wed, 4 Nov 2015 06:02:22 +0000 (00:02 -0600)]
Unwrap the RefCell around DefMap

8 years agoMore relnotes tweaks
Brian Anderson [Thu, 5 Nov 2015 00:56:23 +0000 (16:56 -0800)]
More relnotes tweaks

8 years agoAuto merge of #29543 - Amanieu:asm_mem_constraint, r=alexcrichton
bors [Wed, 4 Nov 2015 20:39:49 +0000 (20:39 +0000)]
Auto merge of #29543 - Amanieu:asm_mem_constraint, r=alexcrichton

The "m" memory constraint in inline assembly is broken (generates incorrect code or triggers LLVM asserts) and should not be used. Instead, indirect memory operands should be used with "\*m", "=\*m" and "+\*m".

Clang does this transparently by transforming "m" constraints into "\*m" indirect constraints, but for now just being able to use "\*m" directly is enough since asm! isn't stable.

While "\*m" works fine as an input operand, "=\*m" and "+\*m" need to be specified as input operands because they take a pointer value as an input. This PR relaxes the constraint checker to allow constraints starting with "=" or "+" if the constraint string contains a "\*", which indicates an indirect operand.

This (indirectly) fixes these issues: #29382, #16383 and #13366. The code will need to be changed to use "\*m" instead of "m".

8 years agoIntroduce a `SwitchInt` and restructure pattern matching to collect
Niko Matsakis [Mon, 26 Oct 2015 18:35:18 +0000 (14:35 -0400)]
Introduce a `SwitchInt` and restructure pattern matching to collect
integers and characters into one master switch.

8 years agoAuto merge of #29536 - sanxiyn:unused-assign-arg, r=alexcrichton
bors [Wed, 4 Nov 2015 18:52:07 +0000 (18:52 +0000)]
Auto merge of #29536 - sanxiyn:unused-assign-arg, r=alexcrichton

Fix #29136.

8 years ago[MIR-trans] Fix handling of non-alloca temps in trans_operand_into()
Björn Steinbrink [Wed, 4 Nov 2015 16:39:25 +0000 (17:39 +0100)]
[MIR-trans] Fix handling of non-alloca temps in trans_operand_into()