]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #22839 - lifthrasiir:better-backtrace, r=alexcrichton
bors [Sat, 28 Feb 2015 08:30:19 +0000 (08:30 +0000)]
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>
```

9 years agoAuto merge of #22801 - huonw:crateify-lint, r=kmcallister
bors [Sat, 28 Feb 2015 06:06:18 +0000 (06:06 +0000)]
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.

9 years agoUpdate docs for rustc_lint crateification.
Huon Wilson [Wed, 25 Feb 2015 12:03:44 +0000 (23:03 +1100)]
Update docs for rustc_lint crateification.

9 years agoSeparate most of rustc::lint::builtin into a separate crate.
Huon Wilson [Wed, 25 Feb 2015 11:44:44 +0000 (22:44 +1100)]
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.

9 years agoAuto merge of #22669 - dotdash:fast_slice_iter, r=huonw
bors [Sat, 28 Feb 2015 03:37:20 +0000 (03:37 +0000)]
Auto merge of #22669 - dotdash:fast_slice_iter, r=huonw

This adds the assume() calls back that got lost when rebasing #21886.

9 years agoAuto merge of #22860 - Manishearth:rollup, r=alexcrichton
bors [Fri, 27 Feb 2015 23:15:17 +0000 (23:15 +0000)]
Auto merge of #22860 - Manishearth:rollup, r=alexcrichton

Passes check-stage1, check-stage2

9 years agoTest fixes and rebase conflicts
Alex Crichton [Fri, 27 Feb 2015 23:13:35 +0000 (15:13 -0800)]
Test fixes and rebase conflicts

9 years agostd: Fixed backtrace warnings and tests for non-Linux platforms.
Kang Seonghoon [Fri, 27 Feb 2015 16:42:51 +0000 (01:42 +0900)]
std: Fixed backtrace warnings and tests for non-Linux platforms.

- Fixed a couple of dead code warnings in std::sys::backtrace.
- Made `backtrace-debuginfo` test a no-op on non-Linux platforms.
- `backtrace-debuginfo` is no longer tested on pretty-rpass.

9 years agoRollup merge of #22844 - pnkfelix:refactor-signalling-of-E0223, r=Aatch
Manish Goregaokar [Fri, 27 Feb 2015 06:23:02 +0000 (11:53 +0530)]
Rollup merge of  #22844 - pnkfelix:refactor-signalling-of-E0223, r=Aatch

Refactor signaling of E0223 to avoid multiple span_errs for same code.

(Doing this cuts out one diagnostic during the build.)

9 years agoRefactor signaling of E0223 to avoid multiple span_errs for same code.
Felix S. Klock II [Thu, 26 Feb 2015 18:15:57 +0000 (19:15 +0100)]
Refactor signaling of E0223 to avoid multiple span_errs for same code.

9 years agoRollup merge of #22848 - tshepang:redundant-mention, r=brson
Manish Goregaokar [Fri, 27 Feb 2015 06:15:09 +0000 (11:45 +0530)]
Rollup merge of #22848 - tshepang:redundant-mention, r=brson

9 years agoRollup merge of #22837 - eddyb:issue-21721, r=dotdash
Manish Goregaokar [Fri, 27 Feb 2015 06:14:59 +0000 (11:44 +0530)]
Rollup merge of #22837 - eddyb:issue-21721, r=dotdash

 Closes #21721.

9 years agoRollup merge of #22836 - mahkoh:testflush, r=huonw
Manish Goregaokar [Fri, 27 Feb 2015 06:14:40 +0000 (11:44 +0530)]
Rollup merge of #22836 - mahkoh:testflush, r=huonw

 See https://github.com/rust-lang/rust/blob/41f8b1e89b5ca0c79d7bca782ca44085624d4564/src/libtest/lib.rs#L783-L788

9 years agoRollup merge of #22835 - tshepang:remove-some-warnings, r=jakub-
Manish Goregaokar [Fri, 27 Feb 2015 06:14:33 +0000 (11:44 +0530)]
Rollup merge of #22835 - tshepang:remove-some-warnings, r=jakub-

9 years agoRollup merge of #22833 - laijs:remove-redundant-else-branch, r=dotdash
Manish Goregaokar [Fri, 27 Feb 2015 06:14:25 +0000 (11:44 +0530)]
Rollup merge of #22833 - laijs:remove-redundant-else-branch, r=dotdash

 The branch \"else { continue }\" is the last code inside a loop body,
it is just useless.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
9 years agoRollup merge of #22817 - jmesmon:result-or-type, r=huonw
Manish Goregaokar [Fri, 27 Feb 2015 06:14:19 +0000 (11:44 +0530)]
Rollup merge of #22817 - jmesmon:result-or-type, r=huonw

 Changes .or() so that it can return a Result with a different E type
than the one it is called on.

Essentially:

    fn or(self, res: Result<T, E>) -> Result<T, E>

becomes

    fn or<F>(self, res: Result<T, F>) -> Result<T, F>

This brings `or` in line with the existing `and` & `or_else`

This is a
[breaking-change]
Due to some code needing additional type annotations.

9 years agoRollup merge of #22809 - nikomatsakis:issue-22655-infinite-recursion, r=pnkfelix
Manish Goregaokar [Fri, 27 Feb 2015 06:14:12 +0000 (11:44 +0530)]
Rollup merge of #22809 - nikomatsakis:issue-22655-infinite-recursion, r=pnkfelix

 Change MarkerTrait to be invariant. This is a (small) loss of expressiveness, but is necessary for now to work around #22806. Fixes #22655.

r? @pnkfelix

9 years agoRollup merge of #22795 - alexcrichton:issue-22617, r=huonw
Manish Goregaokar [Fri, 27 Feb 2015 06:13:57 +0000 (11:43 +0530)]
Rollup merge of #22795 - alexcrichton:issue-22617, r=huonw

 Keeps the method consistent with `Iterator::any`.

Closes #22617
[breaking-change]

9 years agoRollup merge of #22788 - vadimcn:fix-precise_time_ns, r=pnkfelix
Manish Goregaokar [Fri, 27 Feb 2015 06:13:51 +0000 (11:43 +0530)]
Rollup merge of #22788 - vadimcn:fix-precise_time_ns, r=pnkfelix

 which starts happening after ~2 hours of machine uptime.
Closes #17845

9 years agoRollup merge of #22748 - jxcl:string-backslash, r=steveklabnik
Manish Goregaokar [Fri, 27 Feb 2015 06:13:24 +0000 (11:43 +0530)]
Rollup merge of #22748 - jxcl:string-backslash, r=steveklabnik

 r? @steveklabnik

Closes #22698

I wasn't sure that this was appropriate for the book, but I've added this to the reference. I also noticed that one of the U+ symbols in the character literals section was missing the graves.

9 years agoRollup merge of #22732 - jxcl:cargo-new, r=steveklabnik
Manish Goregaokar [Fri, 27 Feb 2015 06:13:17 +0000 (11:43 +0530)]
Rollup merge of #22732 - jxcl:cargo-new, r=steveklabnik

 r? @steveklabnik

9 years agoRollup merge of #22846 - dhuseby:bitrig-cleanup, r=alexcrichton
Manish Goregaokar [Fri, 27 Feb 2015 06:13:09 +0000 (11:43 +0530)]
Rollup merge of #22846 - dhuseby:bitrig-cleanup, r=alexcrichton

 This patch contains a couple time fixes to make Rust compile on Bitrig again.  This does not affect OpenBSD.

9 years agoRollup merge of #22843 - vhbit:no-jemalloc-fix, r=alexcrichton
Manish Goregaokar [Fri, 27 Feb 2015 06:13:00 +0000 (11:43 +0530)]
Rollup merge of #22843 - vhbit:no-jemalloc-fix, r=alexcrichton

   "body": null,

9 years agoRollup merge of #22823 - kmcallister:fix-21370, r=huonw
Manish Goregaokar [Fri, 27 Feb 2015 06:12:40 +0000 (11:42 +0530)]
Rollup merge of #22823 - kmcallister:fix-21370, r=huonw

 Fixes #21370.

`unused-macro-with-follow-violation.rs` was already handled correctly. That test is just for good measure. :)

I have a more involved plan to clean this up, but it ran into difficulties such as #22814.

9 years agoRollup merge of #22818 - pnkfelix:fsk-issue-22536, r=nikomatsakis
Manish Goregaokar [Fri, 27 Feb 2015 06:12:35 +0000 (11:42 +0530)]
Rollup merge of #22818 - pnkfelix:fsk-issue-22536, r=nikomatsakis

 Ensure we do not zero when \"moving\" types that are Copy.

Uses more precise `type_needs_drop` for deciding about emitting cleanup code.  Added notes about the weaknesses regarding `ty::type_contents` here.

Fix #22536

9 years agoRollup merge of #22803 - huonw:field-stability, r=alexcrichton
Manish Goregaokar [Fri, 27 Feb 2015 06:12:29 +0000 (11:42 +0530)]
Rollup merge of #22803 - huonw:field-stability, r=alexcrichton

 We were recording stability attributes applied to fields in the
compiler, and even annotating it in the libs, but the compiler didn't
actually do the checks to give errors/warnings in user crates.

Details in the commit messages.

9 years agoAuto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearth
bors [Fri, 27 Feb 2015 10:35:51 +0000 (10:35 +0000)]
Auto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearth

Implements `Debug`  for `RwLock` and `arc::Weak` in the same way it is implemented for `rc::Weak` (basically copy & paste).

The lack of this implementation prevents the automatic implementation of `Debug` for structs containing members of these types.

9 years agoAuto merge of #22853 - FlaPer87:snap, r=alexcrichton
bors [Fri, 27 Feb 2015 07:46:15 +0000 (07:46 +0000)]
Auto merge of #22853 - FlaPer87:snap, r=alexcrichton

r? @alexcrichton

cc @nikomatsakis @pnkfelix

9 years agoAuto merge of #22857 - alexcrichton:net-flaky, r=alexcrichton
bors [Fri, 27 Feb 2015 05:21:05 +0000 (05:21 +0000)]
Auto merge of #22857 - alexcrichton:net-flaky, r=alexcrichton

Instead of allocating the same ports for ipv4 and ipv6 tests, instead draw all
ports from the same pool. Some tests connect to just "localhost" on a particular
port which may accidentally be interacting with other tests as the ipv-what-ness
isn't specified with the string "localhost"

Relevant logs:

* [Deadlock of the `net::tcp::tests::listen_localhost` test][mac]
* [Failure of the `fast_rebind` test][win1]
* [Failure of `multiple_connect_interleaved_lazy_schedule_ip4`][win2]

[mac]: https://gist.github.com/alexcrichton/349c7ce7c620c1adb2f2
[win1]: https://gist.github.com/alexcrichton/7e3611faae2e1edaee6f
[win2]: https://gist.github.com/alexcrichton/4f5f87749af3ad0f9851

9 years agostd: Draw from the same port pool during tests
Alex Crichton [Fri, 27 Feb 2015 03:04:42 +0000 (19:04 -0800)]
std: Draw from the same port pool during tests

Instead of allocating the same ports for ipv4 and ipv6 tests, instead draw all
ports from the same pool. Some tests connect to just "localhost" on a particular
port which may accidentally be interacting with other tests as the ipv-what-ness
isn't specified with the string "localhost"

Relevant logs:

* [Deadlock of the `net::tcp::tests::listen_localhost` test][mac]
* [Failure of the `fast_rebind` test][win1]
* [Failure of `multiple_connect_interleaved_lazy_schedule_ip4`][win2]

[mac]: https://gist.github.com/alexcrichton/349c7ce7c620c1adb2f2
[win1]: https://gist.github.com/alexcrichton/7e3611faae2e1edaee6f
[win2]: https://gist.github.com/alexcrichton/4f5f87749af3ad0f9851

9 years agoAuto merge of #22765 - sanxiyn:dedup-rustdoc, r=alexcrichton
bors [Fri, 27 Feb 2015 02:58:15 +0000 (02:58 +0000)]
Auto merge of #22765 - sanxiyn:dedup-rustdoc, r=alexcrichton

rustdoc impl item did not include default methods for local crates, but did include them for external crates. This resulted in duplicate methods. Fix so that impl item does not include default methods for external crates.

Fix #22595.

9 years agoAdd some missing stability attributes on struct fields.
Huon Wilson [Wed, 25 Feb 2015 12:12:22 +0000 (23:12 +1100)]
Add some missing stability attributes on struct fields.

9 years agolibtest: flush output after every write
Julian Orth [Thu, 26 Feb 2015 14:31:24 +0000 (15:31 +0100)]
libtest: flush output after every write

Useful for debugging tests that hang forever.

9 years agoregister snapshot 880fb89
Flavio Percoco [Wed, 25 Feb 2015 12:48:53 +0000 (13:48 +0100)]
register snapshot 880fb89

9 years agoAuto merge of #22825 - semarie:openbsd-pathbuf, r=alexcrichton
bors [Thu, 26 Feb 2015 23:04:03 +0000 (23:04 +0000)]
Auto merge of #22825 - semarie:openbsd-pathbuf, r=alexcrichton

unbreak openbsd/bitrig build after 2d200c9c (the complete build/check on openbsd is in progress)

@dhuseby maybe this one is in your list ?

9 years agodoc: the last mention of the word 'iterator' is redundant
Tshepang Lekhonkhobe [Thu, 26 Feb 2015 21:22:15 +0000 (23:22 +0200)]
doc: the last mention of the word 'iterator' is redundant

9 years agofixing a few bitrig build breakers
Dave Huseby [Thu, 26 Feb 2015 21:03:06 +0000 (13:03 -0800)]
fixing a few bitrig build breakers

9 years agoFixed build with jemalloc disabled
Valerii Hiora [Thu, 26 Feb 2015 12:17:28 +0000 (14:17 +0200)]
Fixed build with jemalloc disabled

9 years agoMakes the picky tidy satisfied. Also refers to the correct issue.
Kang Seonghoon [Thu, 26 Feb 2015 16:30:55 +0000 (01:30 +0900)]
Makes the picky tidy satisfied. Also refers to the correct issue.

9 years agoRemoved an excess feature flag from the backtrace test.
Kang Seonghoon [Thu, 26 Feb 2015 16:26:06 +0000 (01:26 +0900)]
Removed an excess feature flag from the backtrace test.

9 years agostd: Include line numbers in backtraces.
Kang Seonghoon [Thu, 26 Feb 2015 16:12:22 +0000 (01:12 +0900)]
std: Include line numbers in backtraces.

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.

9 years agoAuto merge of #22715 - edwardw:send-sync-audit, r=alexcrichton
bors [Thu, 26 Feb 2015 15:43:38 +0000 (15:43 +0000)]
Auto merge of #22715 - edwardw:send-sync-audit, r=alexcrichton

In the process, also replaces two raw mutable pointers with `Unique` to
spell out the ownership semantics.

cc #22709

9 years agoAdd a rustdoc test for default methods in external crates
Seo Sanghyeon [Thu, 26 Feb 2015 15:28:57 +0000 (00:28 +0900)]
Add a rustdoc test for default methods in external crates

9 years agoAdd a way to assert the number of occurrences to htmldocck
Seo Sanghyeon [Thu, 26 Feb 2015 15:27:57 +0000 (00:27 +0900)]
Add a way to assert the number of occurrences to htmldocck

9 years agoRevert hacks and add test for LLVM aborts due to empty aggregates.
Eduard Burtescu [Thu, 26 Feb 2015 13:22:13 +0000 (15:22 +0200)]
Revert hacks and add test for LLVM aborts due to empty aggregates.
Closes #21721.

9 years agoAdd doc to `core::intrinsics` pointing out conservativeness of `needs_drop`.
Felix S. Klock II [Thu, 26 Feb 2015 13:35:08 +0000 (14:35 +0100)]
Add doc to `core::intrinsics` pointing out conservativeness of `needs_drop`.

9 years agoRegression test for #22536.
Felix S. Klock II [Wed, 25 Feb 2015 22:45:41 +0000 (23:45 +0100)]
Regression test for #22536.

9 years agoUse more precise `type_needs_drop` for deciding about emitting cleanup code.
Felix S. Klock II [Wed, 25 Feb 2015 22:09:58 +0000 (23:09 +0100)]
Use more precise `type_needs_drop` for deciding about emitting cleanup code.

Fix #22536

9 years agoAdd `push_ctxt` instrumentation to all functions that might call `base::zero_mem`.
Felix S. Klock II [Wed, 25 Feb 2015 14:45:33 +0000 (15:45 +0100)]
Add `push_ctxt` instrumentation to all functions that might call `base::zero_mem`.

(Instrumentation work for Issue 22536.)

9 years agoremove the redundant else branch
Lai Jiangshan [Thu, 26 Feb 2015 09:36:49 +0000 (17:36 +0800)]
remove the redundant else branch

The branch "else { continue }" is the last code inside a loop body,
it is just useless.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
9 years agoAuto merge of #22827 - sfackler:should_panic_pt1, r=alexcrichton
bors [Thu, 26 Feb 2015 09:23:36 +0000 (09:23 +0000)]
Auto merge of #22827 - sfackler:should_panic_pt1, r=alexcrichton

This needs to make it into the snapshot before #21824 can land.

r? @alexcrichton

9 years agoImplement `Debug` for `RwLock`, `arc::Weak` and `Mutex`
nwin [Fri, 20 Feb 2015 12:09:29 +0000 (13:09 +0100)]
Implement `Debug` for `RwLock`, `arc::Weak` and `Mutex`

9 years agoSend/Sync audit for libcollections
Edward Wang [Wed, 25 Feb 2015 12:52:18 +0000 (20:52 +0800)]
Send/Sync audit for libcollections

In the process, also replaces a raw mutable pointers with Unique to
spell out the ownership semantics.

cc #22709

9 years agoAuto merge of #22810 - japaric:cow-path, r=alexcrichton
bors [Thu, 26 Feb 2015 07:01:18 +0000 (07:01 +0000)]
Auto merge of #22810 - japaric:cow-path, r=alexcrichton

The Path/PathBuf pair already implements the required `Borrow`/`ToOwned` traits and can be used in a `Cow` pointer, so why not?

r? @alexcrichton

9 years agoWhitelist #[should_panic]
Steven Fackler [Thu, 26 Feb 2015 06:04:00 +0000 (22:04 -0800)]
Whitelist #[should_panic]

9 years agoTweak VecDeque's IterMut implementation
Edward Wang [Wed, 25 Feb 2015 10:11:23 +0000 (18:11 +0800)]
Tweak VecDeque's IterMut implementation

So it is symmetric to its `Iter` implementation. Also kills an FIXME.

9 years agoRecord the publicity of struct fields and enum variants.
Huon Wilson [Wed, 25 Feb 2015 11:37:12 +0000 (22:37 +1100)]
Record the publicity of struct fields and enum variants.

The stability check checks the `PublicItems` map when giving errors if
there is a #[stable] item with a public contents that doesn't not have
its own stability. Without recording this, struct fields and enum
variants will not get errors for e.g. stable modules with unmarked
functions internally.

This is just improving the compiler's precision to give the standard
library developers more information earlier.

E.g.

    #![staged_api]
    #![feature(staged_api)]
    #![crate_type = "lib"]

    #[stable(feature = "rust1", since = "1.0.0")]
    pub struct Foo {
        pub x: i32
    }

    #[stable(feature = "rust1", since = "1.0.0")]
    pub mod bar {
        pub fn baz() {}
    }

Without the patch it gives:

    test.rs:12:5: 12:20 error: This node does not have a stability attribute
    test.rs:12     pub fn baz() {}
                   ^~~~~~~~~~~~~~~
    error: aborting due to previous error

With the patch it gives:

    test.rs:7:9: 7:15 error: This node does not have a stability attribute
    test.rs:7     pub x: i32
                      ^~~~~~
    test.rs:12:5: 12:20 error: This node does not have a stability attribute
    test.rs:12     pub fn baz() {}
                   ^~~~~~~~~~~~~~~
    error: aborting due to 2 previous errors

9 years agoCheck stability of struct fields.
Huon Wilson [Wed, 25 Feb 2015 11:34:21 +0000 (22:34 +1100)]
Check stability of struct fields.

We were recording stability attributes applied to fields in the
compiler, and even annotating it in the libs, but the compiler didn't
actually do the checks to give errors/warnings in user crates.

9 years agoremove some compiler warnings
Tshepang Lekhonkhobe [Wed, 25 Feb 2015 06:20:34 +0000 (08:20 +0200)]
remove some compiler warnings

9 years agopath -> PathBuf for openbsd/bitrig
Sébastien Marie [Thu, 26 Feb 2015 05:16:41 +0000 (06:16 +0100)]
path -> PathBuf for openbsd/bitrig

9 years agoChanged prose to assert_eq! macro.
Alexander Bliskovsky [Thu, 26 Feb 2015 01:29:13 +0000 (20:29 -0500)]
Changed prose to assert_eq! macro.

9 years agoAdded documentation of backslash ending string literals.
Alexander Bliskovsky [Tue, 24 Feb 2015 05:13:04 +0000 (00:13 -0500)]
Added documentation of backslash ending string literals.

Closes #22698

9 years agoAlways error on invalid macro fragment specifiers
Keegan McAllister [Thu, 26 Feb 2015 01:11:36 +0000 (17:11 -0800)]
Always error on invalid macro fragment specifiers

Fixes #21370.

unused-macro-with-follow-violation.rs was already handled correctly. That test
is just for good measure. :)

9 years agoAuto merge of #22767 - pnkfelix:issue-22265, r=nikomatsakis
bors [Wed, 25 Feb 2015 23:08:53 +0000 (23:08 +0000)]
Auto merge of #22767 - pnkfelix:issue-22265, r=nikomatsakis

Avoid `cat_expr Erred` notes when already in error state.

Also, to ensure we do not let the dropck get skipped, ICE if `cat_expr` errors when *not* in error state.

This is not known to be a breaking change (i.e. I do not know of a current case that causes the new ICE to be exercised).

Fix #22265

9 years agoFix overflow in precise_time_ns() on Windows,
Vadim Chugunov [Tue, 24 Feb 2015 06:47:56 +0000 (22:47 -0800)]
Fix overflow in precise_time_ns() on Windows,
which starts happening after ~2 hours of machine uptime.

9 years agoResult::or : avoid over-specializing the type
Cody P Schafer [Wed, 25 Feb 2015 18:37:22 +0000 (13:37 -0500)]
Result::or : avoid over-specializing the type

Changes .or() so that it can return a Result with a different E type
than the one it is called on.

Essentially:

    fn or(self, res: Result<T, E>) -> Result<T, E>

becomes

    fn or<F>(self, res: Result<T, F>) -> Result<T, F>

This brings `or` in line with the existing `and` and `or_else` member
types.

This is a
[breaking-change]
Due to some code needing additional type annotations.

9 years agoAuto merge of #22796 - Manishearth:rollup, r=Manishearth
bors [Wed, 25 Feb 2015 20:32:58 +0000 (20:32 +0000)]
Auto merge of #22796 - Manishearth:rollup, r=Manishearth

9 years agoimpl IntoCow for Path[Buf]
Jorge Aparicio [Wed, 25 Feb 2015 16:43:39 +0000 (11:43 -0500)]
impl IntoCow for Path[Buf]

9 years agoChange MarkerTrait to be invariant. This is a (small) loss of expressiveness,
Niko Matsakis [Wed, 25 Feb 2015 17:21:15 +0000 (12:21 -0500)]
Change MarkerTrait to be invariant. This is a (small) loss of expressiveness,
but is necessary for now to work around #22806. Fixes #22655.

9 years agoPath -> PathBuf for Windows test (fixup #22727)
Manish Goregaokar [Wed, 25 Feb 2015 12:39:53 +0000 (18:09 +0530)]
Path -> PathBuf for Windows test (fixup #22727)

9 years agopath -> PathBuf for osx/dragonfly (fixup #22727)
Manish Goregaokar [Wed, 25 Feb 2015 08:45:24 +0000 (14:15 +0530)]
path -> PathBuf for osx/dragonfly (fixup #22727)

9 years agoAssert is internal now (fixup #22739)
Manish Goregaokar [Wed, 25 Feb 2015 08:41:37 +0000 (14:11 +0530)]
Assert is internal now (fixup #22739)

9 years agoFix type inference error (fixup #22739)
Manish Goregaokar [Wed, 25 Feb 2015 08:28:58 +0000 (13:58 +0530)]
Fix type inference error (fixup #22739)

9 years agoUse os::getcwd instead of env in rustbook (fixup #22727)
Manish Goregaokar [Wed, 25 Feb 2015 07:18:14 +0000 (12:48 +0530)]
Use os::getcwd instead of env in rustbook (fixup #22727)

9 years agoallow(deprecated) for TaskPool (fixup #22783)
Manish Goregaokar [Wed, 25 Feb 2015 06:15:06 +0000 (11:45 +0530)]
allow(deprecated) for TaskPool (fixup #22783)

9 years agostd: Require `&mut self` for Iterator::all
Alex Crichton [Wed, 25 Feb 2015 05:52:27 +0000 (21:52 -0800)]
std: Require `&mut self` for Iterator::all

Keeps the method consistent with `Iterator::any`.

Closes #22617
[breaking-change]

9 years agoRollup merge of #22787 - pnkfelix:reenable-gate-for-unsafe_no_drop_flag, r=alexcrichton
Manish Goregaokar [Wed, 25 Feb 2015 05:00:12 +0000 (10:30 +0530)]
Rollup merge of #22787 - pnkfelix:reenable-gate-for-unsafe_no_drop_flag, r=alexcrichton

 Turn `unsafe_no_drop_flag` back into a gated-feature.

Fix #22173

9 years agoRollup merge of #22744 - alexcrichton:issue-22738, r=aturon
Manish Goregaokar [Wed, 25 Feb 2015 05:00:01 +0000 (10:30 +0530)]
Rollup merge of #22744 - alexcrichton:issue-22738, r=aturon

 Currently we have a `set_mode` mutator, so this just adds the pairing of a
`mode` accessor to read the value.

Closes #22738

9 years agoRollup merge of #22742 - alexcrichton:issue-22737, r=aturon
Manish Goregaokar [Wed, 25 Feb 2015 04:59:53 +0000 (10:29 +0530)]
Rollup merge of #22742 - alexcrichton:issue-22737, r=aturon

 If the filename for a path is `None` then we know that the creation of the
parent directory created the whole path so there's no need to retry the call to
`create_dir`.

Closes #22737

9 years agoRollup merge of #22729 - alexcrichton:ptr-stabilization, r=aturon
Manish Goregaokar [Wed, 25 Feb 2015 04:59:46 +0000 (10:29 +0530)]
Rollup merge of #22729 - alexcrichton:ptr-stabilization, r=aturon

 Specifically, the following actions were takend:

* The `copy_memory` and `copy_nonoverlapping_memory` functions
  to drop the `_memory` suffix (as it's implied by the functionality). Both
  functions are now marked as `#[stable]`.
* The `set_memory` function was renamed to `write_bytes` and is now stable.
* The `zero_memory` function is now deprecated in favor of `write_bytes`
  directly.
* The `Unique` pointer type is now behind its own feature gate called `unique`
  to facilitate future stabilization.

[breaking-change]

9 years agoRollup merge of #22727 - alexcrichton:prep-env, r=aturon
Manish Goregaokar [Wed, 25 Feb 2015 04:59:39 +0000 (10:29 +0530)]
Rollup merge of #22727 - alexcrichton:prep-env, r=aturon

 This commit moves `std::env` away from the `std::old_io` error type as well as
the `std::old_path` module. Methods returning an error now return `io::Error`
and methods consuming or returning paths use `std::path` instead of
`std::old_path`. This commit does not yet mark these APIs as `#[stable]`.

This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with
essentially the exact same API. This type was added to interoperate with the new
path API and has its own `tempdir` feature.

Finally, this commit reverts the deprecation of `std::os` APIs returning the old
path API types. This deprecation can come back once the entire `std::old_path`
module is deprecated.

[breaking-change]

9 years agoRollup merge of #22596 - alexcrichton:fix-some-impls, r=huonw
Manish Goregaokar [Wed, 25 Feb 2015 04:59:32 +0000 (10:29 +0530)]
Rollup merge of #22596 - alexcrichton:fix-some-impls, r=huonw

 This commit removes many unnecessary `unsafe impl` blocks as well as pushing the
needed implementations to the lowest level possible. I noticed that the bounds
for `RwLock` are a little off when reviewing #22574 and wanted to ensure that we
had our story straight on these implementations.

9 years agoRollup merge of #22157 - tbu-:pr_debug_collections, r=alexcrichton
Manish Goregaokar [Wed, 25 Feb 2015 04:59:23 +0000 (10:29 +0530)]
Rollup merge of #22157 - tbu-:pr_debug_collections, r=alexcrichton

 r? @Gankro

9 years agoRollup merge of #22792 - semarie:openbsd-unbreak-nacl, r=alexcrichton
Manish Goregaokar [Wed, 25 Feb 2015 04:57:30 +0000 (10:27 +0530)]
Rollup merge of #22792 - semarie:openbsd-unbreak-nacl, r=alexcrichton

 The recent commit on liblibc for nacl break the compilation for OpenBSD (and Bitrig too, I think).

The problem is `ino_t` come from another block too now. This patch remove the extra declaration.

```
.../src/liblibc/lib.rs:98:9: 98:37 error: a type named `ino_t` has already been imported in this module [E0251]
.../src/liblibc/lib.rs:98 pub use types::os::arch::posix01::*;
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
```

@dhuseby do you have this problem too ? and if yes, does this patch correct it ?

9 years agoRollup merge of #22785 - nikomatsakis:issue-21750-normalization-with-regions, r=pnkfelix
Manish Goregaokar [Wed, 25 Feb 2015 04:57:24 +0000 (10:27 +0530)]
Rollup merge of #22785 - nikomatsakis:issue-21750-normalization-with-regions, r=pnkfelix

 Two changes:

1. Make traits with assoc types invariant w/r/t their inputs.
2. Fully normalize parameter environments, including any region variables (which were being overlooked).

The former supports the latter, but also just seems like a reasonably good idea.

Fixes #21750

cc @edwardw
r? @pnkfelix

9 years agoRollup merge of #22784 - rnestler:fix_doc_faq, r=dotdash
Manish Goregaokar [Wed, 25 Feb 2015 04:57:17 +0000 (10:27 +0530)]
Rollup merge of #22784 - rnestler:fix_doc_faq, r=dotdash

 According to #22650 and bb0bbf639eafdd79380a3b1e2e92263a2aa914f9 the
link changed.
I think this should fix the link on http://doc.rust-lang.org/#faqs

9 years agoRollup merge of #22783 - alexcrichton:deprecate-taskpool, r=alexcrichton
Manish Goregaokar [Wed, 25 Feb 2015 04:57:11 +0000 (10:27 +0530)]
Rollup merge of #22783 - alexcrichton:deprecate-taskpool, r=alexcrichton

 Rather than stabilize on the current API, we're going to punt this
concern to crates.io, to allow for faster iteration.

[breaking-change]

9 years agoRollup merge of #22635 - kmcallister:macros-chapter, r=steveklabnik
Manish Goregaokar [Wed, 25 Feb 2015 04:57:03 +0000 (10:27 +0530)]
Rollup merge of #22635 - kmcallister:macros-chapter, r=steveklabnik

 r? @steveklabnik

9 years agoAuto merge of #22512 - nikomatsakis:issue-20300-where-clause-not-bounds, r=nikomatsakis
bors [Wed, 25 Feb 2015 04:28:23 +0000 (04:28 +0000)]
Auto merge of #22512 - nikomatsakis:issue-20300-where-clause-not-bounds, r=nikomatsakis

This is a fix for #20300 though as a side-sweep it fixes a number of stack overflows because it integrates cycle detection into the conversion process. I didn't go through and retest everything.

The tricky part here is that in some cases we have to go find the information we need from the AST -- we can't use the converted form of the where-clauses because we often have to handle something like `T::Item` *while converting the where-clauses themselves*. Since this is also not a fixed-point process we can't just try and keep trying to find the best order. So instead I modified the `AstConv` interface to allow you to request the bounds for a type parameter; we'll then do a secondary scan of the where-clauses to figure out what we need. This may create a cycle in some cases, but we have code to catch that.

Another approach that is NOT taken by this PR would be to "convert" `T::Item` into a form that does not specify what trait it's using. This then kind of defers the problem of picking the trait till later. That might be a good idea, but it would make normalization and everything else much harder, so I'm holding off on that (and hoping to find a better way for handling things like `i32::T`).

This PR also removes "most of" the `bounds` struct from `TypeParameterDef`. Still a little ways to go before `ParamBounds` can be removed entirely -- it's used for supertraits, for example (though those really ought to be converted, I think, to a call to `get_type_parameter_bounds` on `Self` from within the trait definition).

cc @jroesch

Fixes #20300

9 years agounbreak openbsd after nacl intergration
Sébastien Marie [Wed, 25 Feb 2015 04:07:40 +0000 (05:07 +0100)]
unbreak openbsd after nacl intergration

9 years agoTurn `unsafe_no_drop_flag` back into a gated-feature.
Felix S. Klock II [Wed, 25 Feb 2015 00:35:41 +0000 (01:35 +0100)]
Turn `unsafe_no_drop_flag` back into a gated-feature.

Fix #22173

9 years agoEnhance and move information about macro debugging
Keegan McAllister [Sat, 21 Feb 2015 06:08:06 +0000 (22:08 -0800)]
Enhance and move information about macro debugging

Fixes #22424.

9 years agoTweak wording in the macros guide
Keegan McAllister [Sat, 21 Feb 2015 05:33:17 +0000 (21:33 -0800)]
Tweak wording in the macros guide

9 years agoAdd a second, more vexing section on recursive macros
Keegan McAllister [Sat, 21 Feb 2015 05:39:03 +0000 (21:39 -0800)]
Add a second, more vexing section on recursive macros

Fixes #22423.

9 years agoAdd a section on recursive macros
Keegan McAllister [Fri, 20 Feb 2015 20:12:25 +0000 (12:12 -0800)]
Add a section on recursive macros

9 years agostd: Move std::env to the new I/O APIs
Alex Crichton [Mon, 23 Feb 2015 18:59:17 +0000 (10:59 -0800)]
std: Move std::env to the new I/O APIs

This commit moves `std::env` away from the `std::old_io` error type as well as
the `std::old_path` module. Methods returning an error now return `io::Error`
and methods consuming or returning paths use `std::path` instead of
`std::old_path`. This commit does not yet mark these APIs as `#[stable]`.

This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with
essentially the exact same API. This type was added to interoperate with the new
path API and has its own `tempdir` feature.

Finally, this commit reverts the deprecation of `std::os` APIs returning the old
path API types. This deprecation can come back once the entire `std::old_path`
module is deprecated.

[breaking-change]

9 years agoImprove debug output from coherence.
Niko Matsakis [Mon, 23 Feb 2015 18:02:31 +0000 (13:02 -0500)]
Improve debug output from coherence.

9 years agoResolve regions too when normalizing param env.
Niko Matsakis [Fri, 20 Feb 2015 11:21:46 +0000 (06:21 -0500)]
Resolve regions too when normalizing param env.

9 years agoMake traits with assoc types invariant in their inputs.
Niko Matsakis [Fri, 20 Feb 2015 15:18:38 +0000 (10:18 -0500)]
Make traits with assoc types invariant in their inputs.

9 years agoChange `Debug` implementation of `BTree*` as well
Tobias Bucher [Tue, 10 Feb 2015 23:14:48 +0000 (00:14 +0100)]
Change `Debug` implementation of `BTree*` as well