Skip to content

Commit bd080b7

Browse files
committed
---
yaml --- r: 140757 b: refs/heads/try2 c: ae07170 h: refs/heads/master i: 140755: 31a95fc v: v3
1 parent b092982 commit bd080b7

File tree

17 files changed

+17
-224
lines changed

17 files changed

+17
-224
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 935b7ba51645cb738da6bd65df4f8eedf0a62bcb
8+
refs/heads/try2: ae07170bd8e5d91b80c1ab32c847400a3df1e2ce
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,8 +1425,6 @@ names are effectively reserved. Some significant attributes include:
14251425
* The `test` attribute, for marking functions as unit tests.
14261426
* The `allow`, `warn`, `forbid`, and `deny` attributes, for controlling lint checks. Lint checks supported
14271427
by the compiler can be found via `rustc -W help`.
1428-
* The `deriving` attribute, for automatically generating
1429-
implementations of certain traits.
14301428

14311429
Other attributes may be added or removed during development of the language.
14321430

@@ -1528,47 +1526,6 @@ A complete list of the built-in language items follows:
15281526
> **Note:** This list is likely to become out of date. We should auto-generate it
15291527
> from `librustc/middle/lang_items.rs`.
15301528
1531-
### Deriving
1532-
1533-
The `deriving` attribute allows certain traits to be automatically
1534-
implemented for data structures. For example, the following will
1535-
create an `impl` for the `Eq` and `Clone` traits for `Foo`, the type
1536-
parameter `T` will be given the `Eq` or `Clone` constraints for the
1537-
appropriate `impl`:
1538-
1539-
~~~
1540-
#[deriving(Eq, Clone)]
1541-
struct Foo<T> {
1542-
a: int,
1543-
b: T
1544-
}
1545-
~~~
1546-
1547-
The generated `impl` for `Eq` is equivalent to
1548-
1549-
~~~
1550-
# struct Foo<T> { a: int, b: T }
1551-
impl<T: Eq> Eq for Foo<T> {
1552-
fn eq(&self, other: &Foo<T>) -> bool {
1553-
self.a == other.a && self.b == other.b
1554-
}
1555-
1556-
fn ne(&self, other: &Foo<T>) -> bool {
1557-
self.a != other.a || self.b != other.b
1558-
}
1559-
}
1560-
~~~
1561-
1562-
Supported traits for `deriving` are:
1563-
1564-
* Comparison traits: `Eq`, `TotalEq`, `Ord`, `TotalOrd`.
1565-
* Serialization: `Encodable`, `Decodable`. These require `std`.
1566-
* `Clone`, to perform deep copies.
1567-
* `IterBytes`, to iterate over the bytes in a data type.
1568-
* `Rand`, to create a random instance of a data type.
1569-
* `ToStr`, to convert to a string. For a type with this instance,
1570-
`obj.to_str()` has the same output as `fmt!("%?", obj)`.
1571-
15721529
# Statements and expressions
15731530

15741531
Rust is _primarily_ an expression language. This means that most forms of

branches/try2/doc/tutorial.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,27 +2290,6 @@ let nonsense = mycircle.radius() * mycircle.area();
22902290

22912291
> ***Note:*** Trait inheritance does not actually work with objects yet
22922292
2293-
## Deriving implementations for traits
2294-
2295-
A small number of traits in `core` and `std` can have implementations
2296-
that can be automatically derived. These instances are specified by
2297-
placing the `deriving` attribute on a data type declaration. For
2298-
example, the following will mean that `Circle` has an implementation
2299-
for `Eq` and can be used with the equality operators, and that a value
2300-
of type `ABC` can be randomly generated and converted to a string:
2301-
2302-
~~~
2303-
#[deriving(Eq)]
2304-
struct Circle { radius: float }
2305-
2306-
#[deriving(Rand, ToStr)]
2307-
enum ABC { A, B, C }
2308-
~~~
2309-
2310-
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
2311-
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `IterBytes`, `Rand` and
2312-
`ToStr`.
2313-
23142293
# Modules and crates
23152294

23162295
The Rust namespace is arranged in a hierarchy of modules. Each source

branches/try2/mk/tools.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUST_$(4)): \
111111
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
112112
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_CORELIB_$(4)) \
113113
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_STDLIB_$(4)) \
114+
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)) \
115+
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTI_$(4)) \
116+
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTDOC_$(4)) \
114117
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4))
115118
@$$(call E, compile_and_link: $$@)
116119
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@

branches/try2/src/libcore/unstable/intrinsics.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ pub extern "rust-intrinsic" {
2020
pub fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
2121
pub fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
2222

23-
#[cfg(not(stage0))]
24-
pub fn atomic_load(src: &int) -> int;
25-
#[cfg(not(stage0))]
26-
pub fn atomic_load_acq(src: &int) -> int;
27-
28-
#[cfg(not(stage0))]
29-
pub fn atomic_store(dst: &mut int, val: int);
30-
#[cfg(not(stage0))]
31-
pub fn atomic_store_rel(dst: &mut int, val: int);
32-
3323
pub fn atomic_xchg(dst: &mut int, src: int) -> int;
3424
pub fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
3525
pub fn atomic_xchg_rel(dst: &mut int, src: int) -> int;

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,16 +1339,13 @@ pub mod llvm {
13391339
PointerVal: ValueRef) -> ValueRef;
13401340
#[fast_ffi]
13411341
pub unsafe fn LLVMBuildLoad(B: BuilderRef,
1342-
PointerVal: ValueRef,
1343-
Name: *c_char)
1344-
-> ValueRef;
1345-
1342+
PointerVal: ValueRef,
1343+
Name: *c_char)
1344+
-> ValueRef;
13461345
#[fast_ffi]
13471346
pub unsafe fn LLVMBuildStore(B: BuilderRef,
13481347
Val: ValueRef,
1349-
Ptr: ValueRef)
1350-
-> ValueRef;
1351-
1348+
Ptr: ValueRef) -> ValueRef;
13521349
#[fast_ffi]
13531350
pub unsafe fn LLVMBuildGEP(B: BuilderRef,
13541351
Pointer: ValueRef,
@@ -1564,17 +1561,6 @@ pub mod llvm {
15641561
Name: *c_char) -> ValueRef;
15651562

15661563
/* Atomic Operations */
1567-
pub unsafe fn LLVMBuildAtomicLoad(B: BuilderRef,
1568-
PointerVal: ValueRef,
1569-
Order: AtomicOrdering)
1570-
-> ValueRef;
1571-
1572-
pub unsafe fn LLVMBuildAtomicStore(B: BuilderRef,
1573-
Val: ValueRef,
1574-
Ptr: ValueRef,
1575-
Order: AtomicOrdering)
1576-
-> ValueRef;
1577-
15781564
pub unsafe fn LLVMBuildAtomicCmpXchg(B: BuilderRef,
15791565
LHS: ValueRef,
15801566
CMP: ValueRef,

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,27 +2282,25 @@ pub impl Resolver {
22822282
}
22832283
22842284
let i = import_resolution;
2285-
let mut resolve_fail = false;
2286-
let mut priv_fail = false;
22872285
match (i.value_target, i.type_target) {
22882286
// If this name wasn't found in either namespace, it's definitely
22892287
// unresolved.
2290-
(None, None) => { resolve_fail = true; }
2288+
(None, None) => { return Failed; }
22912289
// If it's private, it's also unresolved.
22922290
(Some(t), None) | (None, Some(t)) => {
22932291
let bindings = &mut *t.bindings;
22942292
match bindings.type_def {
22952293
Some(ref type_def) => {
22962294
if type_def.privacy == Private {
2297-
priv_fail = true;
2295+
return Failed;
22982296
}
22992297
}
23002298
_ => ()
23012299
}
23022300
match bindings.value_def {
23032301
Some(ref value_def) => {
23042302
if value_def.privacy == Private {
2305-
priv_fail = true;
2303+
return Failed;
23062304
}
23072305
}
23082306
_ => ()
@@ -2315,25 +2313,13 @@ pub impl Resolver {
23152313
(Some(ref value_def), Some(ref type_def)) =>
23162314
if value_def.privacy == Private
23172315
&& type_def.privacy == Private {
2318-
priv_fail = true;
2316+
return Failed;
23192317
},
23202318
_ => ()
23212319
}
23222320
}
23232321
}
23242322
2325-
if resolve_fail {
2326-
self.session.err(fmt!("unresolved import: there is no `%s` in `%s`",
2327-
*self.session.str_of(source),
2328-
self.module_to_str(containing_module)));
2329-
return Failed;
2330-
} else if priv_fail {
2331-
self.session.err(fmt!("unresolved import: found `%s` in `%s` but it is private",
2332-
*self.session.str_of(source),
2333-
self.module_to_str(containing_module)));
2334-
return Failed;
2335-
}
2336-
23372323
assert!(import_resolution.outstanding_references >= 1);
23382324
import_resolution.outstanding_references -= 1;
23392325
@@ -2505,8 +2491,7 @@ pub impl Resolver {
25052491
*segment_name));
25062492
return Failed;
25072493
}
2508-
self.session.span_err(span, fmt!("unresolved import: could not find `%s` in \
2509-
`%s`.", *segment_name, module_name));
2494+
self.session.span_err(span, ~"unresolved name");
25102495
return Failed;
25112496
}
25122497
Indeterminate => {

branches/try2/src/librustc/middle/trans/adt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ fn padding(size: u64) -> ValueRef {
574574
}
575575

576576
// XXX this utility routine should be somewhere more general
577-
#[inline(always)]
577+
#[always_inline]
578578
fn roundup(x: u64, a: u64) -> u64 { ((x + (a - 1)) / a) * a }
579579

580580
/// Get the discriminant of a constant value. (Not currently used.)

branches/try2/src/librustc/middle/trans/build.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -537,18 +537,6 @@ pub fn Load(cx: block, PointerVal: ValueRef) -> ValueRef {
537537
}
538538
}
539539
540-
pub fn AtomicLoad(cx: block, PointerVal: ValueRef, order: AtomicOrdering) -> ValueRef {
541-
unsafe {
542-
let ccx = cx.fcx.ccx;
543-
if cx.unreachable {
544-
return llvm::LLVMGetUndef(ccx.int_type);
545-
}
546-
count_insn(cx, "load.atomic");
547-
return llvm::LLVMBuildAtomicLoad(B(cx), PointerVal, order);
548-
}
549-
}
550-
551-
552540
pub fn LoadRangeAssert(cx: block, PointerVal: ValueRef, lo: c_ulonglong,
553541
hi: c_ulonglong, signed: lib::llvm::Bool) -> ValueRef {
554542
let value = Load(cx, PointerVal);
@@ -579,17 +567,6 @@ pub fn Store(cx: block, Val: ValueRef, Ptr: ValueRef) {
579567
}
580568
}
581569
582-
pub fn AtomicStore(cx: block, Val: ValueRef, Ptr: ValueRef, order: AtomicOrdering) {
583-
unsafe {
584-
if cx.unreachable { return; }
585-
debug!("Store %s -> %s",
586-
val_str(cx.ccx().tn, Val),
587-
val_str(cx.ccx().tn, Ptr));
588-
count_insn(cx, "store.atomic");
589-
llvm::LLVMBuildAtomicStore(B(cx), Val, Ptr, order);
590-
}
591-
}
592-
593570
pub fn GEP(cx: block, Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
594571
unsafe {
595572
if cx.unreachable { return llvm::LLVMGetUndef(T_ptr(T_nil())); }

branches/try2/src/librustc/middle/trans/foreign.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -592,30 +592,6 @@ pub fn trans_intrinsic(ccx: @CrateContext,
592592
Release);
593593
Store(bcx, old, fcx.llretptr.get());
594594
}
595-
~"atomic_load" => {
596-
let old = AtomicLoad(bcx,
597-
get_param(decl, first_real_arg),
598-
SequentiallyConsistent);
599-
Store(bcx, old, fcx.llretptr.get());
600-
}
601-
~"atomic_load_acq" => {
602-
let old = AtomicLoad(bcx,
603-
get_param(decl, first_real_arg),
604-
Acquire);
605-
Store(bcx, old, fcx.llretptr.get());
606-
}
607-
~"atomic_store" => {
608-
AtomicStore(bcx,
609-
get_param(decl, first_real_arg + 1u),
610-
get_param(decl, first_real_arg),
611-
SequentiallyConsistent);
612-
}
613-
~"atomic_store_rel" => {
614-
AtomicStore(bcx,
615-
get_param(decl, first_real_arg + 1u),
616-
get_param(decl, first_real_arg),
617-
Release);
618-
}
619595
~"atomic_xchg" => {
620596
let old = AtomicRMW(bcx, Xchg,
621597
get_param(decl, first_real_arg),

branches/try2/src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ pub fn type_uses_for(ccx: @CrateContext, fn_id: def_id, n_tps: uint)
124124
~"get_tydesc" | ~"needs_drop" => use_tydesc,
125125

126126
~"atomic_cxchg" | ~"atomic_cxchg_acq"|
127-
~"atomic_cxchg_rel"| ~"atomic_load" |
128-
~"atomic_load_acq" | ~"atomic_store" |
129-
~"atomic_store_rel"| ~"atomic_xchg" |
127+
~"atomic_cxchg_rel"| ~"atomic_xchg" |
130128
~"atomic_xadd" | ~"atomic_xsub" |
131129
~"atomic_xchg_acq" | ~"atomic_xadd_acq" |
132130
~"atomic_xsub_acq" | ~"atomic_xchg_rel" |

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3486,25 +3486,6 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
34863486
],
34873487
ty::mk_int())
34883488
}
3489-
~"atomic_load" | ~"atomic_load_acq" => {
3490-
(0,
3491-
~[
3492-
arg(ty::mk_imm_rptr(tcx,
3493-
ty::re_bound(ty::br_anon(0)),
3494-
ty::mk_int()))
3495-
],
3496-
ty::mk_int())
3497-
}
3498-
~"atomic_store" | ~"atomic_store_rel" => {
3499-
(0,
3500-
~[
3501-
arg(ty::mk_mut_rptr(tcx,
3502-
ty::re_bound(ty::br_anon(0)),
3503-
ty::mk_int())),
3504-
arg(ty::mk_int())
3505-
],
3506-
ty::mk_nil())
3507-
}
35083489
~"atomic_xchg" | ~"atomic_xadd" | ~"atomic_xsub" |
35093490
~"atomic_xchg_acq" | ~"atomic_xadd_acq" | ~"atomic_xsub_acq" |
35103491
~"atomic_xchg_rel" | ~"atomic_xadd_rel" | ~"atomic_xsub_rel" => {

branches/try2/src/rt/rust_globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#endif
2121

2222
#if defined(__GNUC__)
23-
#define ALWAYS_INLINE __attribute__((always_inline)) INLINE
23+
#define ALWAYS_INLINE __attribute((always_inline)) INLINE
2424
#elif defined(_MSC_VER)
2525
#define ALWAYS_INLINE __forceinline
2626
#else

branches/try2/src/rustllvm/RustWrapper.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -545,28 +545,6 @@ extern "C" LLVMTypeRef LLVMMetadataType(void) {
545545
return LLVMMetadataTypeInContext(LLVMGetGlobalContext());
546546
}
547547

548-
extern "C" LLVMValueRef LLVMBuildAtomicLoad(LLVMBuilderRef B,
549-
LLVMValueRef source,
550-
const char* Name,
551-
AtomicOrdering order) {
552-
LoadInst* li = new LoadInst(unwrap(source),0);
553-
li->setVolatile(true);
554-
li->setAtomic(order);
555-
li->setAlignment(sizeof(intptr_t));
556-
return wrap(unwrap(B)->Insert(li));
557-
}
558-
559-
extern "C" LLVMValueRef LLVMBuildAtomicStore(LLVMBuilderRef B,
560-
LLVMValueRef val,
561-
LLVMValueRef target,
562-
AtomicOrdering order) {
563-
StoreInst* si = new StoreInst(unwrap(val),unwrap(target));
564-
si->setVolatile(true);
565-
si->setAtomic(order);
566-
si->setAlignment(sizeof(intptr_t));
567-
return wrap(unwrap(B)->Insert(si));
568-
}
569-
570548
extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
571549
LLVMValueRef target,
572550
LLVMValueRef old,

branches/try2/src/rustllvm/rustllvm.def.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ LLVMArrayType
8484
LLVMBasicBlockAsValue
8585
LLVMBlockAddress
8686
LLVMBuildAShr
87-
LLVMBuildAtomicLoad
88-
LLVMBuildAtomicStore
8987
LLVMBuildAtomicCmpXchg
9088
LLVMBuildAtomicRMW
9189
LLVMBuildAdd

branches/try2/src/test/compile-fail/import2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use baz::zed::bar; //~ ERROR unresolved import
11+
use baz::zed::bar; //~ ERROR unresolved name
1212
//~^ ERROR failed to resolve import
1313

1414
mod baz {}

0 commit comments

Comments
 (0)