Commit Graph

64 Commits

Author SHA1 Message Date
Tamir Duberstein
69abc12b00 Register new snapshots 2015-04-28 17:23:45 -07:00
Alex Crichton
eeb94886ad std: Remove deprecated/unstable num functionality
This commit removes all the old casting/generic traits from `std::num` that are
no longer in use by the standard library. This additionally removes the old
`strconv` module which has not seen much use in quite a long time. All generic
functionality has been supplanted with traits in the `num` crate and the
`strconv` module is supplanted with the [rust-strconv crate][rust-strconv].

[rust-strconv]: https://github.com/lifthrasiir/rust-strconv

This is a breaking change due to the removal of these deprecated crates, and the
alternative crates are listed above.

[breaking-change]
2015-04-21 11:37:43 -07:00
Manish Goregaokar
ae64d8e415 doc ignore (fixup #24059) 2015-04-07 22:10:55 +05:30
Manish Goregaokar
6f852f5620 Rollup merge of #24059 - nikomatsakis:issue-22914-phantomdata-docs, r=huon
This probably needs a bit more work, but I wanted to try and capture some common use cases and be a bit more helpful.

r? @huonw
cc @steveklabnik
2015-04-07 18:12:47 +05:30
Niko Matsakis
d16677282a Try to improve PhantomData docs with more examples 2015-04-06 09:39:05 -04:00
Niko Matsakis
62b3060507 Revert accidental change from stable -> unstable; just meant to
deprecate (though these will likely be purged for 1.0).
2015-04-03 14:30:13 -04:00
Niko Matsakis
38fdd50e0b Remove *most* mentions of phantom fns and variance on traits. Leave some
comments and also leave the entries in the variance tables for now.
2015-04-02 13:25:06 -04:00
Niko Matsakis
628d715ff4 Deprecate MarkerTrait and PhantomFn. 2015-04-02 13:25:06 -04:00
Alex Crichton
f92e7abefd rollup merge of #23860: nikomatsakis/copy-requires-clone
Conflicts:
	src/test/compile-fail/coherence-impls-copy.rs
2015-04-01 18:37:54 -07:00
Manish Goregaokar
2159bbf650 Rollup merge of #23925 - steveklabnik:gh22914, r=Gankro
Fixes #22914

Said issue was mostly fixed, as there wasn't any examples when it was initially posted. This is mostly just some re-wording of some things and some cleanup
2015-04-02 00:40:39 +05:30
Niko Matsakis
c35c46821a Fallout in public-facing and semi-public-facing libs 2015-04-01 11:23:45 -04:00
Niko Matsakis
c4edd0c8df Make the trait Copy extend Clone. 2015-04-01 11:22:38 -04:00
Niko Matsakis
35c261aea0 Add #[fundamental] annotations into libcore so that Sized and the
`Fn` traits are considered fundamental, along with `Box` (though that is
mostly for show; the real type is `~T` in the compiler).
2015-04-01 11:21:42 -04:00
Steve Klabnik
bfc2f5de85 Improvements to PhantomData<T>'s docs 👻
Fixes #22914
2015-03-31 20:18:32 -04:00
Alex Crichton
554946c81e rollup merge of #23873: alexcrichton/remove-deprecated
Conflicts:
	src/libcollectionstest/fmt.rs
	src/libcollectionstest/lib.rs
	src/libcollectionstest/str.rs
	src/libcore/error.rs
	src/libstd/fs.rs
	src/libstd/io/cursor.rs
	src/libstd/os.rs
	src/libstd/process.rs
	src/libtest/lib.rs
	src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31 15:54:44 -07:00
Alex Crichton
94137a37e9 Test fixes and rebase conflicts, round 1 2015-03-31 15:53:25 -07:00
Alex Crichton
d4a2c94180 std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.
2015-03-31 15:49:57 -07:00
Vadim Petrochenkov
1accaa9f86 Fix some typos 2015-03-28 18:09:51 +03:00
Niko Matsakis
dd8cf92389 Fix doc tests. 2015-03-26 21:12:52 -04:00
Niko Matsakis
9c9bb9ce1d Implement Reflect trait with a variant on the standard OIBIT
semantics that tests the *interface* of trait objects, rather
than what they close over.
2015-03-26 17:52:38 -04:00
Alex Crichton
6e0f1d3984 rollup merge of #23484: alexcrichton/marker-trait-stable
This trait has proven quite useful when defining marker traits to avoid the
semi-confusing `PhantomFn` trait and it looks like it will continue to be a
useful tool for defining these traits.
2015-03-23 15:26:24 -07:00
Alex Crichton
c608084ff5 rollup merge of #23598: brson/gate
Conflicts:
	src/compiletest/compiletest.rs
	src/libcollections/lib.rs
	src/librustc_back/lib.rs
	src/libserialize/lib.rs
	src/libstd/lib.rs
	src/libtest/lib.rs
	src/test/run-make/rustdoc-default-impl/foo.rs
	src/test/run-pass/env-home-dir.rs
2015-03-23 15:13:15 -07:00
Brian Anderson
e9019101a8 Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
Flavio Percoco
38dbcb2e37 Check trait unsafety for defaulted traits 2015-03-20 16:43:11 +01:00
Flavio Percoco
9ae144f055 Add default impls for Send/Sync 2015-03-20 16:43:11 +01:00
Alex Crichton
959a0e69c9 std: Stabilize marker::MarkerTrait
This trait has proven quite useful when defining marker traits to avoid the
semi-confusing `PhantomFn` trait and it looks like it will continue to be a
useful tool for defining these traits.
2015-03-18 11:43:46 -07:00
Joseph Crail
fcf3f3209a Remove explicit syntax highlight from docs. 2015-03-13 19:25:18 -04:00
Steve Klabnik
64ab111b53 Example -> Examples
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-11 21:11:40 -04:00
bors
777f5d9599 Auto merge of #23219 - Manishearth:rollup, r=Manishearth 2015-03-09 16:02:29 +00:00
Steve Klabnik
9653a521b5 Clean up references to opt-out traits
They're opt-in now.

Fixes #22572
2015-03-08 09:32:18 -04:00
Pyry Kontio
6dcc0e5631 Adds an example for PhantomData<T>. 2015-03-08 08:38:10 -04: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
bors
2890508d97 Auto merge of #21689 - FlaPer87:oibit-send-and-friends, r=nikomatsakis
This is one more step towards completing #13231

This series of commits add support for default trait implementations. The changes in this PR don't break existing code and they are expected to preserve the existing behavior in the compiler as far as built-in bounds checks go.

The PR adds negative implementations of `Send`/`Sync` for some types and it removes the special cases for `Send`/`Sync` during the trait obligations checks. That is, it now fully relies on the traits check rather than lang items.

Once this patch lands and a new snapshot is created, it'll be possible to add default impls for `Send` and `Sync` and remove entirely the use of `BuiltinBound::{BoundSend,BoundSync}` for positive implementations as well.

This PR also removes the restriction on negative implementations. That is, it is now possible to add negative implementations for traits other than `Send`/`Sync`
2015-02-24 02:22:44 +00:00
Flavio Percoco
7ae8889286 Add negative impls for Sync 2015-02-22 02:14:24 +01:00
Flavio Percoco
bd511f73be Add negative impls for *const T and *mut T 2015-02-22 02:14:24 +01:00
Alex Crichton
6686f7aa47 Register new snapshots 2015-02-20 22:17:17 -08:00
Alex Crichton
b7c0813eb7 Round 4 test fixes and rebase conflicts 2015-02-18 17:57:35 -08:00
Alex Crichton
d6e939a2df Round 3 test fixes and conflicts 2015-02-18 16:34:04 -08:00
Niko Matsakis
f5491e63b4 Stabilize Send/Sync. 2015-02-18 17:30:14 -05:00
Niko Matsakis
d622235b30 Add deprecated versions of the old markers and integrate them back into the variance analysis. 2015-02-18 17:14:27 -05:00
Niko Matsakis
a2393e665d WIP -- improve documentation on the phantom traits 2015-02-18 16:38:39 -05:00
Niko Matsakis
2594d56e32 Introduce the new phantomdata/phantomfn markers and integrate them
into variance inference; fix various bugs in variance inference
so that it considers the correct set of constraints; modify infer to
consider the results of variance inference for type arguments.
2015-02-18 10:24:55 -05:00
Alex Crichton
47f91a9484 Register new snapshots 2015-02-17 22:04:31 -08:00
Huon Wilson
35ca50bd56 Add Send implementations for & and &mut.
Per RFC 458.

Closes #22251.
2015-02-18 08:19:21 +11:00
Huon Wilson
cae969e2a7 Remove the implicit 'static bound on Send.
Previously Send was defined as `trait Send: 'static {}`. As detailed in
https://github.com/rust-lang/rfcs/pull/458, the `'static` bound is not
actually necessary for safety, we can use lifetimes to enforce that more
flexibly.

`unsafe` code that was previously relying on `Send` to insert a
`'static` bound now may allow incorrect patterns, and so should be
audited (a quick way to ensure safety immediately and postpone the audit
is to add an explicit `'static` bound to any uses of the `Send` type).

cc #22251.
2015-02-18 08:19:21 +11:00
Felix S. Klock II
f90c3864b6 Add core::marker::PhantomData.
Port `core::ptr::Unique` to have `PhantomData`. Add `PhantomData` to
`TypedArena` and `Vec` as well.

As a drive-by, switch `ptr::Unique` from a tuple-struct to a struct
with fields.
2015-02-11 13:51:09 +01:00
bors
a08504bb35 Auto merge of #21995 - leejunseok:fix_invariant_ex, r=steveklabnik
Should fix #20147

This is my second PR in the history of ever (I botched my first one #21828). Any tips would be appreciated!
2015-02-07 09:55:14 +00:00
Junseok Lee
310ada06f2 added example back in, with a modified, (hopefully) improved description 2015-02-05 23:50:51 -08:00
Junseok Lee
b6544fd352 removed weird example 2015-02-05 23:50:51 -08:00
Steven Fackler
85a85c2070 Switch missing_copy_implementations to default-allow
This was particularly helpful in the time just after OIBIT's
implementation to make sure things that were supposed to be Copy
continued to be, but it's now creates a lot of noise for types that
intentionally don't want to be Copy.
2015-02-03 23:31:07 -08:00