Commit Graph

38654 Commits

Author SHA1 Message Date
Alex Crichton
c14cf4dc86 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
2015-02-17 17:27:01 -08:00
Alex Crichton
d8ba8b00a7 rollup merge of #22459: alexcrichton/feature-names
Conflicts:
	src/rustbook/main.rs
2015-02-17 17:26:59 -08:00
Alex Crichton
c166fd3041 rollup merge of #22457: steveklabnik/gh22361
FIxes #22361
2015-02-17 17:26:45 -08:00
Alex Crichton
fd5403a37a rollup merge of #22456: steveklabnik/fix_grammar
Noticed in #22429
2015-02-17 17:26:44 -08:00
Alex Crichton
6d7a5e7094 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
2015-02-17 17:26:44 -08:00
Alex Crichton
f10f7f52b0 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.
2015-02-17 17:26:44 -08:00
Alex Crichton
d25d044a01 rollup merge of #22441: msiemens/typo_fix 2015-02-17 17:26:44 -08:00
Alex Crichton
f807b6a61e 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.
2015-02-17 17:26:44 -08:00
Alex Crichton
02c276175a rollup merge of #22332: dotdash/llvmup_20150213
Fixes the crash blocking #21886.
2015-02-17 17:26:43 -08:00
Alex Crichton
25ccf3c0da rollup merge of #22331: steveklabnik/guidelines
Fixes #19315

r? @aturon
2015-02-17 17:26:43 -08:00
Alex Crichton
eca2453a02 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]
2015-02-17 15:13:53 -08:00
Alex Crichton
5be2b8964c 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.
2015-02-17 15:13:46 -08:00
Alex Crichton
311fc36a57 rollup merge of #22123: steveklabnik/doc_where_clauses
Closes #21859.
2015-02-17 15:13:42 -08:00
Alex Crichton
f492095eb4 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]
2015-02-17 15:13:20 -08:00
Alex Crichton
a2ebb24ee6 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]
2015-02-17 14:02:45 -08:00
Alex Crichton
235f35b0b7 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]
2015-02-17 13:58:34 -08:00
Alex Crichton
0cf2d00f0e 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.
2015-02-17 13:56:06 -08:00
Markus Siemens
2bf553c3e0 Implement Vec::from_elem (RFC 832)
Implement `Vec::from_elem` by making the `vec![element; len]` macro
more powerful (see RFC 832).

Closes #22414
2015-02-17 21:49:31 +01:00
Artem
42055e37c5 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.
2015-02-17 22:15:46 +03:00
Steve Klabnik
0a795c29a4 Clarify RingBuf documentation.
FIxes #22361
2015-02-17 13:45:35 -05:00
Steve Klabnik
f71a0ea60b Fix grammar in error message
Noticed in #22429
2015-02-17 13:42:31 -05:00
Alex Crichton
cc687869ab 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.
2015-02-17 10:06:24 -08:00
Steve Klabnik
01c520818c remove .gitignore 2015-02-17 12:30:07 -05:00
Manish Goregaokar
096b1052d0 fix doctest 2015-02-17 21:28:54 +05:30
bors
f9aeea7cb7 Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichton
This brings it in line with its namesake in `std::io`.

[breaking-change]

r? @aturon
2015-02-17 15:55:55 +00:00
Manish Goregaokar
10f51fc412 fix windows 2015-02-17 20:32:22 +05:30
Manish Goregaokar
a6724989ce Fix failing tests 2015-02-17 17:34:00 +05:30
Manish Goregaokar
bb0bbf639e Fix removal of complement-bugreport.md 2015-02-17 17:34:00 +05:30
Manish Goregaokar
09eb965903 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
2015-02-17 17:33:53 +05:30
Manish Goregaokar
020e4e4ad9 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]
2015-02-17 17:33:20 +05:30
Manish Goregaokar
0e89228361 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
2015-02-17 17:33:20 +05:30
Manish Goregaokar
bf52f2eef5 Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichton
This brings it in line with its namesake in `std::io`.

[breaking-change]

r? @aturon
2015-02-17 17:33:20 +05:30
Manish Goregaokar
4647d89205 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]
2015-02-17 17:33:19 +05:30
Manish Goregaokar
1a1ac6c1ab 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.
2015-02-17 17:33:19 +05:30
Manish Goregaokar
5e0adf2401 Rollup merge of #22433 - sfackler:seek-docs, r=aturon
r? @aturon
2015-02-17 17:33:19 +05:30
Manish Goregaokar
9eed8b1c27 Rollup merge of #22410 - Reignbeaux:master, r=steveklabnik
I just stumbled on a typo and fixed it.
2015-02-17 17:33:19 +05:30
Manish Goregaokar
be83d60298 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?
2015-02-17 17:33:18 +05:30
Manish Goregaokar
2833976ccc 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.
2015-02-17 17:33:18 +05:30
Manish Goregaokar
c0865dfe1c Rollup merge of #22401 - pnkfelix:fsk-int-uint-audit, r=Gankro
cc #22240
2015-02-17 17:33:18 +05:30
Manish Goregaokar
071f8cc9ac Rollup merge of #22394 - alexcrichton:vec-from-iter-comment, r=brson
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17 17:33:18 +05:30
Manish Goregaokar
34ab88e30b 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
2015-02-17 17:33:17 +05:30
Manish Goregaokar
4a7eed1e01 Rollup merge of #22333 - caipre:patch-1, r=steveklabnik
The `Circle::grow` method multiplies the radius by a factor of 10, not 2.
2015-02-17 17:33:17 +05:30
Manish Goregaokar
2aa31827ed Rollup merge of #22296 - steveklabnik:gh21577, r=Gankro
Fixes #21577.
2015-02-17 17:33:17 +05:30
Manish Goregaokar
edac2a07c5 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.
2015-02-17 17:33:16 +05:30
Markus Siemens
bad3bcbfc0 Fix a small typo in libstd/fs.rs 2015-02-17 11:22:27 +01:00
Sébastien Marie
9eeaa3c786 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.
2015-02-17 11:11:53 +01:00
Manish Goregaokar
ab51363da5 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.
2015-02-17 15:41:30 +05:30
Manish Goregaokar
e4e4afa92d 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".
2015-02-17 15:41:30 +05:30
Manish Goregaokar
2d94c4482d 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.
2015-02-17 15:41:30 +05:30
Manish Goregaokar
522091e55d Rollup merge of #21990 - steveklabnik:doc_core_cmp, r=huonw
Fix up, add examples, make them all the same.
2015-02-17 15:41:30 +05:30