-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use ast::{MetaItem, MetaWord, Item}; | ||
use codemap::Span; | ||
use ext::base::ExtCtxt; | ||
use ext::deriving::generic::*; | ||
|
||
pub fn expand_deriving_bound(cx: &mut ExtCtxt, | ||
span: Span, | ||
mitem: @MetaItem, | ||
item: @Item, | ||
push: |@Item|) { | ||
|
||
let name = match mitem.node { | ||
MetaWord(ref tname) => { | ||
match tname.get() { | ||
"Copy" => "Copy", | ||
"Send" => "Send", | ||
"Share" => "Share", | ||
ref tname => cx.span_bug(span, | ||
format!("expected built-in trait name but found {}", | ||
*tname)) | ||
} | ||
}, | ||
_ => return cx.span_err(span, "unexpected value in deriving, expected a trait") | ||
}; | ||
|
||
let trait_def = TraitDef { | ||
span: span, | ||
attributes: Vec::new(), | ||
path: Path::new(vec!("std", "kinds", name)), | ||
additional_bounds: Vec::new(), | ||
generics: LifetimeBounds::empty(), | ||
methods: vec!() | ||
}; | ||
|
||
trait_def.expand(cx, mitem, item, push) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//NOTE: Remove in the next snapshot | ||
#[cfg(not(stage0))] | ||
#[deriving(Share(Bad),Send,Copy)] | ||
//~^ ERROR unexpected value in deriving, expected a trait | ||
struct Test; | ||
|
||
pub fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//NOTE: Remove in the next snapshot | ||
#[cfg(not(stage0))] | ||
#[deriving(Share,Send,Copy)] | ||
struct Test; | ||
|
||
pub fn main() {} |
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = 527a7a03
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4742
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2525
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = 702c49c2
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4747
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5543
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5539
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4645
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5641
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4737
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5643
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4734
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2530
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5637
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4732
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = 9cce8c63
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5644
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5550
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5546
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4652
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5648
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4744
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5650
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4741
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2537
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4754
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = 632432a4
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4654
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5552
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5650
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4746
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5652
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2539
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = aa41f598
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4758
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5554
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5550
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4656
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5652
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4740
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4748
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5654
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4745
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2541
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5648
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = a1be66ac
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4765
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5561
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5557
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4663
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5659
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4747
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4755
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5661
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4752
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2548
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5655
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at flaper87@c39271e
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/opt-in-phase1 = c39271e into auto
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/opt-in-phase1 = c39271e merged ok, testing candidate = 757f106
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5563
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5559
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/4652
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4665
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5661
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4749
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4757
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5663
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/4748
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4754
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/4816
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2550
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5657
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4752
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4767
c39271e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 757f106