]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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 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 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

9 years agoModify collection's `Debug` output to resemble in their content only
Tobias Bucher [Tue, 10 Feb 2015 21:12:13 +0000 (22:12 +0100)]
Modify collection's `Debug` output to resemble in their content only

9 years agoFix "How to submit a bug report" link
Raphael Nestler [Tue, 24 Feb 2015 22:26:25 +0000 (23:26 +0100)]
Fix "How to submit a bug report" link

According to #22650 and bb0bbf639eafdd79380a3b1e2e92263a2aa914f9 the
link changed

9 years agostd: Recomend threadpool on crates.io for TaskPool
Alex Crichton [Tue, 24 Feb 2015 22:24:15 +0000 (14:24 -0800)]
std: Recomend threadpool on crates.io for TaskPool

9 years agostd: Stabilize some `ptr` functions
Alex Crichton [Mon, 23 Feb 2015 19:39:16 +0000 (11:39 -0800)]
std: Stabilize some `ptr` functions

Specifically, the following actions were taken:

* 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.
* All type parameters now are `T: ?Sized` wherever possible and new clauses were
  added to the `offset` functions to require that the type is sized.

[breaking-change]

9 years agoRollup merge of #22778 - mzabaluev:leftover-lifetime, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:51:50 +0000 (03:21 +0530)]
Rollup merge of #22778 - mzabaluev:leftover-lifetime, r=alexcrichton

9 years agoRollup merge of #22736 - nikomatsakis:issue-22382, r=eddyb
Manish Goregaokar [Tue, 24 Feb 2015 21:51:43 +0000 (03:21 +0530)]
Rollup merge of #22736 - nikomatsakis:issue-22382, r=eddyb

 Apply borrowck to fns that appear in const declarations.
Fixes #22382.

r? @eddyb

9 years agoRollup merge of #22539 - oli-obk:style_nitpicks, r=Manishearth
Manish Goregaokar [Tue, 24 Feb 2015 21:51:37 +0000 (03:21 +0530)]
Rollup merge of #22539 - oli-obk:style_nitpicks, r=Manishearth

 I tried to follow [the style guide][1] as much as possible. This is just from some random readings of the code, so no guarantees on completeness, even in the edited files.

[1]: http://aturon.github.io/style/README.html

9 years agoRollup merge of #22458 - steveklabnik:try_in_error_chapter, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:51:30 +0000 (03:21 +0530)]
Rollup merge of #22458 - steveklabnik:try_in_error_chapter, r=alexcrichton

 Fixes #22342

9 years agoRollup merge of #22772 - tbu-:pr_panic_fail, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:51:24 +0000 (03:21 +0530)]
Rollup merge of #22772 - tbu-:pr_panic_fail, r=alexcrichton

9 years agoRollup merge of #22770 - vhbit:ios-rand-send, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:51:17 +0000 (03:21 +0530)]
Rollup merge of #22770 - vhbit:ios-rand-send, r=alexcrichton

   "body": null,

9 years agoRollup merge of #22758 - ejjeong:aarch64-linux-android, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:51:11 +0000 (03:21 +0530)]
Rollup merge of #22758 - ejjeong:aarch64-linux-android, r=alexcrichton

 This commit has already been merged in #21774,
but i think it has been accidently overriden by #22584 and #22480.
r? @alexcrichton

9 years agoRollup merge of #22752 - ipetkov:unsafe-lint-fix, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:51:05 +0000 (03:21 +0530)]
Rollup merge of #22752 - ipetkov:unsafe-lint-fix, r=alexcrichton

 This allows selectively disabling the lint for individual methods or traits.

9 years agoRollup merge of #22747 - krdln:fix-parsing-minus, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:50:58 +0000 (03:20 +0530)]
Rollup merge of #22747 - krdln:fix-parsing-minus, r=alexcrichton

 Makes Rust less amusing by fixing [#22745](https://github.com/rust-lang/rust/issues/22745)

9 years agoRollup merge of #22739 - tbu-:pr_error_net, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:50:51 +0000 (03:20 +0530)]
Rollup merge of #22739 - tbu-:pr_error_net, r=alexcrichton

 This affects the `set_non_blocking` function which cannot fail for Unix or
Windows, given correct parameters. Additionally, the short UDP write error case
has been removed as there is no such thing as \"short UDP writes\", instead, the
operating system will error out if the application tries to send a packet
larger than the MTU of the network path.

9 years agoRollup merge of #22623 - petrochenkov:optest, r=alexcrichton
Manish Goregaokar [Tue, 24 Feb 2015 21:50:42 +0000 (03:20 +0530)]
Rollup merge of #22623 - petrochenkov:optest, r=alexcrichton

 Tests often use `vec![1, 2, 3]` instead of shorter and faster `[1, 2, 3]`.
This patch removes a lot of unnecessary `vec!`s. Hopefully, the tests will compile and run a bit faster.

9 years agoMerge conflicts due to eddyb's UFCS branch
Niko Matsakis [Tue, 24 Feb 2015 21:27:02 +0000 (16:27 -0500)]
Merge conflicts due to eddyb's UFCS branch

9 years agoRemove two uses of old `[]` notation
Niko Matsakis [Tue, 24 Feb 2015 16:50:07 +0000 (11:50 -0500)]
Remove two uses of old `[]` notation

9 years agoMerge conflict: port default impls code
Niko Matsakis [Tue, 24 Feb 2015 16:49:50 +0000 (11:49 -0500)]
Merge conflict: port default impls code

9 years agoAdd handy switch `-Z treat-err-as-bug` -- it often happens that I am
Niko Matsakis [Wed, 18 Feb 2015 16:02:06 +0000 (11:02 -0500)]
Add handy switch `-Z treat-err-as-bug` -- it often happens that I am
compiling something I expect to succeed, and this lets me get
stacktraces and also abort compilation faster.

9 years agoRework trait-bound-conversion so be based on the AST and rework collect
Niko Matsakis [Wed, 18 Feb 2015 15:39:39 +0000 (10:39 -0500)]
Rework trait-bound-conversion so be based on the AST and rework collect
to pass in the appropriate ast::generics etc

9 years agoRemove bounds struct from TypeParameterDef. Bounds information is now
Niko Matsakis [Wed, 18 Feb 2015 16:50:51 +0000 (11:50 -0500)]
Remove bounds struct from TypeParameterDef. Bounds information is now
exclusively stored in the where clauses.

9 years agoRework the `get_type_parameter_bounds` impl to use a trait object
Niko Matsakis [Wed, 18 Feb 2015 01:46:26 +0000 (20:46 -0500)]
Rework the `get_type_parameter_bounds` impl to use a trait object
and act more generically.

9 years agoComprehence cycle detection in `collect`. In some cases, the cycles we
Niko Matsakis [Tue, 17 Feb 2015 22:11:01 +0000 (17:11 -0500)]
Comprehence cycle detection in `collect`. In some cases, the cycles we
report are not *necessary* cycles, but we'll work on refactoring them
over time. This overlaps with the cycle detection that astconv already
does: I left that code in because it gives a more targeted error
message, though perhaps less helpful in that it doesn't give the full
details of the cycle.

9 years agoConvert `astconv` to request bounds through the `AstConv` interface
Niko Matsakis [Tue, 17 Feb 2015 16:04:25 +0000 (11:04 -0500)]
Convert `astconv` to request bounds through the `AstConv` interface
rather than poking through the `TypeParameterDef` directly.

9 years agoChange collect to implement `AstConv` on a `ItemCtxt` rather than a
Niko Matsakis [Mon, 16 Feb 2015 20:48:31 +0000 (15:48 -0500)]
Change collect to implement `AstConv` on a `ItemCtxt` rather than a
global context. Have this `ItemCtxt` carry a (currently unused) pointer
to the in-scope generics.

9 years agoAuto merge of #22530 - rprichard:master, r=dotdash
bors [Tue, 24 Feb 2015 20:57:31 +0000 (20:57 +0000)]
Auto merge of #22530 - rprichard:master, r=dotdash

Fixes #22525

I wasn't sure if I should reuse `write::get_llvm_opt_level` or not.  It returns an `llvm::CodeGenOptLevel`, which is the Rust binding for `CodeGenOpt::Level`. `lto.rs` is passing an optlevel to LLVM's `PassManagerBuilder`, which takes an unsigned int.  `PassManagerBuilder`'s optlevel uses essentially the same enumeration (i.e. 0-3 with 2 as default), but it's implicit.

9 years agoFix broken tests
Vadim Petrochenkov [Tue, 24 Feb 2015 20:42:09 +0000 (23:42 +0300)]
Fix broken tests

9 years agoUse arrays instead of vectors in tests
Vadim Petrochenkov [Tue, 24 Feb 2015 18:15:45 +0000 (21:15 +0300)]
Use arrays instead of vectors in tests

9 years agoAuto merge of #22172 - eddyb:almost-there, r=nikomatsakis
bors [Tue, 24 Feb 2015 17:56:09 +0000 (17:56 +0000)]
Auto merge of #22172 - eddyb:almost-there, r=nikomatsakis

Adds `<module::Type>::method` support and makes `module::Type::method` a shorthand for it.
This is most of #16293, except that chaining multiple associated types is not yet supported.
It also fixes #22563 as `impl`s are no longer treated as modules in resolve.

Unfortunately, this is still a *[breaking-change]*:
* If you used a global path to a primitive type, i.e. `::bool`, `::i32` etc. - that was a bug I had to fix.
Solution: remove the leading `::`.
* If you passed explicit `impl`-side type parameters to an inherent method, e.g.:
```rust
struct Foo<T>(T);
impl<A, B> Foo<(A, B)> {
    fn pair(a: A, b: B) -> Foo<(A, B)> { Foo((a, b)) }
}
Foo::<A, B>::pair(a, b)
// Now that is sugar for:
<Foo<A, B>>::pair(a, b)
// Which isn't valid because `Foo` has only one type parameter.
// Solution: replace with:
Foo::<(A, B)>::pair(a, b)
// And, if possible, remove the explicit type param entirely:
Foo::pair(a, b)
```
* If you used the `QPath`-related `AstBuilder` methods @hugwijst added in #21943.
The methods still exist, but `QPath` was replaced by `QSelf`, with the actual path stored separately.
Solution: unpack the pair returned by `cx.qpath` to get the two arguments for `cx.expr_qpath`.