about summary refs log tree commit diff
path: root/src/test/run-pass/issue-2288.rs
AgeCommit message (Collapse)AuthorLines
2018-09-06Migrated slew of run-pass tests to various subdirectories of `ui/run-pass/`.Felix S. Klock II-42/+0
2018-08-05Convert unknown_features lint into an errorvarkor-1/+0
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-2/+0
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2015-04-01Fallout in testsNiko Matsakis-1/+1
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-1/+1
Now that support has been removed, all lingering use cases are renamed.
2015-03-23rustdoc: Replace no-pretty-expanded with pretty-expandedBrian Anderson-0/+2
Now that features must be declared expanded source often does not compile. This adds 'pretty-expanded' to a bunch of test cases that still work.
2015-01-25cleanup: s/impl Copy/#[derive(Copy)]/gJorge Aparicio-2/+1
2015-01-08fallout: run-pass tests that use box. (many could be ported to `Box::new` ↵Felix S. Klock II-0/+2
instead in the future.)
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+3
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-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-2/+3
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-02-07Removed @self and @Trait.Eduard Burtescu-4/+2
2013-10-23register snapshotsDaniel Micay-0/+2
2013-08-17Fix warnings it testsErick Tryzelaar-1/+1
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-4/+4
2013-03-13test: Fix tests. rs=testsPatrick Walton-2/+2
2013-03-13librustc: Remove implicit self from the language, except for old-style drop ↵Patrick Walton-2/+2
blocks.
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-3/+3
2013-02-28Remove legacy object creation mode, and convert remaining uses of itNiko Matsakis-1/+1
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-4/+4
2013-02-14librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵Patrick Walton-1/+1
rs=implflipping
2013-02-01check-fast fallout from removing export, r=burningtreeGraydon Hoare-1/+1
2013-01-29librustc: Disallow trait bounds in types, enumerations, and structure ↵Patrick Walton-1/+1
definitions. r=tjc
2012-12-10Reliciense makefiles and testsuite. Yup.Graydon Hoare-0/+10
2012-09-10Convert class methods to impl methods. Stop parsing class methodsBrian Anderson-1/+4
2012-09-07Convert all kind bounds to camel case. Remove send, owned keywords.Brian Anderson-4/+4
2012-09-07Remove 'let' syntax for struct fieldsBrian Anderson-1/+1
2012-09-06Remove struct ctorsBrian Anderson-1/+6
2012-08-17Remove the class keywordBrian Anderson-1/+1
2012-07-31Change remaining "iface" occurrences to "trait"; deprecate "iface"Lindsey Kuper-1/+1
2012-07-13Test for #2288Tim Chevalier-0/+20