about summary refs log tree commit diff
path: root/src/libcore/ptr.rs
AgeCommit message (Collapse)AuthorLines
2015-06-26Use Box::into_raw rather than the deprecated boxed::into_raw in tests and ↵Ms2ger-6/+4
documentation.
2015-06-19add note for future type-system adventurersAlexis Beingessner-0/+5
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+1
2015-06-17core: Split apart the global `core` featureAlex Crichton-13/+13
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-4/+4
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-04-29rollup merge of #24610: nagisa/offset-docsAlex Crichton-3/+4
2015-04-28Register new snapshotsTamir Duberstein-17/+0
2015-04-28Clarify offset rules a bitSimonas Kazlauskas-3/+4
2015-04-15Rollup merge of #24435 - killercup:patch-9, r=steveklabnikSteve Klabnik-3/+3
The link works on the `std/ptr/index.html` docs page, but not the `std/primitive.pointer.html` page. Instead of leaving it half-broken, it is removed. I tried fixing this in #24432, but @alexcrichton mentioned that this doc string was used in two places (with different base paths unfortunately). r? @alexcrichton
2015-04-14Remove Incorrect Link from std::ptr::null DocsPascal Hertleif-3/+3
The link works on the std::ptr docs page, but not the primitive.ptr.html page. Instead of leaving it half-broken, it is removed.
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-3/+3
2015-04-10Auto merge of #24177 - alexcrichton:rustdoc, r=aturonbors-0/+1
This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable). I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
2015-04-07alloc: impl fmt::Pointer for Rc, Arc and BoxRicho Healey-0/+8
Closes #24091
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-0/+1
Closes #15318
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-15/+0
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-30std: Standardize (input, output) param orderingsAlex Crichton-5/+21
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes #22890 [breaking-change]
2015-03-26Added instability markers to `POST_DROP_*` consts, and related opt-in's.Felix S. Klock II-1/+1
(Reviewed rest of code; did not see other `pub` items that needed such treatment.) Driveby: fix typo in comment in ptr.rs.
2015-03-26Switch drop-flag to `u8` to allow special tags to instrument state.Felix S. Klock II-0/+15
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.
2015-03-25Add trivial cast lints.Nick Cameron-1/+1
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23rollup merge of #23644: mbrubeck/doc-editAlex Crichton-6/+3
PR #23104 moved `is_null` and `offset` to an inherent impl on the raw pointer type. I'm not sure whether or how it's possible to link to docs for that impl. r? @steveklabnik
2015-03-23Update docs for ptr module.Matt Brubeck-6/+3
PR #23104 moved `is_null` and `offset` to an inherent impl on the raw pointer type.
2015-03-23rollup merge of #23503: alexcrichton/fix-ptr-docsAlex Crichton-17/+3
The method with which backwards compatibility was retained ended up leading to documentation that rustdoc didn't handle well and largely ended up confusing.
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+2
2015-03-21std: Remove deprecated ptr functionsAlex Crichton-17/+3
The method with which backwards compatibility was retained ended up leading to documentation that rustdoc didn't handle well and largely ended up confusing.
2015-03-18Register new snapshotsAlex Crichton-138/+5
2015-03-16impl<T> *const T, impl<T> *mut TJorge Aparicio-0/+118
2015-03-12Update the ways to get a pointer from a boxGleb Kozyrev-13/+16
Show how to get a pointer without destroying the box. Use `boxed::into_raw` instead of `mem::transmute`.
2015-02-24std: Stabilize some `ptr` functionsAlex Crichton-53/+56
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]
2015-02-23Add documentation to associated types in libcore, libstdIvan Petkov-0/+2
2015-02-18rollup merge of #22286: nikomatsakis/variance-4bAlex Crichton-20/+32
Conflicts: src/librustc/middle/infer/combine.rs src/librustc_typeck/check/wf.rs
2015-02-18Rewrite `Unique<T>` so that it is covariant in T, implies `NonZero` and ↵Niko Matsakis-20/+32
ownership, and also follows the API of `NonZero` a bit more closely. More to do here I think (including perhaps a new name).
2015-02-18Avoid ptrtoint when checking if a pointer is nullBjörn Steinbrink-2/+2
Casting the pointer to an integer requires a ptrtoint, while casting 0 to a pointer is directly folded to a `null` value.
2015-02-13Audit integer type usage in `core::ptr`Niko Matsakis-20/+20
2015-02-11Add core::marker::PhantomData.Felix S. Klock II-3/+14
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-10Made the `ptr::Unique` type accept unsized types, to allow for use casesMarvin Löbel-3/+3
like sending a raw pointer slice across thread boundaries.
2015-02-05Improve ptr::read docsSteve Klabnik-1/+1
Fixes #21491
2015-01-23grandfathered -> rust1Brian Anderson-30/+30
2015-01-23Set unstable feature names appropriatelyBrian Anderson-15/+15
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-15/+15
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-50/+60
2015-01-17Remove unnecessary explicit conversions to *const Twe-1/+1
2015-01-13Remove unneeded box import in examplesChase Southwood-1/+0
2015-01-08Improvements to feature stagingBrian Anderson-1/+1
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
2015-01-07Test fixes and rebase conflictsAlex Crichton-2/+3
2015-01-07Merge pull request #20674 from jbcrail/fix-misspelled-commentsbors-2/+2
Fix misspelled comments. Reviewed-by: steveklabnik
2015-01-06Fix misspelled comments.Joseph Crail-2/+2
I cleaned up comments prior to the 1.0 alpha release.
2015-01-07markers -> markerNick Cameron-1/+1
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-1/+1
[breaking-change]
2015-01-03Remove deprecated functionalityAlex Crichton-46/+1
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-2/+2