about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-16/+8
2015-01-21Remove feature(import_shadowing).Eduard Burtescu-4/+1
2015-01-20Auto merge of #21257 - alexcrichton:issue-20064, r=pnkfelixbors-0/+14
These two attributes are used to change the entry point into a Rust program, but for now they're being put behind feature gates until we have a chance to think about them a little more. The #[start] attribute specifically may have its signature changed. This is a breaking change to due the usage of these attributes generating errors by default now. If your crate is using these attributes, add this to your crate root: #![feature(start)] // if you're using the #[start] attribute #![feature(main)] // if you're using the #[main] attribute cc #20064
2015-01-17Feature gate SIMD in FFI, due to unknown ABIs.Huon Wilson-0/+4
I don't know if this handling of SIMD types is correct for the C ABI on all platforms, so lets add an even finer feature gate than just the `simd` one. The `simd` one can be used with (relatively) little risk of complete nonsense, the reason for it is that it is likely that things will change. Using the types in FFI with an incorrect ABI will at best give absolute nonsense results, but possibly cause serious breakage too, so this is a step up in badness, hence a new feature gate.
2015-01-16syntax: Feature gate #[start] and #[main]Alex Crichton-0/+14
These two attributes are used to change the entry point into a Rust program, but for now they're being put behind feature gates until we have a chance to think about them a little more. The #[start] attribute specifically may have its signature changed. This is a breaking change to due the usage of these attributes generating errors by default now. If your crate is using these attributes, add this to your crate root: #![feature(start)] // if you're using the #[start] attribute #![feature(main)] // if you're using the #[main] attribute cc #20064
2015-01-12Feature gate #[rustc_on_unimplemented]Manish Goregaokar-0/+5
2015-01-08rollup merge of #20754: nikomatsakis/int-featureAlex Crichton-0/+55
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-08Test fixes.Huon Wilson-1/+1
2015-01-08Add a warning feature gate for int/uint in types and i/u suffixes.Huon Wilson-0/+55
2015-01-08Remove the deprecated opt_out_copy featureFlavio Percoco-4/+1
2015-01-07rollup merge of #20723: pnkfelix/feature-gate-box-syntaxAlex Crichton-1/+16
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/libserialize/lib.rs src/libsyntax/feature_gate.rs
2015-01-08Added `box_syntax` feature gate; added to std and rustc crates for bootstrap.Felix S. Klock II-0/+12
To avoid using the feauture, change uses of `box <expr>` to `Box::new(<expr>)` alternative, as noted by the feature gate message. (Note that box patterns have no analogous trivial replacement, at least not in general; you need to revise the code to do a partial match, deref, and then the rest of the match.) [breaking-change]
2015-01-07remove slicing_syntax feature gateJorge Aparicio-9/+1
2015-01-07use slicing sugarJorge Aparicio-8/+8
2015-01-06Test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-06rollup merge of #20593: nikomatsakis/unused-tps-in-implAlex Crichton-0/+10
Conflicts: src/libcollections/lib.rs src/librustc/lib.rs src/libserialize/lib.rs src/libstd/lib.rs
2015-01-06Register new snapshotsAlex Crichton-1/+1
Conflicts: src/librbml/lib.rs src/libserialize/json_stage0.rs src/libserialize/serialize_stage0.rs src/libsyntax/ast.rs src/libsyntax/ext/deriving/generic/mod.rs src/libsyntax/parse/token.rs
2015-01-07falloutNick Cameron-3/+4
2015-01-06Implement impl reachability rules. This is a [breaking-change]. TypeNiko Matsakis-0/+10
parameters on impls must now also appear in the trait ref, self type, or some associated type declared on the impl. This ensures that they are constrianed in some way and that the semantics of the trait system are well-defined (always a good thing). There are three major ways to fix this error: 1. Convert the trait to use associated types; most often the type parameters are not constrained because they are in fact outputs of the impl. 2. Move the type parameters to methods. 3. Add an additional type parameter to the self type or trait so that the unused parameter can appear there. In some cases, it is not possible to fix the impl because the trait definition needs to be changed first (and that may be out of your control). In that case, for the time being, you can opt out of these rules by using `#[old_impl_check]` on the impl and adding a `#![feature(old_impl_check)]` to your crate declaration.
2015-01-07Replace full slice notation with index callsNick Cameron-5/+5
2015-01-05More test fixes!Alex Crichton-13/+1
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-30/+11
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05rollup merge of #20594: nikomatsakis/orphan-orderedAlex Crichton-0/+20
Conflicts: src/libsyntax/feature_gate.rs
2015-01-05rollup merge of #20568: huonw/ungate-AT-globsAlex Crichton-50/+4
These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice. Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.
2015-01-05Un-gate macro_rulesKeegan McAllister-7/+2
2015-01-05Reserve the keyword 'macro'Keegan McAllister-2/+2
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-21/+7
2015-01-05remove TyClosureJorge Aparicio-6/+0
2015-01-05Implement new orphan rule that requires that impls of remote traits meet the ↵Niko Matsakis-0/+8
following two criteria: - the self type includes some local type; and, - type parameters in the self type must be constrained by a local type. A type parameter is called *constrained* if it appears in some type-parameter of a local type. Here are some examples that are accepted. In all of these examples, I assume that `Foo` is a trait defined in another crate. If `Foo` were defined in the local crate, then all the examples would be legal. - `impl Foo for LocalType` - `impl<T> Foo<T> for LocalType` -- T does not appear in Self, so it is OK - `impl<T> Foo<T> for LocalType<T>` -- T here is constrained by LocalType - `impl<T> Foo<T> for (LocalType<T>, T)` -- T here is constrained by LocalType Here are some illegal examples (again, these examples assume that `Foo` is not local to the current crate): - `impl Foo for int` -- the Self type is not local - `impl<T> Foo for T` -- T appears in Self unconstrained by a local type - `impl<T> Foo for (LocalType, T)` -- T appears in Self unconstrained by a local type This is a [breaking-change]. For the time being, you can opt out of the new rules by placing `#[old_orphan_check]` on the trait (and enabling the feature gate where the trait is defined). Longer term, you should restructure your traits to avoid the problem. Usually this means changing the order of parameters so that the "central" type parameter is in the `Self` position. As an example of that refactoring, consider the `BorrowFrom` trait: ```rust pub trait BorrowFrom<Sized? Owned> for Sized? { fn borrow_from(owned: &Owned) -> &Self; } ``` As defined, this trait is commonly implemented for custom pointer types, such as `Arc`. Those impls follow the pattern: ```rust impl<T> BorrowFrom<Arc<T>> for T {...} ``` Unfortunately, this impl is illegal because the self type `T` is not local to the current crate. Therefore, we are going to change the order of the parameters, so that `BorrowFrom` becomes `Borrow`: ```rust pub trait Borrow<Sized? Borrowed> for Sized? { fn borrow_from(owned: &Self) -> &Borrowed; } ``` Now the `Arc` impl is written: ```rust impl<T> Borrow<T> for Arc<T> { ... } ``` This impl is legal because the self type (`Arc<T>`) is local.
2015-01-05Ungate default type parameters.Huon Wilson-18/+1
These are in scope for 1.0, and this is good to e.g. find as many bugs as possible.
2015-01-05Ungate globs.Huon Wilson-8/+2
These are in scope for 1.0, so this is good to e.g. make it easier find bugs.
2015-01-05Ungate associated types.Huon Wilson-24/+1
They work pretty well now, and the stdlib is using them everywhere so they're impossible to avoid anyway.
2015-01-04Put negative trait implemtations behind a feature gateFlavio Percoco-1/+14
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-1/+1
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2015-01-02rollup merge of #20416: nikomatsakis/coherenceAlex Crichton-3/+22
Conflicts: src/test/run-pass/issue-15734.rs src/test/run-pass/issue-3743.rs
2015-01-02rollup merge of #20334: nagisa/ffi-llvmAlex Crichton-0/+11
Fixes #20313 r? @huonw
2015-01-02Fix orphan checking (cc #19470). (This is not a complete fix of #19470 ↵Niko Matsakis-3/+22
because of the backwards compatibility feature gate.) This is a [breaking-change]. The new rules require that, for an impl of a trait defined in some other crate, two conditions must hold: 1. Some type must be local. 2. Every type parameter must appear "under" some local type. Here are some examples that are legal: ```rust struct MyStruct<T> { ... } // Here `T` appears "under' `MyStruct`. impl<T> Clone for MyStruct<T> { } // Here `T` appears "under' `MyStruct` as well. Note that it also appears // elsewhere. impl<T> Iterator<T> for MyStruct<T> { } ``` Here is an illegal example: ```rust // Here `U` does not appear "under" `MyStruct` or any other local type. // We call `U` "uncovered". impl<T,U> Iterator<U> for MyStruct<T> { } ``` There are a couple of ways to rewrite this last example so that it is legal: 1. In some cases, the uncovered type parameter (here, `U`) should be converted into an associated type. This is however a non-local change that requires access to the original trait. Also, associated types are not fully baked. 2. Add `U` as a type parameter of `MyStruct`: ```rust struct MyStruct<T,U> { ... } impl<T,U> Iterator<U> for MyStruct<T,U> { } ``` 3. Create a newtype wrapper for `U` ```rust impl<T,U> Iterator<Wrapper<U>> for MyStruct<T,U> { } ``` Because associated types are not fully baked, which in the case of the `Hash` trait makes adhering to this rule impossible, you can temporarily disable this rule in your crate by using `#![feature(old_orphan_check)]`. Note that the `old_orphan_check` feature will be removed before 1.0 is released.
2015-01-01Feature gate macro argumentsCorey Richardson-35/+88
Uses the same approach as https://github.com/rust-lang/rust/pull/17286 (and subsequent changes making it more correct), where the visitor will skip any pieces of the AST that are from "foreign code", where the spans don't line up, indicating that that piece of code is due to a macro expansion. If this breaks your code, read the error message to determine which feature gate you should add to your crate, and bask in the knowledge that your code won't mysteriously break should you try to use the 1.0 release. Closes #18102 [breaking-change]
2014-12-31Feature gate FFI imports of LLVM intrinsicsSimonas Kazlauskas-0/+11
Fixes #20313
2014-12-30Remove ExprSlice by hacking the compilerNick Cameron-2/+2
[breaking-change] The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-25Remove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.Simon Sapin-0/+2
As a replacement, add is_ascii() to AsciiExt, and implement AsciiExt for u8 and char. [breaking-change]
2014-12-21Fallout of std::str stabilizationAlex Crichton-5/+5
2014-12-19libsyntax: use `#[deriving(Copy)]`Jorge Aparicio-2/+1
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-1/+1
results.
2014-12-14Remove `proc` types/expressions from the parser, compiler, andNiko Matsakis-6/+0
language. Recommend `move||` instead.
2014-12-14Adjust feature gates to allow for parenthetical notation to be usedNiko Matsakis-13/+0
with the fn traits
2014-12-08Add a feature opt `opt_out_copy` that allows people to revert to the olderNiko Matsakis-0/+6
behavior temporarily. This feature will eventually transition to REJECTED.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+2
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-12-06libsyntax: remove unnecessary `as_slice()` callsJorge Aparicio-1/+1