Commit Graph

42196 Commits

Author SHA1 Message Date
Manish Goregaokar
655042052c Rollup merge of #25194 - tshepang:assert-convention, r=steveklabnik
… compared
2015-05-09 00:37:43 +05:30
Manish Goregaokar
638deb3bc3 Rollup merge of #25190 - nham:E0046_E0054, r=alexcrichton
cc #24407
2015-05-09 00:37:43 +05:30
Manish Goregaokar
b02270963c Rollup merge of #25181 - steveklabnik:fix_curlies, r=alexcrichton 2015-05-09 00:37:43 +05:30
Manish Goregaokar
61c1cf7f74 Rollup merge of #25179 - bengesoff:patch-1, r=steveklabnik
Following paragraph says "we've used `*` which..." but code says "rand=\"0.3.0\""
2015-05-09 00:37:42 +05:30
Manish Goregaokar
4c0f7fd6fc Rollup merge of #25140 - kevinmehall:mips, r=steveklabnik
Building with `--target=mipsel-unknown-linux-gnu` currently results in the following errors, fixed by this PR:

```
rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/mipsel-unknown-linux-gnu/lib/libstd
/vol/rust/src/libstd/os/linux/raw.rs:76:21: 76:28 error: use of undeclared type name `c_ulong`
/vol/rust/src/libstd/os/linux/raw.rs:76         pub st_dev: c_ulong,
                                                            ^~~~~~~
/vol/rust/src/libstd/os/linux/raw.rs:83:22: 83:29 error: use of undeclared type name `c_ulong`
/vol/rust/src/libstd/os/linux/raw.rs:83         pub st_rdev: c_ulong,
                                                             ^~~~~~~
/vol/rust/src/libstd/sys/common/net2.rs:210:52: 210:70 error: unresolved name `libc::TCP_KEEPIDLE`
/vol/rust/src/libstd/sys/common/net2.rs:210         setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
```
2015-05-09 00:37:42 +05:30
Manish Goregaokar
8b8cb34747 Rollup merge of #24864 - astraw:patch-1, r=steveklabnik
If you have 0 references (`&T`) to a resource, presumably, you could have a mutable reference (`&mut T`). So this only start to make sense at having 1 reference to a resource.
2015-05-09 00:37:42 +05:30
Andrew Straw
391d14802e fix logic when describing kinds of borrows
If you have 0 references (`&T`) to a resource, presumably, you could
have a mutable reference (`&mut T`). So this only start to make sense
at having 1 reference to a resource.
2015-05-08 06:12:59 +02:00
bors
cf76e63745 Auto merge of #25136 - alexcrichton:drop-the-two, r=aturon
* Remove the 2-suffix from some modules
* Remove some unused files
* Remove double-boxing for `ReentrantMutex`
2015-05-08 01:32:59 +00:00
bors
b402c43f08 Auto merge of #25123 - arielb1:self-inhibiting-error, r=nikomatsakis
Fix #25076.

r? @nikomatsakis
2015-05-07 23:40:55 +00:00
Tshepang Lekhonkhobe
7ef46e0dde doc: the prevailing convention is to use assert_eq! when 2 values are compared 2015-05-08 00:14:00 +02:00
bors
5ae026e892 Auto merge of #25157 - alexcrichton:remove-vec-add, r=aturon
Ideally this trait implementation would be unstable, requiring crates to opt-in
if they would like the functionality, but that's not currently how stability
works so the implementation needs to be removed entirely.

This may come back at a future date, but for now the conservative option is to
remove it.

[breaking-change]
2015-05-07 21:45:11 +00:00
Nick Hamann
11a7bad97b Add long diagnostic for E0054 2015-05-07 14:34:54 -05:00
Nick Hamann
11cb5e50ab Add long diagnostic for E0046 2015-05-07 13:08:59 -05:00
bors
f0ac7e04e6 Auto merge of #24973 - roryokane:fix-minus-doc-buttons, r=alexcrichton
My change in #24797 had a bug, described in that issue’s comments, and first discovered in issue #24918. This fixes it.

I tested this new `main.js` by changing the `main.js` content of [a rendered docs page](https://doc.rust-lang.org/std/option/) to this new content. The ‘[−]’ button worked again.

I am also including another related fix, because it would require manual merging if I made a separate pull request for it. The page-global ‘[−]’ button currently adds `#` to the end of the URL whenever it is clicked. I am changing its `href` from `#` to `javascript:void(0)` (the same as the `href` for section-specific ‘[−]’ links) to fix that.
2015-05-07 17:19:33 +00:00
Alex Crichton
7529bd60c3 std: Remove a double-box in ReentrantMutex
Perform unsafe initialization up front and then only afterward the mutex is in
place do we initialize it.
2015-05-07 09:30:00 -07:00
Alex Crichton
a031325e83 std: Remove unused helper_thread.rs file
This module has been removed for quite some time!
2015-05-07 09:30:00 -07:00
Alex Crichton
377b1adc36 std: Rename sys::foo2 modules to sys::foo
Now that `std::old_io` has been removed for quite some time the naming real
estate here has opened up to allow these modules to move back to their proper
names.
2015-05-07 09:30:00 -07:00
bors
a39d4fc684 Auto merge of #25013 - pnkfelix:span_to_lines-oflo, r=huonw
Guard against overflow in `codemap::span_to_lines`.

(Revised/expanded version of PR #24976)

Make `span_to_lines` to return a `Result`.

In `diagnostic`, catch `Err` from `span_to_lines` and print `"(unprintable span)"` instead.

----

There a number of recent issues that report the bug here.  See e.g. #24761 and #24954.

This change *might* fix them. However, that is *not* its main goal. The main goals are:

 1. Make it possible for callers to recover from an error here, and

 2. Insert a more conservative check, in that we are also checking that the files match up.

----

As a drive-by, fix #24997 , which was causing my attempts to `make check-stage1` on an `--enable-debug` build to fail.
2015-05-07 15:25:09 +00:00
Ben Gesoff
888086d959 Undid changes involving misunderstanding of 0.3.x
Didn't realise 0.3.0 referred to all 0.3.x versions! Fixed my mistakes. Should have just updated the Cargo.toml now.
2015-05-07 15:36:47 +01:00
Steve Klabnik
07499918b3 Fix incorrect curly quotes 2015-05-07 10:26:00 -04:00
Ben Gesoff
0bc6fe5ea0 Refactor to keep rand version 0.3.0
changed paragraphs with discussion of Cargo.lock file to agree with rand version 0.3.0 in the Cargo.tom file.
2015-05-07 14:48:44 +01:00
bors
05d5fcaa5b Auto merge of #25161 - jooert:moretests, r=alexcrichton
The last one (at least for the moment 😃).

r? @alexcrichton
2015-05-07 13:33:33 +00:00
Ben Gesoff
7150d3cd9e Change rand version to '*'
Following paragraph says "we've used `*` which..." but code says "rand=\"0.3.0\""
2015-05-07 14:23:05 +01:00
Ariel Ben-Yehuda
ea3747902c fix test 2015-05-07 16:19:43 +03:00
bors
acb3aa0949 Auto merge of #25175 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #24576, #24966, #25052, #25131, #25137, #25138, #25139, #25141, #25142, #25144, #25146, #25148, #25154, #25156, #25160, #25173
- Failed merges:
2015-05-07 10:21:19 +00:00
Steve Klabnik
5ac5203e6e Rollup merge of #25173 - andreastt:guessing_game_syntax_fix, r=steveklabnik 2015-05-07 12:21:05 +02:00
Steve Klabnik
0084ba934d Rollup merge of #25160 - michaelwu:remove-schedule_free_slice, r=cmr
Nothing uses it anymore.
2015-05-07 12:21:05 +02:00
Steve Klabnik
464077d0a7 Rollup merge of #25156 - rydotyosh:patch-4, r=alexcrichton
Remove printing of secret number at final source.
2015-05-07 12:21:04 +02:00
Steve Klabnik
6db57a2dcb Rollup merge of #25154 - rydotyosh:patch-3, r=steveklabnik
Edit version of #25150.
This commit depends on #25148.
2015-05-07 12:21:04 +02:00
Steve Klabnik
414e37f3d4 Rollup merge of #25148 - banks:master, r=steveklabnik
Let me know if I didn't follow correct procedure - seems a trivial change and no one that can be automatically tested.
2015-05-07 12:21:04 +02:00
Steve Klabnik
48b67f04bf Rollup merge of #25146 - piatra:doc-search-patch, r=steveklabnik
I noticed this feature added in https://github.com/rust-lang/rust/pull/23289 was missing from the `Search tricks`. Thanks!

r? @steveklabnik
2015-05-07 12:21:04 +02:00
Steve Klabnik
0d347e1620 Rollup merge of #25144 - killercup:docs/iter-fold-reduce, r=steveklabnik
Enhance Google-ability of `.fold()` by mentioning 'reduce' and 'inject' in the docs.

Motivation: [This thread on users.rust-lang.org](https://users.rust-lang.org/t/find-the-shortest-string-in-a-vector/1247)
2015-05-07 12:21:03 +02:00
Steve Klabnik
1d3183929a Rollup merge of #25142 - rydotyosh:patch-1, r=alexcrichton 2015-05-07 12:21:03 +02:00
Steve Klabnik
0ad94ae126 Rollup merge of #25141 - steveklabnik:fix_guessing_game, r=huonw
https://github.com/rust-lang/rust/pull/25080/files#r29634986

r? @huonw
2015-05-07 12:21:03 +02:00
Steve Klabnik
888c12ccbb Rollup merge of #25139 - hibariya:fix-indentation, r=alexcrichton 2015-05-07 12:21:03 +02:00
Steve Klabnik
b7ce230329 Rollup merge of #25138 - tshepang:typos, r=sanxiyn 2015-05-07 12:21:02 +02:00
Steve Klabnik
42212bb44a Rollup merge of #25137 - carols10cents:fix-token-declaration, r=alexcrichton
I know this is the most trivial thing since it's *just* the model lexer, not the real lexer, but [it is simpler to read](https://github.com/rust-lang/rust/issues/15883#issuecomment-72906431) and it'd be great if it was up to date but [it's been rotting](https://github.com/rust-lang/rust/issues/22379) and this is a tiny bit of that.

Thanks!!!!!!
2015-05-07 12:21:02 +02:00
Steve Klabnik
6b56f790db Rollup merge of #25131 - janne:patch-1, r=alexcrichton 2015-05-07 12:21:02 +02:00
Steve Klabnik
76bbb3237c Rollup merge of #25052 - jooert:misc_attr_reference, r=steveklabnik
Unsafe destructors were removed, added remarks about needed feature gates.

cc #16676 
r? @steveklabnik
2015-05-07 12:21:02 +02:00
Steve Klabnik
74d24ad6af Rollup merge of #24966 - ruud-v-a:explain, r=pnkfelix
The error message was misleading, so I adjusted it, and I also added the long diagnostics for this error (resolves one point in #24407).

I was unsure about how to phrase the error message. Is “generic parameter binding” the correct term for this?
2015-05-07 12:21:01 +02:00
Steve Klabnik
52174305a0 Rollup merge of #24576 - cactorium:errorcodes, r=pnkfelix
For https://github.com/rust-lang/rust/issues/24407
2015-05-07 12:21:01 +02:00
Andreas Tolfsen
9f84260138 doc: fix syntax error in Guessing Game 2015-05-07 11:59:33 +02:00
Rory O’Kane
61bb091f06 Remove trailing whitespace on blank line
This style inconsistency was noted at https://travis-ci.org/rust-lang/rust/builds/61583070#L371
2015-05-07 04:17:10 -04:00
Rory O’Kane
92565b3dfb Refactor doc toggle button label changing
To separate concerns, instead of checking the state of `#toggle-all-docs` by looking at its label text, I add or remove a class `will-expand` depending on whether the button’s next click will expand everything. (The `if` statement’s two branches were swapped as part of this change.)

I moved the desired text values to a function `labelForToggleButton`, so changing the values will be easier. I also note in a comment the other file where the text is duplicated.

To allow the labels of both types of toggle buttons to be uniformly set, I added a `span.inner` to the global button too.

I split the template in `render.rs` into multiple lines to make room for the `span`, and that adds whitespace around the `[` and `]` text elements. That seems to be okay, though – the page still looks the same.

I updated the CSS styling for `.collapse-toggle > .inner` to add a little extra space around the symbol, to make minus signs easier to identify. (`#toggle-all-docs > .inner` does not need the same style, since its text size is bigger, so it naturally puts more space around the symbol.)
2015-05-07 04:11:14 -04:00
bors
95607544b6 Auto merge of #25125 - Stebalien:from_raw_os, r=alexcrichton
So, I realize this is really late in the game so it's unlikely to be accepted but `FromRawFd`/`FromRawHandle` are necessary for fine grain control over file creation. For example, the current `OpenOptions` does not provide a way to avoid file creation races (there's no way to specify `O_EXCL` or the windows equivalent). Stabilizing these traits and their implementations will give 1.0 users fine-grain control over file creation without committing to any new complex APIs.  Additionally, `AsRawFd`/`AsRawHandle` are already stable so I feel that that stabilizing their inverses is a reasonably small change.

Disclaimer: I'm asking because my crate, tempfile, depends on this feature.
2015-05-07 06:51:05 +00:00
bors
055d926693 Auto merge of #25093 - Ms2ger:mac-consts, r=alexcrichton
These constants were added in 6f54ce9aa5 and
e8fbd1ce04 to a consts module that is behind a
gate.

I have not confirmed that these constants do indeed work on either OSX or iOS.
2015-05-07 04:07:23 +00:00
bors
347ee73ef7 Auto merge of #24964 - tamird:cleanup-bitflags, r=alexcrichton
Depends on #24921. r? @alexcrichton
2015-05-07 02:14:30 +00:00
bors
e8b4c84e39 Auto merge of #24890 - jooert:bitvec-append-split_off, r=alexcrichton
cc #19986 

r? @Gankro
2015-05-07 00:20:25 +00:00
bors
8767e97d7e Auto merge of #24392 - seanmonstar:lint-transmute-mut, r=alexcrichton
The [UnsafeCell documentation says it is undefined behavior](http://doc.rust-lang.org/nightly/std/cell/struct.UnsafeCell.html), so people shouldn't do it.

This happened to catch one case in libstd that was doing this, and I switched that to use an UnsafeCell internally.

Closes #13146
2015-05-06 22:27:58 +00:00
Johannes Oertel
1a8ccd72d6 Add regression test for #20626
Closes #20626.
2015-05-07 00:25:54 +02:00