Commit Graph

38505 Commits

Author SHA1 Message Date
Manish Goregaokar
3e7af91851 Rollup merge of #22363 - semarie:openbsd-test_file_desc, r=alexcrichton
`pipe(2)`, under FreeBSD and OpenBSD return a bidirectionnal pipe. So
reading from the writer would block (waiting data) instead of returning
an error.

like for FreeBSD, disable the test for OpenBSD.
2015-02-17 06:23:36 +05:30
Manish Goregaokar
cdf0cb0a16 Rollup merge of #22360 - wg:master, r=alexcrichton 2015-02-17 06:23:36 +05:30
Manish Goregaokar
1c8e592bb7 Rollup merge of #22353 - tshepang:improve-fs-create-docs, r=alexcrichton 2015-02-17 06:23:36 +05:30
Manish Goregaokar
6cab5bba75 Rollup merge of #22341 - fhahn:issue-22291-PLEASE-FAIL, r=alexcrichton
This is a patch for #22291.

PLEASE_BENCH=1 adds --bench to the arguments passed to the executable to be tested. At the moment, compiletest does not accept a --bench argument, because it is not needed for any test in src/test/, even the tests in src/test/bench do not use #[bench].

I have updated the makefile to only add the --bench flag for crate tests. I do not think that changing compiletest add --bench to the run arguments of all compile tests makes sense, because it would mess up tests which check command line arguments. Also the bench option can be added as comment in a compile test as well.
2015-02-17 06:23:36 +05:30
Manish Goregaokar
b0d2c6a714 Rollup merge of #22294 - nikomatsakis:integer-audit, r=huonw
cc https://github.com/rust-lang/rust/issues/22240
2015-02-17 06:23:35 +05:30
Manish Goregaokar
d660739f9a Rollup merge of #22253 - huonw:unstable-words, r=aturon
It is not totally clear if we should just use whitespace, or if the full
unicode word-breaking algorithm is more correct. If there is demand we
can reconsider this decision (and consider the precise algorithm to use
in detail).

cc #15628.
2015-02-17 06:23:35 +05:30
bors
81bce5290f Auto merge of #22230 - nikomatsakis:object-lifetime-defaults-2, r=pnkfelix
Implement rules described in rust-lang/rfcs#599.

Fixes https://github.com/rust-lang/rust/issues/22211.

~~Based atop PR https://github.com/rust-lang/rust/pull/22182, so the first few commits (up to and including "Pacify the mercilous nrc") have already been reviewed.~~
2015-02-16 20:31:15 +00:00
Niko Matsakis
503e15b7c9 Address nits by @pnkfelix 2015-02-16 11:58:47 -05:00
bors
e4e7aa2856 Auto merge of #21744 - eddyb:rvalue-promotion, r=nikomatsakis
This includes everything necessary for promoting borrows of constant rvalues to `'static`.
That is, `&expr` will have the type `&'static T` if `const T: &'static T = &expr;` is valid.
There is a small exception, dereferences of raw pointers, as they misbehave.
They still "work" in constants as I didn't want to break legitimate uses (are there any?).

The qualification done here can be expanded to allow simple CTFE via `const fn`.
2015-02-16 16:38:51 +00:00
Niko Matsakis
d0ef1664ca Clarify and improve comment, removing a TODO. 2015-02-16 10:55:37 -05:00
Niko Matsakis
f58a1bfa98 Fix fallout in libsyntax from RFC 599. Clarity and efficiency seems to be mostly improved, to my eye.
Nonetheless, as this commit demonstrates, the previous commits was a [breaking-change].

In practice, breakage is focused on functions of this form:

```rust
fn foo(..., object: Box<FnMut()>)
````

where `FnMut()` could be any trait object type. The older scheme defaulted objects in argument
position so that they were bounded by a fresh lifetime:

```rust
fn foo<'a>(..., object: Box<FnMut()+'a>)
```

This meant that the object could contain borrowed data. The newer
scheme defaults to a lifetime bound of `'static`:

```rust
fn foo(..., object: Box<FnMut()+'static>)
```

This means that the object cannot contain borrowed data. In some cases, the best fix
is to stop using `Box`:

```rust
fn foo(..., object: &mut FnMut())
```

but another option is to write an explicit annotation for the `'a`
lifetime that used to be implicit.  Both fixes are demonstrated in
this commit.
2015-02-16 10:55:37 -05:00
Niko Matsakis
369adaf515 Implement the rules for RFC 599, and add various tests.
Fixes #22211.
2015-02-16 10:55:37 -05:00
Niko Matsakis
ab579883f2 Factor out the "region substs" creation to occur earlier, so that the
complete set of regions are available when converting types.
2015-02-16 10:55:37 -05:00
Niko Matsakis
80d1f14e7d Implement the basic rules of RFC 599, but do not yet support custom types. 2015-02-16 10:55:37 -05:00
Niko Matsakis
f5c6a23c9e Various simplifications and renamings based on the fact that old-school closures are gone and type parameters can now have multiple region bounds (and hence use a different path). Should have no effect on the external behavior of the compiler. 2015-02-16 10:55:37 -05:00
Niko Matsakis
931a3c4f9d Detect and store object-lifetime-defaults. 2015-02-16 10:55:36 -05:00
Eduard Burtescu
b49f5281c2 tests: debuginfo: use static mut to avoid constant folding globals. 2015-02-16 17:13:48 +02:00
Eduard Burtescu
d13d74d6d8 tests: work around #21721 some more by replacing some unit types with [u8; 0]. 2015-02-16 17:13:48 +02:00
Eduard Burtescu
36fcfb02e2 rustc_trans: use internal linkage instead of private to work around linker bugs. 2015-02-16 17:13:48 +02:00
Eduard Burtescu
2dfd0acc92 tests: make run-make/issue-7349 more specific to avoid false positives. 2015-02-16 17:13:47 +02:00
Eduard Burtescu
48662d7cba rustc_trans: correctly round up the largest variant to the enum's alignment. 2015-02-16 17:13:47 +02:00
Eduard Burtescu
f4473a4664 rustc_trans: promote constant rvalues in functions as an optimization. 2015-02-16 17:13:47 +02:00
Eduard Burtescu
df3cc0c55f rustc: categorize rvalue borrows based on their const-qualification. 2015-02-16 17:13:47 +02:00
Eduard Burtescu
08967c7a7f tests: fix fallout from changed error messages. 2015-02-16 17:13:47 +02:00
Eduard Burtescu
03295a715f rustc: qualify expressions in check_const for potential promotion. 2015-02-16 17:13:42 +02:00
Eduard Burtescu
7be460ff37 rustc: use FromPrimitive for decoding astencode_tag. 2015-02-16 16:29:22 +02:00
Eduard Burtescu
5918d33fef rust_typeck: remove unnecessary typing of &[] as &'static [T; 0]. 2015-02-16 16:29:22 +02:00
Eduard Burtescu
bd9c67e181 rustc: check for signed division/remainder overflow. 2015-02-16 16:29:22 +02:00
Eduard Burtescu
cb3c9a1e88 rustc: teach const_eval more about types. 2015-02-16 16:29:22 +02:00
Eduard Burtescu
4d8f995c3a rustc: merge check_static into check_const. 2015-02-16 16:29:21 +02:00
Eduard Burtescu
8dd1f6a0dc rustc: remove the vestigial "const marking" pass. 2015-02-16 16:29:21 +02:00
bors
c5db290bf6 Auto merge of #22367 - Manishearth:rollup, r=steveklabnik
(still testing locally)
2015-02-16 00:46:43 +00:00
Manish Goregaokar
cea2bbfe27 Fix grammar 2015-02-16 03:56:52 +05:30
Niko Matsakis
6171c35d6e Change arbirary types from usize to u32. 2015-02-15 11:45:10 -05:00
Niko Matsakis
8eb38590c9 Audit integer types in finally. 2015-02-15 10:25:13 -05:00
Niko Matsakis
a43daa6366 Audit integer types in result. 2015-02-15 10:24:47 -05:00
Niko Matsakis
d7f673c82e Audit integer types in ops. 2015-02-15 10:22:43 -05:00
Manish Goregaokar
f0f8be2a2e Fix rollup (remove slicing_syntax) 2015-02-15 19:26:39 +05:30
Manish Goregaokar
b1a46db649 Rollup merge of #22247 - Gankro:dlist_split, r=alexcrichton 2015-02-15 18:42:48 +05:30
Manish Goregaokar
97503e1c1e Rollup merge of #22256 - brson:installer-next, r=alexcrichton
Highlights:

* Adds an 'uninstall.sh' script to `/usr/local/lib/rustlib/uninstall.sh`, the path to which is printed during installation.
* Components can be deselected during install, like `install.sh --without=rust-docs`.
* Components can be listed with `install.sh --list-components`.
* Vastly reduces spew during install (but supporting a `--verbose` option).

Typicall install run looks like:

```
brian@brianX1:~/dev/multirust⟫ sudo ./install.sh
[sudo] password for brian:
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'cargo'
install: installing component 'rust-docs'

    Rust is ready to roll.
```

Needs to be merged right before corresponding PRs to cargo and rust-packaging.

Fixes https://github.com/rust-lang/rust/issues/21117
Fixes https://github.com/rust-lang/rust/issues/20283
2015-02-15 18:42:48 +05:30
Manish Goregaokar
16b24f15bd Rollup merge of #22285 - kmcallister:pub-macro, r=nick29581
It's not clear what this means, because a macro in item position can expand to zero or more items.  For now we disallow it, which is technically a

    [breaking-change]

but is landing without an RFC.  The `pub` keyword previously had no effect, which seems quite unintended.

Fixes #18317.
Fixes #14660.
2015-02-15 18:42:48 +05:30
Manish Goregaokar
ed728ec145 Rollup merge of #22292 - brson:alpha2, r=alexcrichton 2015-02-15 18:42:47 +05:30
Manish Goregaokar
8111d65afc Rollup merge of #22293 - steveklabnik:gh12891, r=brson
Fixes #12891.
2015-02-15 18:42:47 +05:30
Manish Goregaokar
ed58399449 Rollup merge of #22297 - nagisa:spring-cleanup, r=alexcrichton
This PR replaces uses of `os::getenv` with newly introduced `env::var{,_os}`.

Mostly did this as a background activity to procrastinate from procrastinating.

Tests appear to build and run fine. This includes benchmarks from test/bench directory.
2015-02-15 18:42:47 +05:30
Manish Goregaokar
bc1900f0d0 Rollup merge of #22300 - kmcallister:pub-method-macro, r=sfackler
Fixes #17436.
2015-02-15 18:42:47 +05:30
Manish Goregaokar
f7870b6faa Rollup merge of #22339 - petrochenkov:int, r=huonw
Some function signatures have changed, so this is a [breaking-change].
In particular, radixes and numerical values of digits are represented by `u32` now.

Part of #22240
2015-02-15 18:42:47 +05:30
Manish Goregaokar
8acaaa9e0e Rollup merge of #22351 - blaenk:path-hash, r=huonw
`PathBuf` does implement `Hash`, but `Path` doesn't. This makes it
annoying if you have a `HashMap` with `PathBuf`s as keys, because
it means you have to convert a `Path` into a `PathBuf` and get a
reference to it simply to perform operations on the `HashMap`!
2015-02-15 18:42:46 +05:30
Manish Goregaokar
c59f62b75f Rollup merge of #22350 - brson:usize, r=Gankro
cc https://github.com/rust-lang/rust/issues/22240
2015-02-15 18:42:46 +05:30
Manish Goregaokar
e5659eaa06 Rollup merge of #22347 - iKevinY:std-lib-panicking, r=brson
Rename `libstd/failure.rs` to `libstd/panicking.rs` and `on_fail` to `on_panic`. Closes #22306.
2015-02-15 18:42:46 +05:30
Manish Goregaokar
a5bdb087d0 Rollup merge of #22329 - thiagooak:book, r=steveklabnik
on crates and modules - replace \")\"
on more strings - improve readability of grapheme
2015-02-15 18:42:46 +05:30