]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #23749: alexcrichton/remove-old-impl-check
Alex Crichton [Fri, 27 Mar 2015 17:10:38 +0000 (10:10 -0700)]
rollup merge of #23749: alexcrichton/remove-old-impl-check

Conflicts:
src/libsyntax/feature_gate.rs

9 years agorollup merge of #23741: alexcrichton/remove-int-uint
Alex Crichton [Fri, 27 Mar 2015 17:10:05 +0000 (10:10 -0700)]
rollup merge of #23741: alexcrichton/remove-int-uint

Conflicts:
src/librustc/middle/ty.rs
src/librustc_trans/trans/adt.rs
src/librustc_typeck/check/mod.rs
src/libserialize/json.rs
src/test/run-pass/spawn-fn.rs

9 years agorollup merge of #23738: alexcrichton/snapshots
Alex Crichton [Fri, 27 Mar 2015 17:08:40 +0000 (10:08 -0700)]
rollup merge of #23738: alexcrichton/snapshots

Conflicts:
src/libcollections/vec.rs

9 years agorollup merge of #23780: ruud-v-a/wrapping
Alex Crichton [Fri, 27 Mar 2015 17:07:54 +0000 (10:07 -0700)]
rollup merge of #23780: ruud-v-a/wrapping

This allows `Wrapping<T>` to be used in `assert_eq!`, for example.

One of the tests (compile-fail/xc-private-method.rs) fails, but I can hardly imagine it is related to this change. I would also like to add a tests to ensure that `assert_eq!` compiles and keeps working in the future for `Wrapped<T>` values, but there appear to be no tests in libcore. What would be a good place to add such a test?

9 years agorollup merge of #23776: nrc/allow_trivial_cast
Alex Crichton [Fri, 27 Mar 2015 17:07:54 +0000 (10:07 -0700)]
rollup merge of #23776: nrc/allow_trivial_cast

r? @alexcrichton

9 years agorollup merge of #23775: alexcrichton/fix-flaky-test
Alex Crichton [Fri, 27 Mar 2015 17:07:53 +0000 (10:07 -0700)]
rollup merge of #23775: alexcrichton/fix-flaky-test

Windows gets quite unhappy when a thread fails while the main thread is exiting,
frequently leading to process deadlock. This has been causing quite a few
deadlocks on the windows bots recently. The child threads are presumably failing
because the `println!` is failing due to the main thread being shut down.

9 years agorollup merge of #23771: aturon/stab-straggle-1
Alex Crichton [Fri, 27 Mar 2015 17:07:52 +0000 (10:07 -0700)]
rollup merge of #23771: aturon/stab-straggle-1

Marks as `#[stable}`:

* `ok_or`
* `ok_or_else`
* `iter_mut`
* `cloned`

Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to
work only on `Option<&T>`. Thus, this is a:

[breaking-change]

r? @alexcrichton

9 years agorollup merge of #23769: alexcrichton/stabilize-split
Alex Crichton [Fri, 27 Mar 2015 17:07:51 +0000 (10:07 -0700)]
rollup merge of #23769: alexcrichton/stabilize-split

Now that `<[_]>::split` is an inherent method, it will trump `BufRead::split`
when `BufRead` is in scope, so there is no longer a conflict. As a result,
calling `slice.split()` will probably always give you precisely what you want!

9 years agorollup merge of #23767: tshepang/typo
Alex Crichton [Fri, 27 Mar 2015 17:07:51 +0000 (10:07 -0700)]
rollup merge of #23767: tshepang/typo

9 years agorollup merge of #23765: alexcrichton/remove-colon-syntax
Alex Crichton [Fri, 27 Mar 2015 17:07:50 +0000 (10:07 -0700)]
rollup merge of #23765: alexcrichton/remove-colon-syntax

This syntax has been renamed to `-l static=foo` some time ago.

9 years agorollup merge of #23764: tshepang/no-guessing-anymore
Alex Crichton [Fri, 27 Mar 2015 17:07:50 +0000 (10:07 -0700)]
rollup merge of #23764: tshepang/no-guessing-anymore

9 years agorollup merge of #23761: alexcrichton/remove-phase
Alex Crichton [Fri, 27 Mar 2015 17:07:49 +0000 (10:07 -0700)]
rollup merge of #23761: alexcrichton/remove-phase

This commit removes the extra deprecation warnings and support for the old
`phase` and `plugin` attributes for loading plugins.

9 years agorollup merge of #23753: aturon/revise-convert
Alex Crichton [Fri, 27 Mar 2015 17:07:49 +0000 (10:07 -0700)]
rollup merge of #23753: aturon/revise-convert

This commit revises `path` and `os_str` to use blanket impls for `From`
on reference types. This both cuts down on the number of required impls,
and means that you can pass through e.g. `T: AsRef<OsStr>` to
`PathBuf::from` without an intermediate call to `as_ref`.

It also makes a FIXME note for later generalizing the blanket impls for
`AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do
so.

9 years agorollup merge of #23752: alexcrichton/remove-should-fail
Alex Crichton [Fri, 27 Mar 2015 17:07:48 +0000 (10:07 -0700)]
rollup merge of #23752: alexcrichton/remove-should-fail

This attribute has been deprecated in favor of #[should_panic]. This also
updates rustdoc to no longer accept the `should_fail` directive and instead
renames it to `should_panic`.

9 years agorollup merge of #23750: murarth/ipaddr-fromstr
Alex Crichton [Fri, 27 Mar 2015 17:07:48 +0000 (10:07 -0700)]
rollup merge of #23750: murarth/ipaddr-fromstr

9 years agorollup merge of #23747: tshepang/misleading-info
Alex Crichton [Fri, 27 Mar 2015 17:07:47 +0000 (10:07 -0700)]
rollup merge of #23747: tshepang/misleading-info

The first sentence was not compatible with the second.

9 years agorollup merge of #23745: oneeman/trpl-looping
Alex Crichton [Fri, 27 Mar 2015 17:07:47 +0000 (10:07 -0700)]
rollup merge of #23745: oneeman/trpl-looping

Was reading the 'Looping' section of the book and was puzzled why the last example uses `0u32..10` when the others don't.  Tried it out without and it seems to work, so I figured it should just be `0..10`.  If there is a reason it needs to be `0u32..10` it should be explained in the text (I'd offer to do it but I have no idea).

r? @steveklabnik

9 years agorollup merge of #23743: Adenilson/addInfoArcClone01
Alex Crichton [Fri, 27 Mar 2015 17:07:47 +0000 (10:07 -0700)]
rollup merge of #23743: Adenilson/addInfoArcClone01

Adding more information about the behavior of Arc/Rc when you perform a clone() call.

9 years agorollup merge of #23740: alexcrichton/remove-deprecated-slicing-syntax
Alex Crichton [Fri, 27 Mar 2015 17:07:45 +0000 (10:07 -0700)]
rollup merge of #23740: alexcrichton/remove-deprecated-slicing-syntax

This syntax has been deprecated for quite some time, and there were only a few
remaining uses of it in the codebase anyway.

9 years agorollup merge of #23736: gmjosack/master
Alex Crichton [Fri, 27 Mar 2015 17:07:45 +0000 (10:07 -0700)]
rollup merge of #23736: gmjosack/master

Found a few 404s that seemed like simple fixes:

In footer.inc, certain 404 pages were 404ing on the request to jquery.js and playpen.js. This is easily demonstrated by visiting http://doc.rust-lang.org/foo then http://doc.rust-lang.org/foo/bar. The latter 404s, looking for foo/jquery.js.

The Result docs use old_io Writer as an example. Fix the link to old_io Writer. There's probably an effort to update the example away from a deprecated api but this was a simple fix.

rustc/plugin was pointing at the old guide and it was a broken link anyways (plugin vs plugins). Point at the book instead.

The main page of the API docs referenced c_{str,vec}. Looks like these were deleted in 25d5a3a19423fee01787de87a56d185dd4e0a4e7. Point at ffi docs instead.

9 years agorollup merge of #23725: tamird/test-with-ios
Alex Crichton [Fri, 27 Mar 2015 17:07:44 +0000 (10:07 -0700)]
rollup merge of #23725: tamird/test-with-ios

r? @alexcrichton this should allow `make check` to run when `./configure`d for iOS cross-compilation

9 years agorollup merge of #23721: erickt/deprecate
Alex Crichton [Fri, 27 Mar 2015 17:07:44 +0000 (10:07 -0700)]
rollup merge of #23721: erickt/deprecate

This is technically a breaking change as it deprecates and unstables some previously stable apis that were missed in the last round of deprecations.

[breaking change]

9 years agorollup merge of #23719: steveklabnik/unstable_book
Alex Crichton [Fri, 27 Mar 2015 17:07:44 +0000 (10:07 -0700)]
rollup merge of #23719: steveklabnik/unstable_book

Now that feature flags are only on nightly, it's good to split this stuff out.

9 years agorollup merge of #23712: nikomatsakis/reflect-trait
Alex Crichton [Fri, 27 Mar 2015 17:07:43 +0000 (10:07 -0700)]
rollup merge of #23712: nikomatsakis/reflect-trait

This PR introduces a `Reflect` marker trait which is a supertrait of `Any`. The idea is that `Reflect` is defined for all concrete types, but is not defined for type parameters unless there is a `T:Reflect` bound. This is intended to preserve the parametricity property. This allows the `Any` interface to be stabilized without committing us to unbounded reflection that is not easily detectable by the caller.

The implementation of `Reflect` relies on an experimental variant of OIBIT. This variant behaves differently for objects, since it requires that all types exposed as part of the object's *interface* are `Reflect`, but isn't concerned about other types that may be closed over. In other words, you don't have to write `Foo+Reflect` in order for `Foo: Reflect` to hold (where `Foo` is a trait).

Given that `Any` is slated to stabilization and hence that we are committed to some form of reflection, the goal of this PR is to leave our options open with respect to parametricity. I see the options for full stabilization as follows (I think an RFC would be an appropriate way to confirm whichever of these three routes we take):

1. We make `Reflect` a lang-item.
2. We stabilize some version of the OIBIT variation I implemented as a general mechanism that may be appropriate for other use cases.
3. We give up on preserving parametricity here and just have `impl<T> Reflect for T` instead. In that case, `Reflect` is a harmless but not especially useful trait going forward.

cc @aturon
cc @alexcrichton
cc @glaebhoerl (this is more-or-less your proposal, as I understood it)
cc @reem (this is more-or-less what we discussed on IRC at some point)
cc @FlaPer87 (vaguely pertains to OIBIT)

9 years agorollup merge of #23690: wettowelreactor/patch-1
Alex Crichton [Fri, 27 Mar 2015 17:07:42 +0000 (10:07 -0700)]
rollup merge of #23690: wettowelreactor/patch-1

9 years agorollup merge of #23676: gkoz/array_as_ref
Alex Crichton [Fri, 27 Mar 2015 17:07:42 +0000 (10:07 -0700)]
rollup merge of #23676: gkoz/array_as_ref

r? @aturon

9 years agorollup merge of #23651: alexcrichton/unwind-try
Alex Crichton [Fri, 27 Mar 2015 17:07:42 +0000 (10:07 -0700)]
rollup merge of #23651: alexcrichton/unwind-try

This commit provides a safe, but unstable interface for the `try` functionality
of running a closure and determining whether it panicked or not.

There are two primary reasons that this function was previously marked `unsafe`:

1. A vanilla version of this function exposes the problem of exception safety by
   allowing a bare try/catch in the language. It is not clear whether this
   concern should be directly tied to `unsafe` in Rust at the API level. At this
   time, however, the bounds on `ffi::try` require the closure to be both
   `'static` and `Send` (mirroring those of `thread::spawn`). It may be possible
   to relax the bounds in the future, but for now it's the level of safety that
   we're willing to commit to.

2. Panicking while panicking will leak resources by not running destructors.
   Because panicking is still controlled by the standard library, safeguards
   remain in place to prevent this from happening.

The new API is now called `catch_panic` and is marked as `#[unstable]` for now.

9 years agorollup merge of #23625: fhahn/issue-23620-ice-unicode-bytestring
Alex Crichton [Fri, 27 Mar 2015 17:07:41 +0000 (10:07 -0700)]
rollup merge of #23625: fhahn/issue-23620-ice-unicode-bytestring

closes #23620

This PR patches the issue mentioned in #23620, but there is also an ICE for invalid escape sequences in byte literals. This is due to the fact that the `scan_byte` function returns ` token::intern("??") ` for invalid bytes, resulting in an ICE later on. Is there a reason for this behavior? Shouldn't `scan_byte` fail when it encounters an invalid byte?

And I noticed a small inconsistency in the documentation. According to the formal byte literal definition in http://doc.rust-lang.org/reference.html#byte-and-byte-string-literals , a byte string literal contains `string_body *`, but according to the text (and the behavior of the lexer) it should not accept unicode escape sequences. Hence it should be replaced by `byte_body *`. If this is valid, I can add this fix to this PR.

9 years agorollup merge of #23535: pnkfelix/fsk-filling-drop
Alex Crichton [Fri, 27 Mar 2015 17:07:41 +0000 (10:07 -0700)]
rollup merge of #23535: pnkfelix/fsk-filling-drop

Replace zeroing-on-drop with filling-on-drop.

This is meant to set the stage for removing *all* zeroing and filling (on drop) in the future.

Note that the code is meant to be entirely abstract with respect to the particular values used for the drop flags: the final commit demonstrates how to go from zeroing-on-drop to filling-on-drop by changing the value of three constants (in two files).

See further discussion on the internals thread:
  http://internals.rust-lang.org/t/attention-hackers-filling-drop/1715/11

[breaking-change] especially for structs / enums using `#[unsafe_no_drop_flag]`.

9 years agorollup merge of #23419: murarth/lookup-addr
Alex Crichton [Fri, 27 Mar 2015 17:07:40 +0000 (10:07 -0700)]
rollup merge of #23419: murarth/lookup-addr

Closes #22608

9 years agoalloc: Don't run some Arc doc tests
Alex Crichton [Fri, 27 Mar 2015 05:11:50 +0000 (22:11 -0700)]
alloc: Don't run some Arc doc tests

Windows gets quite unhappy when a thread fails while the main thread is exiting,
frequently leading to process deadlock. This has been causing quite a few
deadlocks on the windows bots recently. The child threads are presumably failing
because the `println!` is failing due to the main thread being shut down.

9 years agoPrevent ICEs when parsing invalid escapes, closes #23620
Florian Hahn [Thu, 26 Mar 2015 08:38:25 +0000 (09:38 +0100)]
Prevent ICEs when parsing invalid escapes, closes #23620

9 years agoAuto merge of #22930 - Gankro:entry_3, r=aturon
bors [Fri, 27 Mar 2015 12:55:23 +0000 (12:55 +0000)]
Auto merge of #22930 - Gankro:entry_3, r=aturon

RFC pending, but this is the patch that does it.

Totally untested. Likely needs some removed imports. std::collections docs should also be updated to provide better examples.

Closes #23508

9 years agodefault => or_insert per RFC
Alexis Beingessner [Fri, 20 Mar 2015 17:43:01 +0000 (13:43 -0400)]
default => or_insert per RFC

9 years agonum: Derive Debug for Wrapping
Ruud van Asseldonk [Fri, 27 Mar 2015 09:16:13 +0000 (10:16 +0100)]
num: Derive Debug for Wrapping

This allows `Wrapping<T>` to be used in `assert_eq!`, for example.

9 years agoChange the trivial cast lints to allow by default
Nick Cameron [Fri, 27 Mar 2015 05:41:18 +0000 (18:41 +1300)]
Change the trivial cast lints to allow by default

9 years agoupdate everything to use Entry defaults
Alexis [Sun, 1 Mar 2015 14:42:11 +0000 (09:42 -0500)]
update everything to use Entry defaults

9 years agoentry API v3: replace Entry::get with Entry::default and Entry::default_with
Alexis [Sun, 1 Mar 2015 14:50:08 +0000 (09:50 -0500)]
entry API v3: replace Entry::get with Entry::default and Entry::default_with

9 years agoFix doc tests.
Niko Matsakis [Fri, 27 Mar 2015 01:12:52 +0000 (21:12 -0400)]
Fix doc tests.

9 years agoStabilize some stragglers in `std::option`
Aaron Turon [Fri, 27 Mar 2015 00:47:13 +0000 (17:47 -0700)]
Stabilize some stragglers in `std::option`

Marks as `#[stable}`:

* `ok_or`
* `ok_or_else`
* `iter_mut`
* `cloned`

Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to
work only on `Option<&T>`. Thus, this is a:

[breaking-change]

9 years agoAdd `std::net::lookup_addr` for reverse DNS lookup
Murarth [Mon, 16 Mar 2015 20:04:31 +0000 (13:04 -0700)]
Add `std::net::lookup_addr` for reverse DNS lookup

Closes #22608

9 years agoworkaround pretty-print bugs to placate `make check-pretty`.
Felix S. Klock II [Fri, 27 Mar 2015 00:07:27 +0000 (01:07 +0100)]
workaround pretty-print bugs to placate `make check-pretty`.

9 years agostd: Stabilize BufRead::split
Alex Crichton [Thu, 26 Mar 2015 23:54:15 +0000 (16:54 -0700)]
std: Stabilize BufRead::split

Now that `<[_]>::split` is an inherent method, it will trump `BufRead::split`
when `BufRead` is in scope, so there is no longer a conflict. As a result,
calling `slice.split()` will probably always give you precisely what you want!

9 years agobook: fix typo
Tshepang Lekhonkhobe [Thu, 26 Mar 2015 23:44:03 +0000 (01:44 +0200)]
book: fix typo

9 years agorustc: Remove support for `-l foo:static`
Alex Crichton [Thu, 26 Mar 2015 23:34:05 +0000 (16:34 -0700)]
rustc: Remove support for `-l foo:static`

This syntax has been renamed to `-l static=foo` some time ago.

9 years agobook: there is no guessing game anymore, so remove references to it
Tshepang Lekhonkhobe [Thu, 26 Mar 2015 23:35:50 +0000 (01:35 +0200)]
book: there is no guessing game anymore, so remove references to it

9 years agorustc: Remove old #[phase] and #[plugin]
Alex Crichton [Thu, 26 Mar 2015 22:10:31 +0000 (15:10 -0700)]
rustc: Remove old #[phase] and #[plugin]

This commit removes the extra deprecation warnings and support for the old
`phase` and `plugin` attributes for loading plugins.

9 years agoRefactor object-safety test to use def-ids only
Niko Matsakis [Thu, 26 Mar 2015 19:51:11 +0000 (15:51 -0400)]
Refactor object-safety test to use def-ids only

9 years agoRefactor how binders are handled in trait selection
Niko Matsakis [Thu, 26 Mar 2015 19:53:00 +0000 (15:53 -0400)]
Refactor how binders are handled in trait selection

9 years agoDrive-by fix for incorrect variance rule that I noticed.
Niko Matsakis [Wed, 25 Mar 2015 14:42:38 +0000 (10:42 -0400)]
Drive-by fix for incorrect variance rule that I noticed.

9 years agoImplement `Reflect` trait with a variant on the standard OIBIT
Niko Matsakis [Tue, 24 Mar 2015 19:55:29 +0000 (15:55 -0400)]
Implement `Reflect` trait with a variant on the standard OIBIT
semantics that tests the *interface* of trait objects, rather
than what they close over.

9 years agoUpdate docs to fix various 404s
Gary M. Josack [Thu, 26 Mar 2015 16:31:48 +0000 (09:31 -0700)]
Update docs to fix various 404s

Found a few 404s that seemed like simple fixes:

The Result docs use old_io Writer as an example. Fix the link to old_io Writer. There's probably an effort to update the example away from a deprecated api but this was a simple fix.

rustc/plugin was pointing at the old guide and it was a broken link anyways (plugin vs plugins). Point at the book instead.

The main page of the API docs referenced c_{str,vec}. Looks like these were deleted in 25d5a3a19423fee01787de87a56d185dd4e0a4e7. Point at ffi docs instead.

9 years agoRevise use of conversion traits
Aaron Turon [Thu, 26 Mar 2015 20:39:23 +0000 (13:39 -0700)]
Revise use of conversion traits

This commit revises `path` and `os_str` to use blanket impls for `From`
on reference types. This both cuts down on the number of required impls,
and means that you can pass through e.g. `T: AsRef<OsStr>` to
`PathBuf::from` without an intermediate call to `as_ref`.

It also makes a FIXME note for later generalizing the blanket impls for
`AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do
so.

9 years agosyntax: Remove support for #[should_fail]
Alex Crichton [Thu, 26 Mar 2015 20:30:33 +0000 (13:30 -0700)]
syntax: Remove support for #[should_fail]

This attribute has been deprecated in favor of #[should_panic]. This also
updates rustdoc to no longer accept the `should_fail` directive and instead
renames it to `should_panic`.

9 years agoimpl `FromStr` for `IpAddr`
Murarth [Thu, 26 Mar 2015 20:31:37 +0000 (13:31 -0700)]
impl `FromStr` for `IpAddr`

9 years agorustc: Remove support for old_impl_check
Alex Crichton [Thu, 26 Mar 2015 20:25:06 +0000 (13:25 -0700)]
rustc: Remove support for old_impl_check

This commit removes compiler support for the `old_impl_check` attribute which
should in theory be entirely removed now. The last remaining use of it in the
standard library has been updated by moving the type parameter on the
`old_io::Acceptor` trait into an associated type. As a result, this is a
breaking change for all current users of the deprecated `old_io::Acceptor`
trait. Code can be migrated by using the `Connection` associated type instead.

[breaking-change]

9 years agobook: make it one sentence
Tshepang Lekhonkhobe [Thu, 26 Mar 2015 20:02:45 +0000 (22:02 +0200)]
book: make it one sentence

9 years agodoc: change 0u32..10 to 0..10
Or Neeman [Thu, 26 Mar 2015 19:24:20 +0000 (13:24 -0600)]
doc: change 0u32..10 to 0..10

9 years agoMass rename uint/int to usize/isize
Alex Crichton [Thu, 26 Mar 2015 00:06:52 +0000 (17:06 -0700)]
Mass rename uint/int to usize/isize

Now that support has been removed, all lingering use cases are renamed.

9 years agoAdding more information about the behavior of Arc/Rc
Adenilson Cavalcanti [Thu, 26 Mar 2015 19:05:21 +0000 (12:05 -0700)]
Adding more information about the behavior of Arc/Rc
when you perform a clone() call.

9 years agoAuto merge of #23359 - erickt:quote, r=pnkfelix
bors [Thu, 26 Mar 2015 18:43:56 +0000 (18:43 +0000)]
Auto merge of #23359 - erickt:quote, r=pnkfelix

This PR allows the quote macros to unquote trait items, impl items, where clauses, and paths.

9 years agoadd feature flags required post rebase.
Felix S. Klock II [Thu, 26 Mar 2015 18:31:53 +0000 (19:31 +0100)]
add feature flags required post rebase.

9 years agosyntax: Remove parsing of old slice syntax
Alex Crichton [Thu, 26 Mar 2015 16:57:58 +0000 (09:57 -0700)]
syntax: Remove parsing of old slice syntax

This syntax has been deprecated for quite some time, and there were only a few
remaining uses of it in the codebase anyway.

9 years agoRegister new snapshots
Alex Crichton [Wed, 25 Mar 2015 01:13:54 +0000 (18:13 -0700)]
Register new snapshots

9 years agoAuto merge of #23680 - erickt:inline, r=cmr
bors [Thu, 26 Mar 2015 16:10:23 +0000 (16:10 +0000)]
Auto merge of #23680 - erickt:inline, r=cmr

before:

test bench_read_slice  ... bench:        68 ns/iter (+/- 56)
test bench_read_vec    ... bench:        78 ns/iter (+/- 21)
test bench_write_slice ... bench:       133 ns/iter (+/- 46)
test bench_write_vec   ... bench:       308 ns/iter (+/- 69)

after:

test bench_read_slice  ... bench:        32 ns/iter (+/- 10)
test bench_read_vec    ... bench:        32 ns/iter (+/- 8)
test bench_write_slice ... bench:        53 ns/iter (+/- 12)
test bench_write_vec   ... bench:       247 ns/iter (+/- 172)

9 years agoNew section of the book: nightly rust
Steve Klabnik [Wed, 25 Mar 2015 22:35:51 +0000 (18:35 -0400)]
New section of the book: nightly rust

Now that feature flags are only on nightly, it's good to split this stuff out.

9 years agoDeprecate as_mut_slice methods
Erick Tryzelaar [Thu, 26 Mar 2015 14:29:06 +0000 (07:29 -0700)]
Deprecate as_mut_slice methods

This is technically a breaking change as it deprecates and unstables
some previously stable apis that were missed in the last round of
deprecations.

[breaking change]

9 years agoAuto merge of #21237 - erickt:derive-assoc-types, r=erickt
bors [Thu, 26 Mar 2015 13:38:41 +0000 (13:38 +0000)]
Auto merge of #21237 - erickt:derive-assoc-types, r=erickt

This PR adds support for associated types to the `#[derive(...)]` syntax extension. In order to do this, it switches over to using where predicates to apply the type constraints. So now this:

```rust
type Trait {
    type Type;
}

#[derive(Clone)]
struct Foo<A> where A: Trait {
    a: A,
    b: <A as Trait>::Type,
}
```

Gets expended into this impl:

```rust
impl<A: Clone> Clone for Foo<A> where
    A: Trait,
    <A as Trait>::Type: Clone,
{
    fn clone(&self) -> Foo<T> {
        Foo {
            a: self.a.clone(),
            b: self.b.clone(),
        }
    }
}
```

9 years agoAdd tests exercising the dropflag checking functionality.
Felix S. Klock II [Wed, 25 Mar 2015 15:49:21 +0000 (16:49 +0100)]
Add tests exercising the dropflag checking functionality.

9 years agoUse `-Z force-dropflag-checks=on/off` for emitting sanity-check.
Felix S. Klock II [Wed, 25 Mar 2015 10:57:55 +0000 (11:57 +0100)]
Use `-Z force-dropflag-checks=on/off` for emitting sanity-check.

(That is, added config and debugflag a la check-overflow but for drop
flag sanity-check.)

Remove now-unused import of NoDebugInfo from trans::glue.

9 years agoAdded instability markers to `POST_DROP_*` consts, and related opt-in's.
Felix S. Klock II [Wed, 25 Mar 2015 15:36:58 +0000 (16:36 +0100)]
Added instability markers to `POST_DROP_*` consts, and related opt-in's.

(Reviewed rest of code; did not see other `pub` items that needed such
treatment.)

Driveby: fix typo in comment in ptr.rs.

9 years agoA better `core::mem::dropped` implementation suggested by huonw on the PR.
Felix S. Klock II [Mon, 23 Mar 2015 22:52:21 +0000 (23:52 +0100)]
A better `core::mem::dropped` implementation suggested by huonw on the PR.

9 years agofilling-drop: switch `DTOR_NEEDED` and `DTOR_DONE` to non-trivial values.
Felix S. Klock II [Tue, 17 Mar 2015 23:20:52 +0000 (00:20 +0100)]
filling-drop: switch `DTOR_NEEDED` and `DTOR_DONE` to non-trivial values.

9 years agoRegression tests for issues uncovered only post the run-pass and compile-fail tests.
Felix S. Klock II [Wed, 11 Mar 2015 00:25:53 +0000 (01:25 +0100)]
Regression tests for issues uncovered only post the run-pass and compile-fail tests.

(I.e. the idea being, lets catch errors in these basic constructs
sometime *before* we start doing the doc tests.)

9 years agoSwitch drop-flag to `u8` to allow special tags to instrument state.
Felix S. Klock II [Tue, 10 Feb 2015 09:04:39 +0000 (10:04 +0100)]
Switch drop-flag to `u8` to allow special tags to instrument state.

Refactored code so that the drop-flag values for initialized
(`DTOR_NEEDED`) versus dropped (`DTOR_DONE`) are given explicit names.

Add `mem::dropped()` (which with `DTOR_DONE == 0` is semantically the
same as `mem::zeroed`, but the point is that it abstracts away from
the particular choice of value for `DTOR_DONE`).

Filling-drop needs to use something other than `ptr::read_and_zero`,
so I added such a function: `ptr::read_and_drop`.  But, libraries
should not use it if they can otherwise avoid it.

Fixes to tests to accommodate filling-drop.

9 years agoAuto merge of #23711 - alexcrichton:ip-addr, r=aturon
bors [Thu, 26 Mar 2015 09:43:35 +0000 (09:43 +0000)]
Auto merge of #23711 - alexcrichton:ip-addr, r=aturon

This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.

9 years agoAuto merge of #23691 - richo:dedup-typeorigin-mergable, r=eddyb
bors [Thu, 26 Mar 2015 05:44:26 +0000 (05:44 +0000)]
Auto merge of #23691 - richo:dedup-typeorigin-mergable, r=eddyb

I've started on refactoring the error handling code to avoid the need to reparse generated errors in `span_*`, but would rather land this incrementally as one monolithic PR (and have un-fond memories of merge conflicts from various other monoliths)

r? @eddyb

9 years agoinfer: Drop pointless format! calls
Richo Healey [Wed, 25 Mar 2015 03:59:17 +0000 (20:59 -0700)]
infer: Drop pointless format! calls

9 years agoinfer: Refactor Display impl
Richo Healey [Wed, 25 Mar 2015 03:55:02 +0000 (20:55 -0700)]
infer: Refactor Display impl

9 years agoinfer: Move TypeOrigin formatting onto it's enum
Richo Healey [Thu, 19 Mar 2015 21:49:28 +0000 (14:49 -0700)]
infer: Move TypeOrigin formatting onto it's enum

This doesn't actually solve the issue that prompted this, at:

https://github.com/rust-lang/rust/blob/master/src/librustc/session/mod.rs#L262-271

But skimming the cfg it appears that all type information has been
discarded long before that point.

9 years agoAuto merge of #23718 - alexcrichton:flaky-test, r=huonw
bors [Thu, 26 Mar 2015 02:33:36 +0000 (02:33 +0000)]
Auto merge of #23718 - alexcrichton:flaky-test, r=huonw

It's considered an error to access stdout while a process is being shut down, so
tweak this test a bit to actually wait for the child thread to exit.

This was discovered with a recent [snap-mac3 failure](http://buildbot.rust-lang.org/builders/snap3-mac/builds/164/steps/test/logs/stdio)

9 years agoAdd iOS triple mapping so tests can run
Tamir Duberstein [Wed, 25 Mar 2015 16:12:51 +0000 (09:12 -0700)]
Add iOS triple mapping so tests can run

9 years agoAlphabetize
Tamir Duberstein [Wed, 25 Mar 2015 16:12:45 +0000 (09:12 -0700)]
Alphabetize

9 years agorustc: Remove support for int/uint
Alex Crichton [Tue, 24 Mar 2015 20:26:16 +0000 (13:26 -0700)]
rustc: Remove support for int/uint

This commit removes all parsing, resolve, and compiler support for the old and
long-deprecated int/uint types.

9 years agostd: Add net::IpAddr, destabilize lookup_host
Alex Crichton [Wed, 25 Mar 2015 19:30:49 +0000 (12:30 -0700)]
std: Add net::IpAddr, destabilize lookup_host

This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.

9 years agotest: Make a test less flaky
Alex Crichton [Wed, 25 Mar 2015 22:26:39 +0000 (15:26 -0700)]
test: Make a test less flaky

It's considered an error to access stdout while a process is being shut down, so
tweak this test a bit to actually wait for the child thread to exit.

9 years agoAuto merge of #23695 - sae-bom:mac-android-debuginfo, r=alexcrichton
bors [Wed, 25 Mar 2015 21:29:50 +0000 (21:29 +0000)]
Auto merge of #23695 - sae-bom:mac-android-debuginfo, r=alexcrichton

1. when mac-android cross compile and make-check , make it use gdb instead of lldb so as to it passes debuginfo tests.
2. ignore some tests on aarch64

9 years agoAuto merge of #23434 - alexcrichton:misc-stab, r=aturon
bors [Wed, 25 Mar 2015 18:59:00 +0000 (18:59 +0000)]
Auto merge of #23434 - alexcrichton:misc-stab, r=aturon

Now that we check the stability of fields, the fields of this struct should also
be stable.

9 years agoSpeed up reading/writing slices with #[inline]
Erick Tryzelaar [Wed, 25 Mar 2015 16:07:46 +0000 (09:07 -0700)]
Speed up reading/writing slices with #[inline]

When built with `rustc -O`:

before:

test bench_read_slice  ... bench:        68 ns/iter (+/- 56)
test bench_read_vec    ... bench:        78 ns/iter (+/- 21)
test bench_write_slice ... bench:       133 ns/iter (+/- 46)
test bench_write_vec   ... bench:       308 ns/iter (+/- 69)

after:

test bench_read_slice  ... bench:        32 ns/iter (+/- 10)
test bench_read_vec    ... bench:        32 ns/iter (+/- 8)
test bench_write_slice ... bench:        53 ns/iter (+/- 12)
test bench_write_vec   ... bench:       247 ns/iter (+/- 172)

9 years agoAuto merge of #23697 - Manishearth:rollup, r=Manishearth
bors [Wed, 25 Mar 2015 14:14:04 +0000 (14:14 +0000)]
Auto merge of #23697 - Manishearth:rollup, r=Manishearth

- Successful merges: #23617, #23664, #23680, #23684, #23692, #23693
- Failed merges:

9 years agoRollup merge of #23702 - dotdash:match_reass, r=eddyb
Manish Goregaokar [Wed, 25 Mar 2015 14:14:32 +0000 (19:44 +0530)]
Rollup merge of #23702 - dotdash:match_reass, r=eddyb

 The reassignment checker effectively only checks whether the last
assignment in a body affects the discriminant, but it should of course
check all the assignments.

Fixes #23698

9 years agoRollup merge of #23693 - semarie:openbsd-pathbuf-new, r=nikomatsakis
Manish Goregaokar [Wed, 25 Mar 2015 11:42:14 +0000 (17:12 +0530)]
Rollup merge of #23693 - semarie:openbsd-pathbuf-new, r=nikomatsakis

`PathBuf::new` have been changed. Use `PathBuf::from` instead.

Apply the same change for freebsd too, while here.

9 years agoRollup merge of #23692 - yjh0502:fix/simd-overflow, r=pnkfelix
Manish Goregaokar [Wed, 25 Mar 2015 11:42:14 +0000 (17:12 +0530)]
Rollup merge of #23692 - yjh0502:fix/simd-overflow, r=pnkfelix

Disable overflow checking on SIMD operations, fix #23037

9 years agoRollup merge of #23684 - tamird:ios-fallout, r=alexcrichton
Manish Goregaokar [Wed, 25 Mar 2015 11:42:13 +0000 (17:12 +0530)]
Rollup merge of #23684 - tamird:ios-fallout, r=alexcrichton

r? @aturon cc @alexcrichton

9 years agoAlways properly copy values into bindings when mutating the match discriminant
Björn Steinbrink [Wed, 25 Mar 2015 13:50:04 +0000 (14:50 +0100)]
Always properly copy values into bindings when mutating the match discriminant

The reassignment checker effectively only checks whether the last
assignment in a body affects the discriminant, but it should of course
check all the assignments.

Fixes #23698

9 years agoRollup merge of #23664 - bluss:std-docs, r=steveklabnik
Manish Goregaokar [Wed, 25 Mar 2015 11:42:13 +0000 (17:12 +0530)]
Rollup merge of #23664 - bluss:std-docs, r=steveklabnik

Main motivation was to update docs for the removal or "demotion" of certain extension traits. The update to the slice docs was larger, since the text was largely outdated.

9 years agoRollup merge of #23617 - steveklabnik:gh23564, r=Manishearth
Manish Goregaokar [Wed, 25 Mar 2015 11:42:13 +0000 (17:12 +0530)]
Rollup merge of #23617 - steveklabnik:gh23564, r=Manishearth

Fixes #23564

9 years agoIgnore some tests on aarch64
Sae-bom Kim [Wed, 25 Mar 2015 09:17:33 +0000 (18:17 +0900)]
Ignore some tests on aarch64

9 years agomake it use gdb instead of lldb when mac-android cross compile
Sae-bom Kim [Wed, 25 Mar 2015 09:12:35 +0000 (18:12 +0900)]
make it use gdb instead of lldb when mac-android cross compile

9 years agoAuto merge of #23670 - cmr:vec-push-slowpath, r=pcwalton
bors [Wed, 25 Mar 2015 07:47:30 +0000 (07:47 +0000)]
Auto merge of #23670 - cmr:vec-push-slowpath, r=pcwalton

Makes Vec::push considerably smaller: 25 instructions, rather than 42, on
x86_64.