Commit Graph

39596 Commits

Author SHA1 Message Date
Manish Goregaokar
f7c1fce144 Rollup merge of #23153 - Manishearth:snap, r=alexcrichton
Needed so that #21824 can land
2015-03-09 00:04:20 +05:30
Manish Goregaokar
0e0bb8a128 Rollup merge of #23179 - steveklabnik:mini_rollup, r=steveklabnik
I had to fix up some PRs:

* https://github.com/rust-lang/rust/pull/22976
* https://github.com/rust-lang/rust/pull/22945
* https://github.com/rust-lang/rust/pull/22845
2015-03-09 00:02:37 +05:30
Manish Goregaokar
509c6fc9c1 Rollup merge of #22984 - carols10cents:tests-for-float, r=huonw
Building on #22076, I've added some tests for stable methods in f32 and f64 that didn't have any before.

Please let me know if there are any improvements I can make, and I am happy to make them! 📬
2015-03-09 00:02:28 +05:30
Amol Mundayoor
45c397d738 Fix array syntax in comment.
Fixes #22721.
2015-03-08 08:39:47 -04:00
Łukasz Niemier
3ad1c83540 Add description of fold function arguments. 2015-03-08 08:38:27 -04:00
Pyry Kontio
6dcc0e5631 Adds an example for PhantomData<T>. 2015-03-08 08:38:10 -04:00
bors
ead9ab84b8 Auto merge of #23167 - rprichard:fix-plugin-rustbook, r=steveklabnik
* "let mut text" was previously of &String type.  Now it is of &str type.

 * Update the slicing syntax.  Both &text[] and text.slice_from() evaluate
   to a &str.

 * We were passing a u32 to expr_usize.  Call expr_u32 instead.

r? @steveklabnik
Fixes #23166
2015-03-08 12:10:42 +00:00
bors
b2f09c1165 Auto merge of #23127 - alexcrichton:bench-wrapping, r=brson
Right now the rust upgrade in cargo is blocked on fixing this overflow. If a
this benchmark is run it will trigger an overflow error today:

    #[bench]
    fn foo(b: &mut test::Bencher) {}

This commit adds a check on each iteration of the loop that the maximum
multiplier (10) doesn't overflow, and if it does just return the results so far.
2015-03-08 08:34:56 +00:00
Ryan Prichard
52124d7c80 Fix #23166. Get the Compiler Plugins example compiling again.
* "let met text" was previously of &String type.  Now it is of &str type.

 * Update the slicing syntax.  Both &text[] and text.slice_from() evaluate
   to a &str.

 * We were passing a u32 to expr_usize.  Call expr_u32 instead.
2015-03-07 22:58:28 -08:00
bors
d30609ffd7 Auto merge of #23160 - rprichard:fix-numtest-assert, r=brson
The previous code was passing "true" as the panic! error value.
2015-03-08 05:20:17 +00:00
bors
97ca2a1ee9 Auto merge of #23145 - semarie:openbsd-5806, r=alexcrichton
follow freebsd due to last deprecation of `std::old_io::fs`
2015-03-08 01:43:22 +00:00
Ryan Prichard
4a0c7ebc87 Use assert_eq! rather than assert!
The previous code was passing "true" as the panic! error value.
2015-03-07 16:53:01 -08:00
bors
2fc8b1e7c4 Auto merge of #23143 - 5paceToast:cygwin-6.3, r=alexcrichton
Not checking for 32/64 bit, since `uname -s` no longer contains an indicator (and `uname -m` returns correct results)
2015-03-07 21:52:20 +00:00
Manish Goregaokar
f81f8d81d3 Register new snapshots (270a677) 2015-03-08 00:36:56 +05:30
bors
668c647408 Auto merge of #23137 - kmcallister:derive-sugar, r=sfackler
This is a hack, but I don't think we can do much better as long as `derive` is running at the syntax expansion phase.

If the `custom_derive` feature gate is enabled, this works with user-defined traits and syntax extensions. Without the gate, you can't use e.g. `#[derive_Clone]` directly, so this does not change the stable language.

To make this effective, we now check gated attributes both before and after macro expansion. This uncovered a number of tests that were missing feature gates.

This PR also cleans up the deriving code somewhat, and forbids some previously-meaningless attribute syntax. For this reason it's technically a

    [breaking-change]

r? @sfackler
2015-03-07 18:39:17 +00:00
bors
b8c6eb179e Auto merge of #23146 - lifthrasiir:oh-noes-i-broke-rustdoc-sidebars-what-to-do-now, r=Manishearth
We require the *deferred* loading, not just an opportunistic asynchronous loading. (Yes, that was my oversight, as I only checked it locally...) I think `<script defer>` is safe to use, according to <http://caniuse.com/#feat=script-defer>.
2015-03-07 14:08:29 +00:00
Kang Seonghoon
a3e4a1617b rustdoc: Fixed an asynchronous loading of rustdoc sidebars.
We require the *deferred* loading, not just an opportunistic
asynchronous loading. I think `<script defer>` is safe to use,
according to <http://caniuse.com/#feat=script-defer>.
2015-03-07 23:01:31 +09:00
Sébastien Marie
17d5acc4a0 disable test for issue-5806 on openbsd
follow freebsd due to last deprecation of std::old_io::fs
2015-03-07 13:40:35 +01:00
bors
36cd65f786 Auto merge of #22549 - steveklabnik:doc_documentation, r=huonw
This chapter covers writing documentation in depth.

Fixes #4361
Fixes #12862
Fixes #14070
Fixes #14967
2015-03-07 10:01:13 +00:00
Chloe
9f28f7249f added support for CYGWIN 6.3 into configure script
Not checking for 32/64 bit, since `uname -s` no longer contains an indicator (and `uname -m` returns correct results)
2015-03-07 03:44:02 -05:00
bors
098daa1d7f Auto merge of #23132 - alexcrichton:remove-deprecated-unicode-escapes, r=huonw
These have been deprecated for quite some time, so we should be good to remove
them now.
2015-03-07 06:48:45 +00:00
bors
270a677d4d Auto merge of #23107 - Manishearth:rollup, r=alexcrichton 2015-03-07 03:28:03 +00:00
Alex Crichton
aed31ee08e Test fixes and rebase conflicts 2015-03-06 19:27:36 -08:00
Keegan McAllister
491054f08e Make #[derive(Anything)] into sugar for #[derive_Anything]
This is a hack, but I don't think we can do much better as long as `derive` is
running at the syntax expansion phase.

If the custom_derive feature gate is enabled, this works with user-defined
traits and syntax extensions. Without the gate, you can't use e.g. #[derive_Clone]
directly, so this does not change the stable language.

This commit also cleans up the deriving code somewhat, and forbids some
previously-meaningless attribute syntax. For this reason it's technically a

    [breaking-change]
2015-03-06 18:20:16 -08:00
Keegan McAllister
e60e6f0693 Check gated attributes before and after macro expansion
This is important because attributes can affect expansion.
2015-03-06 17:15:19 -08:00
Alex Crichton
11ddfb8af0 rollup merge of #23124: brson/oldtests 2015-03-06 15:38:09 -08:00
Alex Crichton
bc409cbb4c rollup merge of #23117: japaric/default-impl
fixes #23080

r? @nikomatsakis
cc @FlaPer87
2015-03-06 15:38:06 -08:00
Alex Crichton
3c2c516d0c rollup merge of #23097: alexcrichton/issue-23076
The `rsplitn` call was called with 2 instead of 1 so the iterator would yield 3
items in some cases, not the 2 that it should have.

Closes #23076
2015-03-06 15:37:56 -08:00
Alex Crichton
31af63748b rollup merge of #23091: japaric/phantom
r? @nikomatsakis See the cfail test, it compiles without this patch
cc #13231
2015-03-06 15:37:51 -08:00
Alex Crichton
697de42f69 rollup merge of #23087: nagisa/std-undeadlock
Being a person who somehow has taken a liking to premature optimisation, my knee-jerk reaction to
locking in std handles was preamble resembling following snippet:

    let stdout = stdout();
    let lstdout = stdout.lock();
    let stdin = stdin();
    let lstdin = stdin.lock();

and then reading from the locked handle like this:

    let mut letter = [0; 1];
    lstdin.read(&mut letter).unwrap();

As it is now this code will deadlock because the `read` method attempts to lock stdout as well!

r? @alexcrichton

---

Either way, I find flushing stdout when stdin is used debatable. I believe people who write prompts should take care to flush stdout when necessary themselves.

Another idea: Would be cool if locks on std handles would be taken for a thread, rather than a handle, so given preamble (first code snippet)

    stdin.lock()

or more generally

    stdin.read(…)

worked fine. I.e. if more than a single lock are all taken inside the same thread, it would work, though not sure if our synchronisation primitives are expressive enough to make it possible.
2015-03-06 15:37:47 -08:00
Alex Crichton
2bd02ca837 rollup merge of #22975: alexcrichton/stabilize-ffi
Conflicts:
	src/librustc_trans/back/link.rs
	src/librustc_trans/lib.rs
2015-03-06 15:37:14 -08:00
Alex Crichton
fd86a01bb9 rollup merge of #22813: alexcrichton/deprecate-net
The `std::net` primitives should be ready for use now and as a result the old
ones are now deprecated and slated for removal. Most TCP/UDP functionality is
now available through `std::net` but the `std::old_io::net::pipe` module is
removed entirely from the standard library.

Unix socket funtionality can be found in sfackler's [`unix_socket`][unix] crate
and there is currently no replacement for named pipes on Windows.

[unix]: https://crates.io/crates/unix_socket

[breaking-change]
2015-03-06 15:36:08 -08:00
Alex Crichton
1a30412ebf Suppress some warnings about features 2015-03-06 15:11:59 -08:00
Keegan McAllister
63ee3fe566 Consolidate ExpansionConfig feature tests 2015-03-06 14:12:28 -08:00
Alex Crichton
39e2c69541 syntax: Remove deprecated unicode escapes
These have been deprecated for quite some time, so we should be good to remove
them now.
2015-03-06 14:11:09 -08:00
Alex Crichton
16ff1401d8 std: Ignore a test on windows
This test is known to fail on windows.
2015-03-06 13:55:06 -08:00
Alex Crichton
946a3963f3 test: Fix an overflow on empty benchmarks
Right now the rust upgrade in cargo is blocked on fixing this overflow. If a
this benchmark is run it will trigger an overflow error today:

    #[bench]
    fn foo(b: &mut test::Bencher) {}

This commit adds a check on each iteration of the loop that the maximum
multiplier (10) doesn't overflow, and if it does just return the results so far.
2015-03-06 12:01:23 -08:00
bors
4d716decb5 Auto merge of #22474 - iKevinY:pandoc-version-check, r=brson
Executing `configure` seems to create the following error due to how the script [parses Pandoc's version](https://github.com/rust-lang/rust/blob/master/configure#L705):

```text
./configure: line 705: [: pandoc: integer expression expected
./configure: line 705: [: 1.12.4.2: integer expression expected
```

This issue seems to stem from a discrepancy between BSD and GNU versions of sed. This patch changes the sed command to use an extended regex, which works with both flavours of sed.
2015-03-06 19:04:53 +00:00
Alex Crichton
9aea749b83 std: Deprecate the std::old_io::net primitives
The `std::net` primitives should be ready for use now and as a result the old
ones are now deprecated and slated for removal. Most TCP/UDP functionality is
now available through `std::net` but the `std::old_io::net::pipe` module is
removed entirely from the standard library.

Unix socket funtionality can be found in sfackler's [`unix_socket`][unix] crate
and there is currently no replacement for named pipes on Windows.

[unix]: https://crates.io/crates/unix_socket

[breaking-change]
2015-03-06 10:27:28 -08:00
Brian Anderson
f7594e14b8 Remove two green threading tests 2015-03-06 10:10:47 -08:00
Jorge Aparicio
8a391dd8cf move check into wf pass, add a test for assoc types 2015-03-06 12:37:28 -05:00
Manish Goregaokar
7ed4660a51 Rollup merge of #22474 - iKevinY:pandoc-version-check, r=brson
Executing `configure` seems to create the following error due to how the script [parses Pandoc's version](https://github.com/rust-lang/rust/blob/master/configure#L705):

```text
./configure: line 705: [: pandoc: integer expression expected
./configure: line 705: [: 1.12.4.2: integer expression expected
```

This issue seems to stem from a discrepancy between BSD and GNU versions of sed. This patch changes the sed command to use an extended regex, which works with both flavours of sed.
2015-03-06 22:22:40 +05:30
Manish Goregaokar
61c6b199bc BufferedWriter -> BufWriter (fixup #23060) 2015-03-06 22:22:39 +05:30
Manish Goregaokar
aaaa4310cc Rollup merge of #23100 - wesleywiser:fix_23059, r=brson
Fixes #23059
2015-03-06 22:22:38 +05:30
Manish Goregaokar
ae16afb9e3 Rollup merge of #23096 - posborne:paths-documentation-grammar-fix, r=huonw 2015-03-06 22:22:37 +05:30
Manish Goregaokar
88cef035b0 Rollup merge of #23094 - brson:beta, r=huonw
No more alphas, please.
2015-03-06 22:22:35 +05:30
Manish Goregaokar
a14d6a9052 Rollup merge of #23082 - killercup:patch-6, r=alexcrichton
This should fix #22615. Previously, the playpen links grabbed the content of all `.rusttest` containers on the same level to build the URL. Now they just select the one before the `pre` they are shown in.

I have only tested this by changing the file in my local build of the docs (not by running rustdoc itself).
2015-03-06 22:22:35 +05:30
Manish Goregaokar
babd41e5e7 Rollup merge of #23067 - oli-obk:doc_examle_fix, r=alexcrichton
The compiler even tells us this won't work.
```
let mut i = s.len();
while i < 0 { ... }
```
2015-03-06 22:22:34 +05:30
Manish Goregaokar
2fcdd824ef Rollup merge of #23056 - awlnx:master, r=nrc 2015-03-06 22:22:33 +05:30
Manish Goregaokar
ce2d04a77a Rollup merge of #23048 - davbo:fix-broken-link-in-old-guide, r=brson
Having come back to rust recently after > 6months I was looking for docs
on tasks and stumbled upon this broken link.
2015-03-06 22:22:32 +05:30