Commit Graph

39193 Commits

Author SHA1 Message Date
Manish Goregaokar
6a97fbab4b 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
2015-02-27 20:37:37 +05:30
Manish Goregaokar
5d4e01766b 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.
2015-02-27 20:37:36 +05:30
bors
bd0d8e47e5 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.
2015-02-27 10:35:51 +00:00
bors
bd27985457 Auto merge of #22853 - FlaPer87:snap, r=alexcrichton
r? @alexcrichton
 
cc @nikomatsakis @pnkfelix
2015-02-27 07:46:15 +00:00
bors
dd077d5dec 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
2015-02-27 05:21:05 +00:00
Alex Crichton
c2400bb269 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
2015-02-26 19:04:42 -08:00
bors
e5cd6534c1 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.
2015-02-27 02:58:15 +00:00
Huon Wilson
060661d2b4 Add some missing stability attributes on struct fields. 2015-02-27 12:52:43 +11:00
Flavio Percoco
9d0d72345d register snapshot 880fb89 2015-02-27 01:48:49 +01:00
bors
b47aebe3fc 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 ?
2015-02-26 23:04:03 +00: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
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
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
Sébastien Marie
653ceee3b3 path -> PathBuf for openbsd/bitrig 2015-02-26 06:16:41 +01: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
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
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
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
Manish Goregaokar
3a49c3bd9c 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
2015-02-25 10:27:24 +05:30
Manish Goregaokar
267c5873e2 Rollup merge of #22784 - rnestler:fix_doc_faq, r=dotdash
According to #22650 and bb0bbf639e the
link changed.
I think this should fix the link on http://doc.rust-lang.org/#faqs
2015-02-25 10:27:17 +05:30
Manish Goregaokar
24fc50d295 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]
2015-02-25 10:27:11 +05:30
Manish Goregaokar
9692f3bc94 Rollup merge of #22635 - kmcallister:macros-chapter, r=steveklabnik
r? @steveklabnik
2015-02-25 10:27:03 +05:30
bors
880fb89bde 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
2015-02-25 04:28:23 +00:00
Sébastien Marie
91e00f3bfa unbreak openbsd after nacl intergration 2015-02-25 05:07:40 +01:00
Felix S. Klock II
5d7e283ead Turn unsafe_no_drop_flag back into a gated-feature.
Fix #22173
2015-02-25 01:35:41 +01:00