Commit Graph

60965 Commits

Author SHA1 Message Date
king6cong
380ba6dbad go back to use // 2017-02-06 10:12:30 +08:00
king6cong
5c9fdd1d66 doc comment rewording 2017-02-03 15:24:16 +08:00
bors
5de2a24b2e Auto merge of #39287 - wesleywiser:move_cell, r=aturon
Extend Cell to work with non-Copy types

I'm not sure that I did this right but all of the tests pass.

I also had to move the `new()` function so that `Cell`s with non-`Copy` `T`s could be created. That wasn't in the RFC but I assume it needed to be done?
2017-02-03 03:23:35 +00:00
bors
7f294e4c18 Auto merge of #39466 - alexcrichton:fix, r=Manishearth
std: Fix IntoIter::as_mut_slice's signature

This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes #39465
2017-02-03 00:47:58 +00:00
bors
eedaa94e33 Auto merge of #39470 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 9 pull requests

- Successful merges: #38823, #39196, #39299, #39319, #39373, #39383, #39416, #39420, #39427
- Failed merges:
2017-02-02 21:58:10 +00:00
Guillaume Gomez
d09e4de640 Rollup merge of #39427 - steveklabnik:pliniker-mailmap, r=alexcrichton
update mailmap for @pliniker
2017-02-02 22:22:33 +01:00
Guillaume Gomez
a561ad831d Rollup merge of #39420 - oli-obk:sugg, r=pnkfelix
parser: use suggestions instead of helps with code in them
2017-02-02 22:22:29 +01:00
Guillaume Gomez
9559c4d823 Rollup merge of #39416 - tspiteri:ffi-unsafe-icon, r=brson
rustdoc: mark FFI functions with unsafety icon

Currently, in the list of functions, unsafe functions are marked with a superscript ⚠, but unsafe FFI functions are not. This patch treats unsafe FFI functions like other unsafe functions in this regard.
2017-02-02 22:22:28 +01:00
Guillaume Gomez
7bc322281d Rollup merge of #39383 - nagisa:mir-uninhabited-destinations, r=pnkfelix
Remove the workaround for gh32959

This workaround is no longer necessary as Rust, and by extension MIR, now support uninhabited type
properly. This removes the workaround for the gh32959 that was introduced in gh33267.

Fixes #32959
2017-02-02 22:22:26 +01:00
Guillaume Gomez
a768827c24 Rollup merge of #39373 - Mark-Simulacrum:remove-toprimitive, r=aturon
Remove ToPrimitive trait.

It is no longer used.
2017-02-02 22:22:24 +01:00
Guillaume Gomez
bcfa2f1cce Rollup merge of #39319 - nagisa:remove-rustsetpersonalityfn, r=pnkfelix
Remove unnecessary LLVMRustPersonalityFn binding

LLVM Core C bindings provide this function for all the versions back to what we support (3.7), and
helps to avoid this unnecessary builder->function transition every time. Also a negative diff.

Fixes #38462 (although it was pretty much fixed already)
2017-02-02 22:22:23 +01:00
Guillaume Gomez
b03436d2e3 Rollup merge of #39299 - federicomenaquintero:master, r=GuillaumeGomez
In std:rc, clarify the lack of mutability inside an Rc

Also, point to the example in Cell's docs for how to do it.
2017-02-02 22:22:22 +01:00
Guillaume Gomez
38ae9233b5 Rollup merge of #39196 - apasel422:nomicon, r=petrochenkov
Update nomicon to describe `#[may_dangle]`

CC #34761
r? @pnkfelix
2017-02-02 22:22:21 +01:00
Guillaume Gomez
5ada328d81 Rollup merge of #38823 - Freyskeyd:doc-missingInformationCfgTest, r=steveklabnik
Improve doc cfg(test) and tests directory

Hi,

I was facing a problem with my code organisation. I was using a tests directory and i defined some `#[cfg(test)]` in my `src/`. But i was not able to use it in my `tests` folder.

```bash
.
├── Cargo.lock
├── Cargo.toml
├── src
│   ├── lib.rs
│   └── test.rs
└── tests
    └── x.rs
```
> src/lib.rs
```rust
pub mod test;

fn tesst() {
    assert!(test::t());
}
```
> src/test.rs
```rust
pub fn t() -> bool { true }
```
> test/x.rs
```rust
extern crate testt;

use testt::test;
fn tesst() {
    assert!(test::t());
}
```

I was unable to compile using `cargo test`:
```bash
error[E0432]: unresolved import `testt::test`
 --> tests/x.rs:3:5
  |
3 | use testt::test;
  |     ^^^^^^^^^^^ no `test` in `testt`
```

If i remove the `tests` directory everything works fine. To use an utils module in your `tests` directory, you need to create a module in the directory (like `tests/utils.rs`). My `tests/x.rs` look like this now:

```rust
extern crate testt;

mod utils;

fn tesst() {
    assert!(utils::t());
}
```

And my tree:
```bash
.
├── Cargo.lock
├── Cargo.toml
├── src
│   └── lib.rs
└── tests
    ├── utils.rs
    └── x.rs
```

I think that thing must be documented in the book.

Ping:
- @badboy : Because he's the one who showed me the path
- @shahn : Because he helped me too to find the solution

Signed-off-by: Freyskeyd <simon.paitrault@iadvize.com>
2017-02-02 22:22:19 +01:00
Alex Crichton
80f7db63b6 std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes #39465
2017-02-02 11:27:52 -08:00
bors
a47a6ea771 Auto merge of #39411 - tamird:match-arm-statics-ICE, r=alexcrichton
statics in match arm: compile with -g

Resubmission of #29700.

r? @alexcrichton
2017-02-02 18:20:37 +00:00
bors
1a2428fc88 Auto merge of #39402 - king6cong:master, r=nrc
comment rewording and argument unifying
2017-02-02 15:41:19 +00:00
bors
d5f54743db Auto merge of #39386 - tbu-:pr_pipe_less_syscalls, r=alexcrichton
Use less syscalls in `anon_pipe()`

Save a `ENOSYS` failure from `pipe2` and don't try again.

Use `cvt` instead of `cvt_r` for `pipe2` - `EINTR` is not an error
`pipe2` can return.
2017-02-02 13:04:53 +00:00
bors
3b24c70012 Auto merge of #39384 - wesleywiser:fix_fixmes, r=alexcrichton
Resolve a bunch of fixmes

Resolves 56 fixmes in test code related to `box` syntax.
2017-02-02 10:40:13 +00:00
bors
6abe64871e Auto merge of #39116 - mgattozzi:better-string-message, r=nrc
Add clearer error message using `&str + &str`

This is the first part of #39018. One of the common things for new users
coming from more dynamic languages like JavaScript, Python or Ruby is to
use `+` to concatenate strings. However, this doesn't work that way in
Rust unless the first type is a `String`. This commit adds a check for
this use case and outputs a new error as well as a suggestion to guide
the user towards the desired behavior. It also adds a new test case to
test the output of the error.
2017-02-02 07:39:07 +00:00
bors
1b6b20ac17 Auto merge of #38932 - petrochenkov:privctor, r=jseyfried
Privatize constructors of tuple structs with private fields

This PR implements the strictest version of such "privatization" - it just sets visibilities for struct constructors, this affects everything including imports.
```
visibility(struct_ctor) = min(visibility(struct), visibility(field_1), ..., visibility(field_N))
```
Needs crater run before proceeding.

Resolves https://github.com/rust-lang/rfcs/issues/902

r? @nikomatsakis
2017-02-02 05:10:40 +00:00
Wesley Wiser
8b947a37c8 Update Cell references in the book 2017-02-01 22:53:39 -05:00
Wesley Wiser
daa509109f Update cell docs 2017-02-01 22:51:52 -05:00
bors
2a6f7e41fc Auto merge of #38661 - frewsxcv:vec-deque-partial-eq, r=aturon
Implement `PartialEq<[A]>` for `VecDeque<A>`.

Fixes https://github.com/rust-lang/rust/issues/38625.
2017-02-02 02:42:07 +00:00
Wesley Wiser
94687aaf58 Removes FIXMEs related to #22405 2017-01-31 21:27:13 -05:00
Federico Mena Quintero
4a07e722c0 In std:rc, clarify the lack of mutability inside an Rc
Also, point to the example in Cell's docs for how to do it.
2017-01-31 18:02:41 -06:00
Steve Klabnik
4b52600b15 update mailmap for @pliniker 2017-01-31 13:19:03 -05:00
Oliver Schneider
d73e84d2e7 use suggestions instead of helps with code in them 2017-01-31 14:45:08 +01:00
bors
24055d0f2a Auto merge of #39379 - segevfiner:fix-backtraces-on-i686-pc-windows-gnu, r=alexcrichton
Fix backtraces on i686-pc-windows-gnu by disabling FPO

This might have performance implications. But do note that MSVC
disables FPO by default nowadays and it's use is limited in exception
heavy languages like C++.

See discussion in: #39234
Closes: #28218
2017-01-31 11:18:22 +00:00
bors
cd692cc7ec Auto merge of #39354 - alexcrichton:less-output, r=steveklabnik
rustdoc: Suppress warnings/errors with --test

Threads spawned by the test framework have their output captured by default, so
for `rustdoc --test` threads this propagates that capturing to the spawned
thread that we now have.

Closes #39327
2017-01-31 08:44:07 +00:00
bors
0c85f2a1bd Auto merge of #38847 - michaelwoerister:gate-on-incr-comp, r=alexcrichton
travis: Gate on some minimal support for incremental compilation.

This commit adds a travis job that

1. builds a stage2 compiler in incremental mode (but with empty incremental compilation cache), and
2. builds and runs the run-pass test suite also in incremental mode.

Building incrementally with an empty cache makes sure that the compiler doesn't crash in dependency tracking during bootstrapping. Executing the incrementally built test suite gives some measure of confidence that we generate valid code.

Note, however, that the above does not give strong guarantees about the validity of incremental compilation, it just provides a basis for being able to rely on from-scratch incr. comp. builds as reference values in further tests (which then do actual incremental compilation).

r? @alexcrichton
2017-01-31 06:13:05 +00:00
bors
b854d74bb8 Auto merge of #39250 - cseale:issue_30924, r=est31
[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31
2017-01-31 03:28:12 +00:00
Colm Seale
94e9086685 [Gate Tests] - marking feature tests
Removal of the lang feature gate tests whitelist #39059

r? @est31
2017-01-31 00:24:06 +00:00
bors
8e9e055276 Auto merge of #39230 - petrochenkov:nobox, r=eddyb
Refactoring TyBox -> TyAdt

r? @eddyb
cc @Manishearth
2017-01-31 00:02:15 +00:00
Trevor Spiteri
fe324cea64 rustdoc: mark ffi functions with unsafety icon 2017-01-31 00:57:52 +01:00
Michael Woerister
d292e1229f compiletest: Clear RUSTFLAGS env-var for run-make tests. 2017-01-30 15:38:11 -05:00
Vadim Petrochenkov
93e3f634b0 Fix debuginfo scope issue with Box 2017-01-30 23:18:29 +03:00
Vadim Petrochenkov
a5d725cc82 cleanup: Refactor away DtorKind 2017-01-30 23:18:22 +03:00
Vadim Petrochenkov
4a4f8ff0a3 Implement Drop for Box 2017-01-30 23:14:15 +03:00
Vadim Petrochenkov
ffba0cea62 Merge ty::TyBox into ty::TyAdt 2017-01-30 23:14:15 +03:00
Tamir Duberstein
83fe5325d2
statics in match arm: compile with -g
Closes #24956.
2017-01-30 14:52:59 -05:00
bors
8921707653 Auto merge of #39368 - alexcrichton:fix-upload-dirs, r=aturon
travis: Tweak artifact uploads

* Don't upload `*.wixpdb` files by accident
* Don't upload `doc` dir by accident
* Fix level of indirection on Travis
2017-01-30 19:43:08 +00:00
Tamir Duberstein
bcca5e6454
trans::debuginfo: simplify 2017-01-30 13:47:05 -05:00
Alex Crichton
45d203df30 travis: Tweak artifact uploads
* Don't upload `*.wixpdb` files by accident
* Don't upload `doc` dir by accident
* Fix level of indirection on Travis
2017-01-30 08:56:30 -08:00
Tobias Bucher
4b46d2a3a2 Don't handle ENOSYS in anon_pipe()
We're not calling the raw syscall but a libc function, the libc will
have a compatibility layer.
2017-01-30 17:37:49 +01:00
bors
55f9712d14 Auto merge of #39407 - GuillaumeGomez:convert_module, r=frewsxcv
Add missing url in convert module

r? @frewsxcv
2017-01-30 13:16:57 +00:00
bors
c8699376cd Auto merge of #39405 - tshepang:nits, r=sfackler
doc: minor Option improvements
2017-01-30 06:45:13 +00:00
Tshepang Lekhonkhobe
4814fa488e doc: minor Option improvements 2017-01-30 08:39:03 +02:00
bors
15ad83f1d9 Auto merge of #39389 - Wilfred:patch-2, r=apasel422
Minor grammar fix 'can not' -> 'cannot'

The previous version suggested that the compiler chooses not to check, rather than being unable to check.
2017-01-30 02:47:06 +00:00
king6cong
701c32ed4a unify time_passes argument passing 2017-01-30 10:22:26 +08:00