Commit Graph

39284 Commits

Author SHA1 Message Date
Huon Wilson
b0e7c58bf0 Add missing stability attributes on struct fields.
Unstable is the conservative choice.

cc #22950.
2015-03-02 18:04:11 +11:00
bors
1576142495 Auto merge of #22880 - alexcrichton:deprecate-io-extensions, r=huonw
The `u64_from_be_bytes` and `u64_to_be_bytes` functions are being deprecated
with no replacement for now.

[breaking-change]
2015-03-01 14:22:58 +00:00
bors
0eb0ba38d0 Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichton
Fixes issue #22016
2015-03-01 08:59:29 +00:00
bors
0905c8a5ec Auto merge of #22909 - Manishearth:rollup, r=Manishearth
r? @Manishearth
2015-03-01 06:32:54 +00:00
Manish Goregaokar
60f7732ccd Rollup merge of #22910 - dotdash:time_llvm_passes, r=cmr
The timing code break when using multiple codegen units, but that
shouldn't stop us from using it with a single codegen unit.
2015-03-01 09:50:30 +05:30
Manish Goregaokar
4e34daf2c4 Rollup merge of #22908 - mdinger:fix_link, r=Gankro
The markdown listing the link in [StrExt::width](http://doc.rust-lang.org/std/str/trait.StrExt.html#tymethod.width) isn't being parsed properly. I'm expecting it's because the `[ ]` is across 2 lines so this changes that. This is untested though.
2015-03-01 09:50:18 +05:30
Manish Goregaokar
4495bdb52c Add import of usize (fixup #22901) 2015-03-01 09:49:50 +05:30
Manish Goregaokar
d9fb9765a1 Rollup merge of #22907 - dotdash:static_assert_bool, r=eddyb
static_assert is documented as working on static with type `bool`, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes #22056
2015-03-01 09:49:48 +05:30
Manish Goregaokar
9dc9fcc767 Rollup merge of #22904 - dotdash:drop_old_clang, r=alexcrichton
Fixes #20467
2015-03-01 09:49:47 +05:30
Manish Goregaokar
337a0a981e Rollup merge of #22903 - semarie:openbsd-stack, r=alexcrichton
some commits in OpenBSD OS have corrected a problem of stack position.
Now, we can adjust more accurately the page guard in rust.

@dhuseby I am not sure that bitrig have already integrated these changes (the `$OpenBSD$` header in sys/kern/kern_exec.c is too old). But when they do, you may want this patch too.
2015-03-01 09:49:46 +05:30
Manish Goregaokar
87391ed52a Rollup merge of #22901 - thepowersgang:patch-1, r=eddyb
A misplaced uint->u32 instead of usize in fmt::Pointer. Added a basic test.
2015-03-01 09:49:43 +05:30
Manish Goregaokar
3c1f61ce63 Rollup merge of #22898 - edwardw:one-less-unsafe-impl, r=huonw
These implementations were temporary workaround. Now #22828 has been
fixed, they can be removed.
2015-03-01 09:49:42 +05:30
Manish Goregaokar
4ac53cc6ce Rollup merge of #22896 - Ms2ger:InlineAttr, r=huonw 2015-03-01 09:49:39 +05:30
bors
341a9ca1e3 Auto merge of #22898 - edwardw:one-less-unsafe-impl, r=huonw
These implementations were temporary workaround. Now #22828 has been
fixed, they can be removed.
2015-03-01 04:06:03 +00:00
bors
2b27dfd30a Auto merge of #22896 - Ms2ger:InlineAttr, r=huonw 2015-03-01 01:39:07 +00:00
Guillaume Gomez
1c4fb909ff Make Int::pow() take exp as u32 instead usize 2015-03-01 01:58:55 +01:00
Björn Steinbrink
0b5ca7850b Re-enable -Z time-llvm-passes when using a single codegen unit
The timing code break when using multiple codegen units, but that
shouldn't stop us from using it with a single codegen unit.
2015-02-28 22:40:39 +01:00
mdinger
000e976819 Fix incorrectly parsed markdown link 2015-02-28 14:05:50 -05:00
bors
8902936552 Auto merge of #21521 - defuz:interval-with-path, r=pnkfelix
Fixing #21475. Right now this code can not be parsed:

```rust
use m::{START, END};

fn main() {
    match 42u32 {
        m::START...m::END => {}, // error: expected one of `::`, `=>`, or `|`, found `...`
        _  => {},
    }
}

mod m {
  pub const START: u32 = 4;
  pub const END:   u32 = 14;
}
```

I fixed the parser and added test for this case, but now there are still problems with mixing literals and paths in interval:

```rust
    match 42u32 {
        0u32...m::END => {},       // mismatched types in range [E0031]
        m::START...59u32 => {},    // mismatched types in range [E0031]
        _  => {},
    }
}
```

I'll try fix this problem and need review.
2015-02-28 18:36:00 +00:00
Björn Steinbrink
d11b48c85c Error out when using static_assert on a non-boolean value
static_assert is documented as working on static with type `bool`, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes #22056
2015-02-28 19:28:49 +01:00
Björn Steinbrink
8b263f7566 Drop support for clang < 3.2
Fixes #20467
2015-02-28 17:53:12 +01:00
Sébastien Marie
28362d542d openbsd: adjust page guard address
some commits in OpenBSD base have corrected a problem of stack position.
Now, we can adjust more accurately the page guard in rust.
2015-02-28 17:26:42 +01:00
John Hodge
c22d026326 ifmt - Add a basic test for {:p} getting truncated 2015-02-28 22:51:29 +08:00
John Hodge
4a22c3368f Fix assuming 32-bit pointers 2015-02-28 22:44:10 +08:00
Edward Wang
2b8207a56d Remove two unsafe impls from iter::Peekable
These implementations were temporary workaround. Now #22828 has been
fixed, they can be removed.
2015-02-28 22:39:50 +08:00
bors
8a69110c3b Auto merge of #22895 - Manishearth:rollup, r=Manishearth
r? @Manishearth
2015-02-28 13:49:35 +00:00
Manish Goregaokar
0775959431 Rollup merge of #22867 - FuGangqiang:master, r=steveklabnik 2015-02-28 19:19:02 +05:30
Manish Goregaokar
6b1471967c Rollup merge of #22887 - JP-Ellis:master, r=huonw
Updated the function to allow comparisons between different types since PartialOrd and PartialEq allow this.
2015-02-28 19:19:01 +05:30
Manish Goregaokar
fcd1c3699a Rollup merge of #22866 - iKevinY:version-output-doc-fix, r=Manishearth
The format of `rustc --version` was changed in #21957; this PR updates TRPL accordingly.
2015-02-28 19:19:01 +05:30
Manish Goregaokar
040a811b91 Rollup merge of #22884 - japaric:obsolete, r=alexcrichton
This is leftover from #21843

If you still have `|&:| {}` closures in your code, simply remove the `&:` part.

[breaking-change]
2015-02-28 19:19:00 +05:30
Manish Goregaokar
37760c1f25 Rollup merge of #22875 - kmcallister:maceager, r=sfackler
MacEager is a MacResult implementation for the common case where you've already built each form of AST that you might return.

Fixes #17637. Based on #18814.

This is a [breaking-change] for syntax extensions:

  * MacExpr::new becomes MacEager::expr.

  * MacPat::new becomes MacEager::pat.

  * MacItems::new becomes MacEager::items. It takes a SmallVector directly,
    not an iterator.

r? @sfackler
2015-02-28 19:18:59 +05:30
Manish Goregaokar
a0f5ed957a Rollup merge of #22869 - alexcrichton:stabilize-env, r=aturon
Now that the `std::env` module has had some time to bake this commit marks most
of its APIs as `#[stable]`. Some notable APIs that are **not** stable (and still
use the same `env` feature gate) are:

* `{set,get}_exit_status` - there are still questions about whether this is the
  right interface for setting/getting the exit status of a process.
* `page_size` - this may change location in the future or perhaps name as well.

This also effectively closes #22122 as the variants of `VarError` are
`#[stable]` now. (this is done intentionally)
2015-02-28 19:18:59 +05:30
Ms2ger
63513d06a2 Remove the re-exports for InlineAttr variants. 2015-02-28 13:56:32 +01:00
bors
6f8d831406 Auto merge of #22851 - FlaPer87:oibit-send-and-friends, r=nikomatsakis
Fixes #22828
Fixes #22629

r? @nikomatsakis
2015-02-28 11:02:32 +00:00
defuz
6c35bf4fbc FIX #21475: Expr_::ExprPath with two fields 2015-02-28 11:01:28 +02:00
defuz
f84c25721e FIX #21475: mixing literals and paths in interval 2015-02-28 10:56:46 +02:00
defuz
52fa187431 FIX #21475: Interval match patterns won't parse namespace specifiers correctly 2015-02-28 10:56:46 +02:00
bors
8519e7833d Auto merge of #22839 - lifthrasiir:better-backtrace, r=alexcrichton
Fixes #20978 for supported platforms (i.e. non-Android POSIX).

This uses `backtrace_pcinfo` to inspect the DWARF debug info and list the file and line pairs for given stack frame. Such pair is not unique due to the presence of inlined functions and the updated routine correctly handles this case. The code is modelled after libbacktrace's `backtrace_full` routine.

There is one known issue with this approach. Macros, when invoked, take over the current frame and shadows the file and line pair which has invoked a macro. In particular, this makes many panicking
macros a bit harder to inspect. This really is a debuginfo problem, and the backtrace routine should print them correctly with a correct debuginfo.

Some example trace:

```
thread '<main>' panicked at 'explicit panic', /home/arachneng/Works/git/rust/src/test/run-pass/backtrace-debuginfo.rs:74
stack backtrace:
   1:         0xd964702f - sys::backtrace::write::h32d93fffb64131b2yxC
   2:         0xd9670202 - panicking::on_panic::h3a4fcb37b873aefeooM
   3:         0xd95b396a - rt::unwind::begin_unwind_inner::h576b3df5f626902dJ2L
   4:         0xd9eb88df - rt::unwind::begin_unwind::h16852273847167740350
   5:         0xd9eb8afb - aux::callback::h15056955655605709172
                        at /home/arachneng/Works/git/rust/<std macros>:3
                        at src/test/run-pass/backtrace-debuginfo-aux.rs:15
   6:         0xd9eb8caa - outer::h2cf96412459fceb6ema
                        at src/test/run-pass/backtrace-debuginfo.rs:73
                        at src/test/run-pass/backtrace-debuginfo.rs:88
   7:         0xd9ebab24 - main::h3f701287441442edasa
                        at src/test/run-pass/backtrace-debuginfo.rs:134
   8:         0xd96daba8 - rust_try_inner
   9:         0xd96dab95 - rust_try
  10:         0xd9671af4 - rt::lang_start::h7da0de9529b4c394liM
  11:         0xd8f3aec4 - __libc_start_main
  12:         0xd9eb8148 - <unknown>
  13:         0xffffffff - <unknown>
```
2015-02-28 08:30:19 +00:00
bors
48aeaba934 Auto merge of #22801 - huonw:crateify-lint, r=kmcallister
This pulls out the implementations of most built-in lints into a
separate crate, to reduce edit-compile-test iteration times with
librustc_lint and increase parallelism. This should enable lints to be
refactored, added and deleted much more easily as it slashes the
edit-compile cycle to get a minimal working compiler to test with (`make
rustc-stage1`) from

    librustc -> librustc_typeck -> ... -> librustc_driver ->
        libcore -> ... -> libstd

to

    librustc_lint -> librustc_driver -> libcore -> ... libstd

which is significantly faster, mainly due to avoiding the librustc build
itself.

The intention would be to move as much as possible of the infrastructure
into the crate too, but the plumbing is deeply intertwined with librustc
itself at the moment. Also, there are lints for which diagnostics are
registered directly in the compiler code, not in their own crate
traversal, and their definitions have to remain in librustc.

This is a [breaking-change] for direct users of the compiler APIs:
callers of `rustc::session::build_session` or
`rustc::session::build_session_` need to manually call
`rustc_lint::register_builtins` on their return value.

This should make #22206 easier.
2015-02-28 06:06:18 +00:00
Jorge Aparicio
7ad2e22e4e remove leftover annotations 2015-02-27 23:35:07 -05:00
Huon Wilson
39092530a4 Update docs for rustc_lint crateification. 2015-02-28 15:34:00 +11:00
Huon Wilson
532cd5f85a Separate most of rustc::lint::builtin into a separate crate.
This pulls out the implementations of most built-in lints into a
separate crate, to reduce edit-compile-test iteration times with
librustc_lint and increase parallelism. This should enable lints to be
refactored, added and deleted much more easily as it slashes the
edit-compile cycle to get a minimal working compiler to test with (`make
rustc-stage1`) from

    librustc -> librustc_typeck -> ... -> librustc_driver ->
        libcore -> ... -> libstd

to

    librustc_lint -> librustc_driver -> libcore -> ... libstd

which is significantly faster, mainly due to avoiding the librustc build
itself.

The intention would be to move as much as possible of the infrastructure
into the crate too, but the plumbing is deeply intertwined with librustc
itself at the moment. Also, there are lints for which diagnostics are
registered directly in the compiler code, not in their own crate
traversal, and their definitions have to remain in librustc.

This is a [breaking-change] for direct users of the compiler APIs:
callers of `rustc::session::build_session` or
`rustc::session::build_session_` need to manually call
`rustc_lint::register_builtins` on their return value.

This should make #22206 easier.
2015-02-28 15:33:59 +11:00
bors
1c93934fcf Auto merge of #22669 - dotdash:fast_slice_iter, r=huonw
This adds the assume() calls back that got lost when rebasing #21886.
2015-02-28 03:37:20 +00:00
JP-Ellis
bbd060d85a Update iter::order to be more generic.
Signed-off-by: JP-Ellis <coujellis@gmail.com>
2015-02-28 14:29:54 +11:00
Jorge Aparicio
cc8a5a0db7 obsolete |&:| syntax
closes #22881
2015-02-27 21:01:22 -05:00
FuGangqiang
69bfb6f717 change to iterate over &vet 2015-02-28 09:59:52 +08:00
Alex Crichton
d79e910337 std: Deprecated the old_io::extensions module
The `u64_from_be_bytes` and `u64_to_be_bytes` functions are being deprecated
with no replacement for now.

[breaking-change]
2015-02-27 16:26:33 -08:00
bors
e233987ce1 Auto merge of #22860 - Manishearth:rollup, r=alexcrichton
Passes check-stage1, check-stage2
2015-02-27 23:15:17 +00:00
Alex Crichton
bde4c1d6fb Test fixes and rebase conflicts 2015-02-27 15:13:35 -08:00
Alex Crichton
ad14891957 std: Stabilize the env module
Now that the `std::env` module has had some time to bake this commit marks most
of its APIs as `#[stable]`. Some notable APIs that are **not** stable (and still
use the same `env` feature gate) are:

* `{set,get}_exit_status` - there are still questions about whether this is the
  right interface for setting/getting the exit status of a process.
* `page_size` - this may change location in the future or perhaps name as well.

This also effectively closes #22122 as the variants of `VarError` are
`#[stable]` now. (this is done intentionally)
2015-02-27 13:41:49 -08:00