]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #22437: dotdash/fix_array_type
Alex Crichton [Wed, 18 Feb 2015 22:31:59 +0000 (14:31 -0800)]
rollup merge of #22437: dotdash/fix_array_type

In trans_slice_vec we currently use arrayalloca, which gives us a
pointer to the element type with enough memory allocated for the
requested number of elements.  This works, but everywhere else we use
the [n x T] type for fixed size arrays and so we have to bitcast the
pointer here. Let's directly use the proper type for the allocation and
remove some code duplication along the way.

9 years agorollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-assoc-types
Alex Crichton [Wed, 18 Feb 2015 22:31:58 +0000 (14:31 -0800)]
rollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-assoc-types

Take 2. This PR includes a bunch of refactoring that was part of an experimental branch implementing [implied bounds]. That particular idea isn't ready to go yet, but the refactoring proved useful for fixing #22246. The implied bounds branch also exposed #22110 so a simple fix for that is included here. I still think some more refactoring would be a good idea here -- in particular I think most of the code in wf.rs is kind of duplicating the logic in implicator and should go, but I decided to post this PR and call it a day before diving into that. I'll write a bit more details about the solutions I adopted in the various bugs. I patched the two issues I was concerned about, which was the handling of supertraits and HRTB (the latter turned out to be fine, so I added a comment explaining why.)

r? @pnkfelix (for now, anyway)
cc @aturon

[implied bounds]: http://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/

9 years agorollup merge of #22395: brson/readme-cleanup
Alex Crichton [Wed, 18 Feb 2015 22:31:57 +0000 (14:31 -0800)]
rollup merge of #22395: brson/readme-cleanup

Just a few things to make the README ever more perfect.

r? @steveklabnik

9 years agorollup merge of #22287: Ryman/purge_carthographers
Alex Crichton [Wed, 18 Feb 2015 22:31:55 +0000 (14:31 -0800)]
rollup merge of #22287: Ryman/purge_carthographers

This overlaps with #22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary.

This also implements `RandomAccessIterator` for `iter::Cloned`

cc @steveklabnik, you may want to glance at this before #22281 gets the bors treatment

9 years agorollup merge of #22118: fhahn/separate-parse-fail-2
Alex Crichton [Wed, 18 Feb 2015 22:31:23 +0000 (14:31 -0800)]
rollup merge of #22118: fhahn/separate-parse-fail-2

After making `rustc` fail on errors at a stop point, like `-Z parse-only`, in #22117, the files in this PR also fail during the parse stage and should be moved as well. Sorry for spliting this move up in two PRs.

9 years agorollup merge of #21886: dotdash/fast_slice_iter
Alex Crichton [Wed, 18 Feb 2015 22:31:21 +0000 (14:31 -0800)]
rollup merge of #21886: dotdash/fast_slice_iter

The data pointer used in the slice is never null, using assume() to tell
LLVM about it gets rid of various unneeded null checks when iterating
over the slice.

Since the snapshot compiler is still using an older LLVM version, omit
the call in stage0, because compile times explode otherwise.

Benchmarks from #18193
````
running 5 tests
test _range    ... bench:     33329 ns/iter (+/- 417)
test assembly  ... bench:     33299 ns/iter (+/- 58)
test enumerate ... bench:     33318 ns/iter (+/- 83)
test iter      ... bench:     33311 ns/iter (+/- 130)
test position  ... bench:     33300 ns/iter (+/- 47)

test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured
````

Fixes #18193

9 years agoRemove mention of wiki from README
Brian Anderson [Wed, 18 Feb 2015 21:48:46 +0000 (13:48 -0800)]
Remove mention of wiki from README

9 years agoAddress review feedback
Brian Anderson [Wed, 18 Feb 2015 21:46:20 +0000 (13:46 -0800)]
Address review feedback

9 years agoREADME: Simplify markdown
Brian Anderson [Mon, 16 Feb 2015 05:20:27 +0000 (21:20 -0800)]
README: Simplify markdown

9 years agoREADME: Add one sentence about what Rust is.
Brian Anderson [Mon, 16 Feb 2015 05:08:32 +0000 (21:08 -0800)]
README: Add one sentence about what Rust is.

Most people don't know what Rust is.

9 years agoREADME: Add a link to #rust
Brian Anderson [Mon, 16 Feb 2015 04:58:06 +0000 (20:58 -0800)]
README: Add a link to #rust

9 years agoREADME: Make the wiki links more useful.
Brian Anderson [Mon, 16 Feb 2015 04:46:21 +0000 (20:46 -0800)]
README: Make the wiki links more useful.

The page we want them to find is 'getting started developing'.

9 years agoREADME: Give a hint about how to build Cargo from source.
Brian Anderson [Mon, 16 Feb 2015 04:41:16 +0000 (20:41 -0800)]
README: Give a hint about how to build Cargo from source.

Just a hint.

9 years agoSimplify README by not talking about the source tarball option
Brian Anderson [Mon, 16 Feb 2015 04:20:25 +0000 (20:20 -0800)]
Simplify README by not talking about the source tarball option

I believe that few enough people build from source tarballs that
we don't have to talk about it explicitly.

9 years agoAdd rustc_attrs feature to test.
Niko Matsakis [Wed, 18 Feb 2015 20:24:20 +0000 (15:24 -0500)]
Add rustc_attrs feature to test.

9 years agoAlways prefer where-clauses over impls in trait selection. Fixes #22110.
Niko Matsakis [Mon, 16 Feb 2015 11:57:38 +0000 (06:57 -0500)]
Always prefer where-clauses over impls in trait selection. Fixes #22110.

9 years agoExtend the implicator so it produces general obligations and also so
Niko Matsakis [Sat, 14 Feb 2015 00:52:55 +0000 (19:52 -0500)]
Extend the implicator so it produces general obligations and also so
that it produces "outlives" relations for associated types. Add
several tests relating to #22246.

9 years agotraits: break apart the "full normalization" code used for normalizing
Niko Matsakis [Sat, 14 Feb 2015 00:51:43 +0000 (19:51 -0500)]
traits: break apart the "full normalization" code used for normalizing
parameter environments so that it can be used elsewhere.

9 years agoMove `tcx` from `Typer` into `ClosureTyper`
Niko Matsakis [Fri, 13 Feb 2015 22:31:44 +0000 (17:31 -0500)]
Move `tcx` from `Typer` into `ClosureTyper`

9 years agoMisc. cleanup in regionck: Remove a one-variant enum for some reason.
Niko Matsakis [Fri, 13 Feb 2015 22:25:05 +0000 (17:25 -0500)]
Misc. cleanup in regionck: Remove a one-variant enum for some reason.

9 years agoReplace `assert_no_late_bound_regions` with
Niko Matsakis [Fri, 13 Feb 2015 22:23:45 +0000 (17:23 -0500)]
Replace `assert_no_late_bound_regions` with
`no_late_bound_regions().unwrap()`, which allows us to write code that
doesn't necessarily *fail* when there are higher-ranked trait bounds.

9 years agoRename various things to "implications"
Niko Matsakis [Wed, 4 Feb 2015 15:48:29 +0000 (10:48 -0500)]
Rename various things to "implications"

9 years agoRename regionmanip to implicator.
Niko Matsakis [Wed, 4 Feb 2015 15:33:56 +0000 (10:33 -0500)]
Rename regionmanip to implicator.

9 years agoEliminate excessive null-checks from slice iterators
Björn Steinbrink [Mon, 2 Feb 2015 18:25:44 +0000 (19:25 +0100)]
Eliminate excessive null-checks from slice iterators

The data pointer used in the slice is never null, using assume() to tell
LLVM about it gets rid of various unneeded null checks when iterating
over the slice.

Since the snapshot compiler is still using an older LLVM version, omit
the call in stage0, because compile times explode otherwise.

Benchmarks from #18193
````
running 5 tests
test _range    ... bench:     33329 ns/iter (+/- 417)
test assembly  ... bench:     33299 ns/iter (+/- 58)
test enumerate ... bench:     33318 ns/iter (+/- 83)
test iter      ... bench:     33311 ns/iter (+/- 130)
test position  ... bench:     33300 ns/iter (+/- 47)

test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured
````

Fixes #18193

9 years agoAvoid ptrtoint when checking if a pointer is null
Björn Steinbrink [Mon, 2 Feb 2015 20:45:49 +0000 (21:45 +0100)]
Avoid ptrtoint when checking if a pointer is null

Casting the pointer to an integer requires a ptrtoint, while casting 0
to a pointer is directly folded to a `null` value.

9 years ago Manual merge of #22475 - alexcrichton:rollup, r=alexcrichton
Huon Wilson [Wed, 18 Feb 2015 12:50:21 +0000 (23:50 +1100)]
 Manual merge of #22475 - alexcrichton:rollup, r=alexcrichton

 One windows bot failed spuriously.

9 years agoRegister new snapshots
Alex Crichton [Wed, 18 Feb 2015 03:49:22 +0000 (19:49 -0800)]
Register new snapshots

9 years agoTest fixes and rebase conflicts
Alex Crichton [Wed, 18 Feb 2015 03:00:20 +0000 (19:00 -0800)]
Test fixes and rebase conflicts

9 years agorollup merge of #22319: huonw/send-is-not-static
Alex Crichton [Wed, 18 Feb 2015 01:32:16 +0000 (17:32 -0800)]
rollup merge of #22319: huonw/send-is-not-static

Conflicts:
src/libstd/sync/task_pool.rs
src/libstd/thread.rs
src/libtest/lib.rs
src/test/bench/shootout-reverse-complement.rs
src/test/bench/shootout-spectralnorm.rs

9 years agoTest fixes and rebase conflicts
Alex Crichton [Tue, 17 Feb 2015 23:24:34 +0000 (15:24 -0800)]
Test fixes and rebase conflicts

9 years agorollup merge of #22394: alexcrichton/vec-from-iter-comment
Alex Crichton [Tue, 17 Feb 2015 23:24:18 +0000 (15:24 -0800)]
rollup merge of #22394: alexcrichton/vec-from-iter-comment

Requested by Niko in #22200 (and is good to have anyway)

9 years agorollup merge of #22435: aturon/final-stab-thread
Alex Crichton [Tue, 17 Feb 2015 23:19:18 +0000 (15:19 -0800)]
rollup merge of #22435: aturon/final-stab-thread

Conflicts:
src/test/bench/rt-messaging-ping-pong.rs
src/test/bench/rt-parfib.rs
src/test/bench/task-perf-spawnalot.rs

9 years agorollup merge of #22460: ArtemGr/patch-1
Alex Crichton [Tue, 17 Feb 2015 23:16:25 +0000 (15:16 -0800)]
rollup merge of #22460: ArtemGr/patch-1

An "immutable reference-counted pointer" is confusing, one might think that the `Rc` itself is immutable which isn't the case.
cf. http://www.reddit.com/r/rust/comments/2w75wr/how_do_i_read_immutable_vector_inside_a_spawned/coo6mm2

9 years agorollup merge of #22459: alexcrichton/feature-names
Alex Crichton [Tue, 17 Feb 2015 23:16:22 +0000 (15:16 -0800)]
rollup merge of #22459: alexcrichton/feature-names

Conflicts:
src/rustbook/main.rs

9 years agorollup merge of #22457: steveklabnik/gh22361
Alex Crichton [Tue, 17 Feb 2015 23:15:05 +0000 (15:15 -0800)]
rollup merge of #22457: steveklabnik/gh22361

FIxes #22361

9 years agorollup merge of #22456: steveklabnik/fix_grammar
Alex Crichton [Tue, 17 Feb 2015 23:15:03 +0000 (15:15 -0800)]
rollup merge of #22456: steveklabnik/fix_grammar

Noticed in #22429

9 years agorollup merge of #22455: msiemens/add-vec-from_elem
Alex Crichton [Tue, 17 Feb 2015 23:15:01 +0000 (15:15 -0800)]
rollup merge of #22455: msiemens/add-vec-from_elem

Implement `Vec::from_elem` by making the `vec![element; len]` macro more powerful (see rust-lang/rfcs#832).

Closes #22414

r? @Gankro

9 years agorollup merge of #22454: alexcrichton/stabilize-into-iterator
Alex Crichton [Tue, 17 Feb 2015 23:14:59 +0000 (15:14 -0800)]
rollup merge of #22454: alexcrichton/stabilize-into-iterator

Now that the necessary associated types exist for the `IntoIterator` trait this
commit stabilizes the trait as-is as well as all existing implementations.

9 years agorollup merge of #22441: msiemens/typo_fix
Alex Crichton [Tue, 17 Feb 2015 23:14:56 +0000 (15:14 -0800)]
rollup merge of #22441: msiemens/typo_fix

9 years agorollup merge of #22440: semarie/openbsd-connect_error
Alex Crichton [Tue, 17 Feb 2015 23:14:52 +0000 (15:14 -0800)]
rollup merge of #22440: semarie/openbsd-connect_error

The `connect_error` test check if connecting to "0.0.0.0:1" works (it
shouldn't). And in case of error, the test expects a `ConnectionRefused`
error.

Under OpenBSD, trying to connect to "0.0.0.0" isn't a `ConnectionRefused`:
it is an `InvalidInput` error.

The patch allow the error to be `ConnectionRefused` or `InvalidInput`.

Another possibility is to check connecting to "127.0.0.1:1" and expects only `ConnectionRefused` error.

9 years agorollup merge of #22332: dotdash/llvmup_20150213
Alex Crichton [Tue, 17 Feb 2015 23:14:18 +0000 (15:14 -0800)]
rollup merge of #22332: dotdash/llvmup_20150213

Fixes the crash blocking #21886.

9 years agorollup merge of #22331: steveklabnik/guidelines
Alex Crichton [Tue, 17 Feb 2015 23:14:14 +0000 (15:14 -0800)]
rollup merge of #22331: steveklabnik/guidelines

Fixes #19315

r? @aturon

9 years agolibrustc: implement Clone for middle::ty::FreeVar
Kevin Butler [Sun, 15 Feb 2015 06:45:23 +0000 (06:45 +0000)]
librustc: implement Clone for middle::ty::FreeVar

9 years agoRemove usage of .map(|&foo| foo)
Kevin Butler [Sun, 15 Feb 2015 05:19:50 +0000 (05:19 +0000)]
Remove usage of .map(|&foo| foo)

9 years agoOpt for .cloned() over .map(|x| x.clone()) etc.
Kevin Butler [Fri, 13 Feb 2015 07:33:44 +0000 (07:33 +0000)]
Opt for .cloned() over .map(|x| x.clone()) etc.

9 years agoImplement RandomAccessIterator for Cloned
Kevin Butler [Fri, 13 Feb 2015 17:27:43 +0000 (17:27 +0000)]
Implement RandomAccessIterator for Cloned

9 years agoUpdate tests for the Send - 'static change.
Huon Wilson [Tue, 17 Feb 2015 12:48:32 +0000 (23:48 +1100)]
Update tests for the Send - 'static change.

9 years agostd: Add Vec::from_iter comment
Alex Crichton [Mon, 16 Feb 2015 05:04:20 +0000 (21:04 -0800)]
std: Add Vec::from_iter comment

Requested by Niko in #22200 (and is good to have anyway)

9 years agoFallout from stabilization
Aaron Turon [Tue, 17 Feb 2015 23:10:25 +0000 (15:10 -0800)]
Fallout from stabilization

9 years agorollup merge of #22208: aturon/expose-more-path
Alex Crichton [Tue, 17 Feb 2015 23:13:53 +0000 (15:13 -0800)]
rollup merge of #22208: aturon/expose-more-path

This commit exposes the `is_sep` function and `MAIN_SEP` constant, as
well as Windows path prefixes. The path prefix enum is safely exposed on
all platforms, but it only yielded as a component for Windows.

Exposing the prefix enum as part of prefix components involved changing
the type from `OsStr` to the `Prefix` enum, which is a:

[breaking-change]

9 years agorollup merge of #22191: nagisa/target-ptr-width-json
Alex Crichton [Tue, 17 Feb 2015 23:13:46 +0000 (15:13 -0800)]
rollup merge of #22191: nagisa/target-ptr-width-json

This aligns json target specification to match terminology used elsewhere in the code base.

[breaking-change] for custom target json users. Change all appearances of target-word-size
to target-pointer-width.

9 years agorollup merge of #22123: steveklabnik/doc_where_clauses
Alex Crichton [Tue, 17 Feb 2015 23:13:42 +0000 (15:13 -0800)]
rollup merge of #22123: steveklabnik/doc_where_clauses

Closes #21859.

9 years agorollup merge of #22024: alexcrichton/ascii
Alex Crichton [Tue, 17 Feb 2015 23:13:20 +0000 (15:13 -0800)]
rollup merge of #22024: alexcrichton/ascii

* Move the type parameter on the `AsciiExt` trait to an associated type named
  `Owned`.
* Move `ascii::escape_default` to using an iterator.

This is a breaking change due to the removal of the type parameter on the
`AsciiExt` trait as well as the modifications to the `escape_default` function
to returning an iterator. Manual implementations of `AsciiExt` (or `AsciiExt`
bounds) should be adjusted to remove the type parameter and using the new
`escape_default` should be relatively straightforward.

[breaking-change]

9 years agoRevise std::thread semantics
Aaron Turon [Tue, 17 Feb 2015 09:08:53 +0000 (01:08 -0800)]
Revise std::thread semantics

This commit makes several changes to `std::thread` in preparation for
final stabilization:

* It removes the ability to handle panics from `scoped` children; see
  #20807 for discussion

* It adds a `JoinHandle` structure, now returned from `spawn`, which
  makes it possible to join on children that do not share data from
  their parent's stack. The child is automatically detached when the
  handle is dropped, and the handle cannot be copied due to Posix
  semantics.

* It moves all static methods from `std::thread::Thread` to free
  functions in `std::thread`. This was done in part because, due to the
  above changes, there are effectively no direct `Thread` constructors,
  and the static methods have tended to feel a bit awkward.

* Adds an `io::Result` around the `Builder` methods `scoped` and
  `spawn`, making it possible to handle OS errors when creating
  threads. The convenience free functions entail an unwrap.

* Stabilizes the entire module. Despite the fact that the API is
  changing somewhat here, this is part of a long period of baking and
  the changes are addressing all known issues prior to alpha2. If
  absolutely necessary, further breaking changes can be made prior to beta.

Closes #20807

[breaking-change]

9 years agostd: Rename io/path features with old_ prefix
Alex Crichton [Tue, 17 Feb 2015 19:05:44 +0000 (11:05 -0800)]
std: Rename io/path features with old_ prefix

This commit renames the features for the `std::old_io` and `std::old_path`
modules to `old_io` and `old_path` to help facilitate migration to the new APIs.

This is a breaking change as crates which mention the old feature names now need
to be renamed to use the new feature names.

[breaking-change]

9 years agostd: Stabilize the `ascii` module
Alex Crichton [Tue, 17 Feb 2015 21:58:34 +0000 (13:58 -0800)]
std: Stabilize the `ascii` module

This commit performs a stabilization pass over the `std::ascii` module taking
the following actions:

* the module name is now stable
* `AsciiExt` is now stable after moving its type parameter to an `Owned`
  associated type
* `AsciiExt::is_ascii` is now stable
* `AsciiExt::to_ascii_uppercase` is now stable
* `AsciiExt::to_ascii_lowercase` is now stable
* `AsciiExt::eq_ignore_ascii_case` is now stable
* `AsciiExt::make_ascii_uppercase` is added to possibly replace
  `OwnedAsciiExt::into_ascii_uppercase` (similarly for lowercase variants).
* `escape_default` now returns an iterator and is stable
* `EscapeDefault` is now stable

Trait implementations are now also marked stable.

Primarily it is still unstable to *implement* the `AsciiExt` trait due to it
containing some unstable methods.

[breaking-change]

9 years agorustc: Track stability of trait implementations
Alex Crichton [Tue, 17 Feb 2015 21:56:06 +0000 (13:56 -0800)]
rustc: Track stability of trait implementations

Previously an implementation of a stable trait allows implementations of
unstable methods. This updates the stability pass to ensure that all items of an
impl block of a trait are indeed stable on the trait itself.

9 years agoAdd missing marker to std::thread::JoinGuard.
Huon Wilson [Tue, 17 Feb 2015 12:09:14 +0000 (23:09 +1100)]
Add missing marker to std::thread::JoinGuard.

The lifetime was previously, incorrectly unconstrained.

9 years agoAdd tests for the removal of the 'static superbound from Send.
Huon Wilson [Sat, 14 Feb 2015 05:05:15 +0000 (16:05 +1100)]
Add tests for the removal of the 'static superbound from Send.

9 years agoAdd Send implementations for `&` and `&mut`.
Huon Wilson [Fri, 13 Feb 2015 13:07:48 +0000 (00:07 +1100)]
Add Send implementations for `&` and `&mut`.

Per RFC 458.

Closes #22251.

9 years agoUpdate the libraries to reflect Send loosing the 'static bound.
Huon Wilson [Fri, 13 Feb 2015 11:58:37 +0000 (22:58 +1100)]
Update the libraries to reflect Send loosing the 'static bound.

In most places this preserves the current API by adding an explicit
`'static` bound.

Notably absent are some impls like `unsafe impl<T: Send> Send for
Foo<T>` and the `std::thread` module. It is likely that it will be
possible to remove these after auditing the code to ensure restricted
lifetimes are safe.

More progress on #22251.

9 years agoRemove the implicit `'static` bound on `Send`.
Huon Wilson [Fri, 13 Feb 2015 04:15:05 +0000 (15:15 +1100)]
Remove the implicit `'static` bound on `Send`.

Previously Send was defined as `trait Send: 'static {}`. As detailed in
https://github.com/rust-lang/rfcs/pull/458, the `'static` bound is not
actually necessary for safety, we can use lifetimes to enforce that more
flexibly.

`unsafe` code that was previously relying on `Send` to insert a
`'static` bound now may allow incorrect patterns, and so should be
audited (a quick way to ensure safety immediately and postpone the audit
is to add an explicit `'static` bound to any uses of the `Send` type).

cc #22251.

9 years agoImplement `Vec::from_elem` (RFC 832)
Markus Siemens [Tue, 17 Feb 2015 16:44:46 +0000 (17:44 +0100)]
Implement `Vec::from_elem` (RFC 832)

Implement `Vec::from_elem` by making the `vec![element; len]` macro
more powerful (see RFC 832).

Closes #22414

9 years agoAuto merge of #21774 - ejjeong:enable-test-for-android, r=alexcrichton
bors [Tue, 17 Feb 2015 19:35:12 +0000 (19:35 +0000)]
Auto merge of #21774 - ejjeong:enable-test-for-android, r=alexcrichton

- Now "make check-stage2-T-aarch64-linux-android-H-x86_64-unknown-linux-gnu" works (#21773)
- Fix & enable debuginfo tests for android (#10381)
- Fix & enable more tests for android (both for arm/aarch64)
- Enable many already-pass tests on android (both for arm/aarch64)

9 years agoRc itself isn't immutable.
Artem [Tue, 17 Feb 2015 19:15:46 +0000 (22:15 +0300)]
Rc itself isn't immutable.

An "immutable reference-counted pointer" is confusing, one might think that the `Rc` itself is immutable which isn't the case.

9 years agoClarify RingBuf documentation.
Steve Klabnik [Tue, 17 Feb 2015 18:45:35 +0000 (13:45 -0500)]
Clarify RingBuf documentation.

FIxes #22361

9 years agoFix grammar in error message
Steve Klabnik [Tue, 17 Feb 2015 18:42:31 +0000 (13:42 -0500)]
Fix grammar in error message

Noticed in #22429

9 years agostd: Stabilize the IntoIterator trait
Alex Crichton [Tue, 17 Feb 2015 18:06:24 +0000 (10:06 -0800)]
std: Stabilize the IntoIterator trait

Now that the necessary associated types exist for the `IntoIterator` trait this
commit stabilizes the trait as-is as well as all existing implementations.

9 years agoremove .gitignore
Steve Klabnik [Tue, 17 Feb 2015 17:30:07 +0000 (12:30 -0500)]
remove .gitignore

9 years agofix doctest
Manish Goregaokar [Tue, 17 Feb 2015 15:58:54 +0000 (21:28 +0530)]
fix doctest

9 years agoAuto merge of #22311 - lfairy:consistent-fmt, r=alexcrichton
bors [Tue, 17 Feb 2015 15:55:55 +0000 (15:55 +0000)]
Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichton

This brings it in line with its namesake in `std::io`.

[breaking-change]

r? @aturon

9 years agofix windows
Manish Goregaokar [Tue, 17 Feb 2015 15:02:22 +0000 (20:32 +0530)]
fix windows

9 years agoFix failing tests
Manish Goregaokar [Tue, 17 Feb 2015 11:50:08 +0000 (17:20 +0530)]
Fix failing tests

9 years agoFix removal of complement-bugreport.md
Manish Goregaokar [Tue, 17 Feb 2015 10:57:23 +0000 (16:27 +0530)]
Fix removal of complement-bugreport.md

9 years agoRollup merge of #22393 - kmcallister:macros-chapter , r=steveklabnik
Manish Goregaokar [Tue, 17 Feb 2015 12:03:53 +0000 (17:33 +0530)]
Rollup merge of #22393 - kmcallister:macros-chapter , r=steveklabnik

This is a more introductory document, suitable for Part II. The arcane details move to an "Advanced macros" chapter in Part III.

Conflicts:
src/doc/trpl/macros.md

9 years agoRollup merge of #22383 - pnkfelix:pass-features-along-during-expansion, r=huonw
Manish Goregaokar [Tue, 17 Feb 2015 10:24:25 +0000 (15:54 +0530)]
Rollup merge of #22383 - pnkfelix:pass-features-along-during-expansion, r=huonw

 Pass features along during expansion

Use the set of passed features to detect uses of feature-gated macros without the corresponding feature enabled.

Fix #22234.

----

Also, the framework this add (passing along a reference to the features in the expansion context) is a necessary precursor for landing a properly feature-gated desugaring-based overloaded-`box` and placement-`in` (#22181).

----

This is fixing a bug, but since there might be code out there that is unknowingly taking advantage of that bug, I feel obligated to mark this as a:

[breaking-change]

9 years agoRollup merge of #22030 - mdinger:f32_examples, r=steveklabnik
Manish Goregaokar [Tue, 17 Feb 2015 10:22:16 +0000 (15:52 +0530)]
Rollup merge of #22030 - mdinger:f32_examples, r=steveklabnik

 Some examples for `std::num::Float`

~~This is WIP for making examples for `f32`. This probably won't pass `make tidy` and I'm not sure which `f32` needs documentation. https://github.com/rust-lang/rust/issues/22025 shows 2 sets of `f32` which seems split between `core` and `std`. I'm not sure which should be documented but I started doing a couple from `std`. Easy to move if that's where they go...~~

~~Gotta build it eventually to actually see if the docs actually appear where I think they will or if I'm just disillusioned.~~

cc @steveklabnik

9 years agoRollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichton
Manish Goregaokar [Tue, 17 Feb 2015 10:22:01 +0000 (15:52 +0530)]
Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichton

 This brings it in line with its namesake in `std::io`.

[breaking-change]

r? @aturon

9 years agoRollup merge of #22364 - Manishearth:rfc-572-forbid-attr, r=nikomatsakis
Manish Goregaokar [Tue, 17 Feb 2015 10:21:53 +0000 (15:51 +0530)]
Rollup merge of #22364 - Manishearth:rfc-572-forbid-attr, r=nikomatsakis

 fixes #22203

r? @nikomatsakis

This breaks code that might be using attributes randomly, so it's technically a

[breaking-change]

9 years agoRollup merge of #22404 - semarie:signal_reported_right, r=aturon
Manish Goregaokar [Tue, 17 Feb 2015 10:21:18 +0000 (15:51 +0530)]
Rollup merge of #22404 - semarie:signal_reported_right, r=aturon

 The test \"signal_reported_right\" send a signal `1` to `/bin/sh`, and check
the status code to check if the signal is reported right.

Under OpenBSD, the signal `1` (`SIGHUP`) is catched by `/bin/sh`,
resulting the test failed.

Use the uncatchable signal `9` (`SIGKILL`) for test.

9 years agoRollup merge of #22433 - sfackler:seek-docs, r=aturon
Manish Goregaokar [Tue, 17 Feb 2015 10:11:34 +0000 (15:41 +0530)]
Rollup merge of #22433 - sfackler:seek-docs, r=aturon

r? @aturon

9 years agoRollup merge of #22410 - Reignbeaux:master, r=steveklabnik
Manish Goregaokar [Tue, 17 Feb 2015 10:11:34 +0000 (15:41 +0530)]
Rollup merge of #22410 - Reignbeaux:master, r=steveklabnik

I just stumbled on a typo and fixed it.

9 years agoRollup merge of #22408 - steveklabnik:gh19321, r=nikomatsakis
Manish Goregaokar [Tue, 17 Feb 2015 10:11:34 +0000 (15:41 +0530)]
Rollup merge of #22408 - steveklabnik:gh19321, r=nikomatsakis

Fixes #19321

... I think? `make check` passes, but I'm not 100% sure that there's a test for that behavior. Thoughts?

9 years agoRollup merge of #22402 - nagisa:spring-cleanup-2, r=nikomatsakis
Manish Goregaokar [Tue, 17 Feb 2015 10:11:34 +0000 (15:41 +0530)]
Rollup merge of #22402 - nagisa:spring-cleanup-2, r=nikomatsakis

This commit mostly replaces some of the uses of os::args with env::args.

This, for obvious reasons is based on top of #22400. Do not r+ before that lands.

9 years agoRollup merge of #22401 - pnkfelix:fsk-int-uint-audit, r=Gankro
Manish Goregaokar [Tue, 17 Feb 2015 10:11:33 +0000 (15:41 +0530)]
Rollup merge of #22401 - pnkfelix:fsk-int-uint-audit, r=Gankro

cc #22240

9 years agoRollup merge of #22394 - alexcrichton:vec-from-iter-comment, r=brson
Manish Goregaokar [Tue, 17 Feb 2015 10:11:33 +0000 (15:41 +0530)]
Rollup merge of #22394 - alexcrichton:vec-from-iter-comment, r=brson

Requested by Niko in #22200 (and is good to have anyway)

9 years agoRollup merge of #22385 - dotdash:slice_by_val_copy, r=nikomatsakis
Manish Goregaokar [Tue, 17 Feb 2015 10:11:33 +0000 (15:41 +0530)]
Rollup merge of #22385 - dotdash:slice_by_val_copy, r=nikomatsakis

When matching against strings/slices, we call the comparison function
for strings, which takes two string slices by value. The slices are
passed in memory, and currently we just pass in a pointer to the
original slice. That can cause misoptimizations because we emit a call
to llvm.lifetime.end for all by-value arguments at the end of a
function, which in this case marks the original slice as dead.

So we need to properly create copies of the slices to pass them to the
comparison function.

Fixes #22008

9 years agoRollup merge of #22333 - caipre:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 17 Feb 2015 10:11:33 +0000 (15:41 +0530)]
Rollup merge of #22333 - caipre:patch-1, r=steveklabnik

The `Circle::grow` method multiplies the radius by a factor of 10, not 2.

9 years agoRollup merge of #22296 - steveklabnik:gh21577, r=Gankro
Manish Goregaokar [Tue, 17 Feb 2015 10:11:32 +0000 (15:41 +0530)]
Rollup merge of #22296 - steveklabnik:gh21577, r=Gankro

Fixes #21577.

9 years agoRollup merge of #22282 - steveklabnik:gh5831, r=brson
Manish Goregaokar [Tue, 17 Feb 2015 10:11:32 +0000 (15:41 +0530)]
Rollup merge of #22282 - steveklabnik:gh5831, r=brson

This redux of CONTRIBUTING.md adds in more information, including
subsuming both compliment-bugreport.md and Note-development-policy
in the wiki.

I only glanced at the broad TOC of Note-development-policy, and did
not use the text as the basis for the re-write. This will then address
the last outstanding part of #5831.

9 years agoFix a small typo in libstd/fs.rs
Markus Siemens [Tue, 17 Feb 2015 10:22:27 +0000 (11:22 +0100)]
Fix a small typo in libstd/fs.rs

9 years agoopenbsd: adapt connect_error test
Sébastien Marie [Tue, 17 Feb 2015 10:11:53 +0000 (11:11 +0100)]
openbsd: adapt connect_error test

The connect_error test check if connecting to "0.0.0.0:1" works (it
shouldn't). And in case of error, the test expects a ConnectionRefused
error.

Under OpenBSD, trying to connect to "0.0.0.0" isn't a ConnectionRefused:
it is an InvalidInput error.

The patch allow the error to be ConnectionRefused or InvalidInput.

9 years agoRollup merge of #22232 - alexcrichton:missing-fmt-stability, r=aturon
Manish Goregaokar [Tue, 17 Feb 2015 10:11:30 +0000 (15:41 +0530)]
Rollup merge of #22232 - alexcrichton:missing-fmt-stability, r=aturon

The `Arguments::new_v1_formatted` function was accidentally left out when this
module was stabilized.

9 years agoRollup merge of #22111 - robinst:option-docs-flatmap, r=steveklabnik
Manish Goregaokar [Tue, 17 Feb 2015 10:11:30 +0000 (15:41 +0530)]
Rollup merge of #22111 - robinst:option-docs-flatmap, r=steveklabnik

Some newcomers might look for a "flatMap" method on Option. Include the
reference so that searching the page would find "and_then".

9 years agoRollup merge of #22027 - iblech:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 17 Feb 2015 10:11:30 +0000 (15:41 +0530)]
Rollup merge of #22027 - iblech:patch-1, r=steveklabnik

The first commit adds a short note which I believe will reduce worries in people who work with closures very often and read the Rust book for their first time.

The second commit consists solely of tiny typo fixes. In some cases, I changed "logical" quotations like

    She said, "I like programming".

to

    She said, "I like programming."

because the latter seems to be the prevalent style in the book.

9 years agoRollup merge of #21990 - steveklabnik:doc_core_cmp, r=huonw
Manish Goregaokar [Tue, 17 Feb 2015 10:11:30 +0000 (15:41 +0530)]
Rollup merge of #21990 - steveklabnik:doc_core_cmp, r=huonw

Fix up, add examples, make them all the same.

9 years agoUse the right array type in trans_slice_vec
Björn Steinbrink [Tue, 17 Feb 2015 09:43:27 +0000 (10:43 +0100)]
Use the right array type in trans_slice_vec

In trans_slice_vec we currently use arrayalloca, which gives us a
pointer to the element type with enough memory allocated for the
requested number of elements.  This works, but everywhere else we use
the [n x T] type for fixed size arrays and so we have to bitcast the
pointer here. Let's directly use the proper type for the allocation and
remove some code duplication along the way.

9 years agoAuto merge of #22397 - Manishearth:rollup, r=huonw
bors [Tue, 17 Feb 2015 05:57:55 +0000 (05:57 +0000)]
Auto merge of #22397 - Manishearth:rollup, r=huonw

None

9 years agoMake io::Seek docs less prescriptive
Steven Fackler [Tue, 17 Feb 2015 05:03:39 +0000 (21:03 -0800)]
Make io::Seek docs less prescriptive

9 years agoAuto merge of #21932 - Jormundir:std-os-errno-type, r=alexcrichton
bors [Tue, 17 Feb 2015 03:42:54 +0000 (03:42 +0000)]
Auto merge of #21932 - Jormundir:std-os-errno-type, r=alexcrichton

Changes std::os::errno to return i32, the return type used by the function being delegated to.

This is my first contribution, so feel free to give me advice. I'll be happy to correct things.