Commit Graph

39810 Commits

Author SHA1 Message Date
Tshepang Lekhonkhobe
6b01f7ac05 doc: the last mention of the word 'iterator' is redundant 2015-02-26 23:23:02 +02:00
Dave Huseby
804c071d8b fixing a few bitrig build breakers 2015-02-26 13:03:06 -08:00
Valerii Hiora
d0bb57cfc3 Fixed build with jemalloc disabled 2015-02-26 20:27:53 +02:00
Kang Seonghoon
587f10aa36 Makes the picky tidy satisfied. Also refers to the correct issue. 2015-02-27 01:30:55 +09:00
Kang Seonghoon
3b8f8b8300 Removed an excess feature flag from the backtrace test. 2015-02-27 01:26:06 +09:00
Kang Seonghoon
bdd31b38aa 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.
2015-02-27 01:12:22 +09:00
bors
a5214e4330 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
2015-02-26 15:43:38 +00:00
Seo Sanghyeon
695846331b Add a rustdoc test for default methods in external crates 2015-02-27 00:28:57 +09:00
Seo Sanghyeon
5e1d4fffff Add a way to assert the number of occurrences to htmldocck 2015-02-27 00:27:57 +09:00
Eduard Burtescu
704ce1d735 Revert hacks and add test for LLVM aborts due to empty aggregates.
Closes #21721.
2015-02-26 16:44:07 +02:00
Felix S. Klock II
9a6e3b900f Add doc to core::intrinsics pointing out conservativeness of needs_drop. 2015-02-26 15:12:27 +01:00
Felix S. Klock II
4e334d6141 Regression test for #22536. 2015-02-26 15:12:27 +01:00
Felix S. Klock II
5e4867eef1 Use more precise type_needs_drop for deciding about emitting cleanup code.
Fix #22536
2015-02-26 15:12:26 +01:00
Felix S. Klock II
2d0e6caeec Add push_ctxt instrumentation to all functions that might call base::zero_mem.
(Instrumentation work for Issue 22536.)
2015-02-26 15:12:26 +01:00
Angus Lees
4b00e87103 Standardize manpage markup
Use consistent markup between rust and rustdoc manpages.  Avoid use of
the troublesome unquoted '-' troff character.
2015-02-26 09:39:27 +00:00
Lai Jiangshan
9cdb2568ca 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>
2015-02-26 17:38:21 +08:00
bors
3a96d6a981 Auto merge of #22827 - sfackler:should_panic_pt1, r=alexcrichton
This needs to make it into the snapshot before #21824 can land.

r? @alexcrichton
2015-02-26 09:23:36 +00:00
nwin
36ba96ea3c Implement Debug for RwLock, arc::Weak and Mutex 2015-02-26 10:18:13 +01:00
Edward Wang
68490068e0 Send/Sync audit for libcollections
In the process, also replaces a raw mutable pointers with Unique to
spell out the ownership semantics.

cc #22709
2015-02-26 15:43:40 +08:00
bors
41f8b1e89b 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
2015-02-26 07:01:18 +00:00
Steven Fackler
c3b77ab41c Whitelist #[should_panic] 2015-02-25 22:04:00 -08:00
Edward Wang
101498cd88 Tweak VecDeque's IterMut implementation
So it is symmetric to its `Iter` implementation. Also kills an FIXME.
2015-02-26 13:48:09 +08:00
Huon Wilson
eafdc7135b 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
2015-02-26 16:26:34 +11:00
Huon Wilson
19cb8f32d8 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.
2015-02-26 16:26:34 +11:00
Tshepang Lekhonkhobe
8b2ff472cf remove some compiler warnings 2015-02-26 07:21:26 +02:00
Sébastien Marie
653ceee3b3 path -> PathBuf for openbsd/bitrig 2015-02-26 06:16:41 +01:00
Alexander Bliskovsky
f618e2e1ec Changed prose to assert_eq! macro. 2015-02-25 20:29:13 -05:00
Alexander Bliskovsky
65b0655230 Added documentation of backslash ending string literals.
Closes #22698
2015-02-25 20:26:24 -05:00
Keegan McAllister
65ea9110bd 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. :)
2015-02-25 17:13:16 -08:00
bors
610d1695d1 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
2015-02-25 23:08:53 +00:00
Vadim Chugunov
5dd001b2fc Fix overflow in precise_time_ns() on Windows,
which starts happening after ~2 hours of machine uptime.
2015-02-25 15:02:43 -08:00
Cody P Schafer
07dc8d67c9 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.
2015-02-25 17:38:28 -05:00
bors
4db0b32467 Auto merge of #22796 - Manishearth:rollup, r=Manishearth 2015-02-25 20:32:58 +00:00
Jorge Aparicio
2de7a7c9ba impl IntoCow for Path[Buf] 2015-02-25 12:34:50 -05:00
Niko Matsakis
7074346e4f Change MarkerTrait to be invariant. This is a (small) loss of expressiveness,
but is necessary for now to work around #22806. Fixes #22655.
2015-02-25 12:21:15 -05:00
Manish Goregaokar
357b41bfcf Path -> PathBuf for Windows test (fixup #22727) 2015-02-25 19:52:42 +05:30
Manish Goregaokar
d54ed567e0 path -> PathBuf for osx/dragonfly (fixup #22727) 2015-02-25 15:21:58 +05:30
Manish Goregaokar
2470fa155e Assert is internal now (fixup #22739) 2015-02-25 14:11:37 +05:30
Manish Goregaokar
e61a790495 Fix type inference error (fixup #22739) 2015-02-25 13:58:58 +05:30
Manish Goregaokar
9f8a1cb38d Use os::getcwd instead of env in rustbook (fixup #22727) 2015-02-25 12:48:14 +05:30
Manish Goregaokar
f8e4fcb38c allow(deprecated) for TaskPool (fixup #22783) 2015-02-25 11:45:06 +05:30
Alex Crichton
18878b155e std: Require &mut self for Iterator::all
Keeps the method consistent with `Iterator::any`.

Closes #22617
[breaking-change]
2015-02-24 22:04:21 -08:00
Manish Goregaokar
f164254392 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
2015-02-25 10:30:12 +05:30
Manish Goregaokar
1f2b3ebd7b 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
2015-02-25 10:30:01 +05:30
Manish Goregaokar
ecaf74ab3b 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
2015-02-25 10:29:53 +05:30
Manish Goregaokar
6c6f2317ba 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]
2015-02-25 10:29:46 +05:30
Manish Goregaokar
b18584cbd9 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]
2015-02-25 10:29:39 +05:30
Manish Goregaokar
7b7cf84975 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.
2015-02-25 10:29:32 +05:30
Manish Goregaokar
c950ee93c9 Rollup merge of #22157 - tbu-:pr_debug_collections, r=alexcrichton
r? @Gankro
2015-02-25 10:29:23 +05:30
Manish Goregaokar
1c97ac3d12 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 ?
2015-02-25 10:27:30 +05:30