about summary refs log tree commit diff
path: root/src/libarena
AgeCommit message (Collapse)AuthorLines
2015-09-08some more clippy-based improvementsAndre Bogus-9/+7
2015-08-15Add issue for the rustc_private feature everywhereAlex Crichton-1/+1
2015-08-11rollup merge of #27622: eefriedman/https-urlAlex Crichton-2/+2
Also fixes a few outdated links.
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-2/+2
Also fixes a few outdated links.
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-5/+4
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-06-24Make `align_of` behave like `min_align_of`.Huon Wilson-6/+6
This removes a footgun, since it is a reasonable assumption to make that pointers to `T` will be aligned to `align_of::<T>()`. This also matches the behaviour of C/C++. `min_align_of` is now deprecated. Closes #21611.
2015-06-17alloc: Split apart the global `alloc` featureAlex Crichton-1/+2
2015-06-17core: Split apart the global `core` featureAlex Crichton-1/+3
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-11Conver reborrows to .iter() calls where appropriateJoshua Landau-1/+1
2015-05-15libs: Move favicon URLs to HTTPSAlex Crichton-1/+1
Helps prevent mixed content warnings if accessing docs over HTTPS. Closes #25459
2015-04-28Register new snapshotsTamir Duberstein-3/+0
2015-04-10Doc: remove a "safety note" made obsolete by dropck for TypedArenaSimon Sapin-4/+0
https://botbot.me/mozilla/rust-internals/2015-04-10/?msg=36316959&page=6
2015-04-02Deprecate MarkerTrait and PhantomFn.Niko Matsakis-1/+4
2015-03-25Add trivial cast lints.Nick Cameron-1/+2
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-18Register new snapshotsAlex Crichton-6/+0
2015-03-17Replace TyDesc and its uses with trait vtables and a type_name intrinsic.Eduard Burtescu-1/+23
2015-03-16impl {i,u}{8,16,32,64,size}Jorge Aparicio-0/+1
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-1/+1
2015-03-06Rollup merge of #23056 - awlnx:master, r=nrcManish Goregaokar-0/+2
2015-03-05fix for new attributes failing. issue #22964awlnx-0/+2
2015-03-03Add `: Box<_>` or `::Box<_>` type annotations to various places.Felix S. Klock II-4/+4
This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-18Fallout: arena needs to use phantomdata since invariantlifetime is goneNiko Matsakis-2/+4
2015-02-11Added lifetime param to Arena.Felix S. Klock II-21/+44
It (1.) is invariant, (2.) must strictly outlive the arena itself, (3.) constrains the inputs to the arena so that their borrows must also strictly outlive the arena itself. This implies that, for now, one can no longer have cross-references between data allocated via the same `Arena` (even when the data is not subject to the Drop Check rule). Instead one must carry multiple `Arena` instances, or (more commonly), use one or more `TypedArena` instances with enums encoding the different variants of allocated data.
2015-02-11Add core::marker::PhantomData.Felix S. Klock II-0/+6
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-09int/uint => isize/usize in liblibc/liballoc/libarenawe-38/+37
2015-02-03Auto merge of #21613 - alfie:suffix-small, r=alexcrichtonbors-8/+8
2015-02-02More deprecating of i/u suffixesAlfie John-8/+8
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-1/+1
2015-01-30Test fixes and rebase conflictsAlex Crichton-8/+5
Also some tidying up of a bunch of crate attributes
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-5/+5
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-23Deprecated attributes don't take 'feature' names and are paired with ↵Brian Anderson-0/+2
stable/unstable Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
2015-01-23Set unstable feature names appropriatelyBrian Anderson-2/+3
* `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-22Put #[staged_api] behind the 'staged_api' gateBrian Anderson-0/+1
2015-01-21Remove 'since' from unstable attributesBrian Anderson-1/+1
2015-01-21Tie stability attributes to feature gatesBrian Anderson-1/+1
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-1/+1
2015-01-17Set allow(unstable) in crates that use unstable featuresBrian Anderson-0/+1
Lets them build with the -dev, -nightly, or snapshot compiler
2015-01-08rollup merge of #20754: nikomatsakis/int-featureAlex Crichton-0/+1
Conflicts: src/test/compile-fail/borrowck-move-out-of-overloaded-auto-deref.rs src/test/compile-fail/issue-2590.rs src/test/compile-fail/lint-stability.rs src/test/compile-fail/slice-mut-2.rs src/test/compile-fail/std-uncopyable-atomics.rs
2015-01-08Remove warning from the libraries.Huon Wilson-0/+1
This adds the int_uint feature to *every* library, whether or not it needs it.
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-0/+2
2015-01-07Preliminary feature stagingBrian Anderson-0/+1
This partially implements the feature staging described in the [release channel RFC][rc]. It does not yet fully conform to the RFC as written, but does accomplish its goals sufficiently for the 1.0 alpha release. It has three primary user-visible effects: * On the nightly channel, use of unstable APIs generates a warning. * On the beta channel, use of unstable APIs generates a warning. * On the beta channel, use of feature gates generates a warning. Code that does not trigger these warnings is considered 'stable', modulo pre-1.0 bugs. Disabling the warnings for unstable APIs continues to be done in the existing (i.e. old) style, via `#[allow(...)]`, not that specified in the RFC. I deem this marginally acceptable since any code that must do this is not using the stable dialect of Rust. Use of feature gates is itself gated with the new 'unstable_features' lint, on nightly set to 'allow', and on beta 'warn'. The attribute scheme used here corresponds to an older version of the RFC, with the `#[staged_api]` crate attribute toggling the staging behavior of the stability attributes, but the user impact is only in-tree so I'm not concerned about having to make design changes later (and I may ultimately prefer the scheme here after all, with the `#[staged_api]` crate attribute). Since the Rust codebase itself makes use of unstable features the compiler and build system to a midly elaborate dance to allow it to bootstrap while disobeying these lints (which would otherwise be errors because Rust builds with `-D warnings`). This patch includes one significant hack that causes a regression. Because the `format_args!` macro emits calls to unstable APIs it would trigger the lint. I added a hack to the lint to make it not trigger, but this in turn causes arguments to `println!` not to be checked for feature gates. I don't presently understand macro expansion well enough to fix. This is bug #20661. Closes #16678 [rc]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2014-12-29Test fixes and rebase conflictsAlex Crichton-1/+1
2014-12-13libarena: use unboxed closuresJorge Aparicio-4/+5
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-1/+1
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-11-26Remove special casing for some meta attributesSteven Fackler-1/+0
Descriptions and licenses are handled by Cargo now, so there's no reason to keep these attributes around.
2014-11-13Remove lots of numeric traits from the preludesBrendan Zabarauskas-1/+1
Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
2014-11-13Move checked arithmetic operators into Int traitBrendan Zabarauskas-5/+5
2014-11-13Create UnsignedInt trait and deprecate free functionsBrendan Zabarauskas-3/+3