Skip to content

Commit 2fff197

Browse files
committed
---
yaml --- r: 134591 b: refs/heads/try c: 64b27e9 h: refs/heads/master i: 134589: 251bab7 134587: a98fe71 134583: 7a6432f 134575: cd2d584 134559: a040469 134527: 7348d49 v: v3
1 parent dad413a commit 2fff197

30 files changed

+399
-204
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 58413c09cd52ea4005d6ea7733ba1fb3a8f36589
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 437179ed8bf7f7672f84b19265df1ce569e70490
5-
refs/heads/try: 74b8868b5f74f35b375c2a0eb0995f1a6101a7fa
5+
refs/heads/try: 64b27e995e793d78ac873057393991c0dda9a178
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,6 @@ fi
477477
step_msg "validating $CFG_SELF args"
478478
validate_opt
479479

480-
# Temporarily support the old windows triples while the bots make the transition
481-
# XXX Remove me
482-
CFG_BUILD=`echo "${CFG_BUILD}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
483-
CFG_HOST=`echo "${CFG_HOST}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
484-
CFG_TARGET=`echo "${CFG_TARGET}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
485-
486480
# Validate the release channel
487481
case "$CFG_RELEASE_CHANNEL" in
488482
(source | nightly | beta | stable)

branches/try/mk/tests.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
194194
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
195195
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
196196

197-
# NOTE: Remove after reprogramming windows bots
198-
check-fast: check-lite
199-
200197
# Some less critical tests that are not prone to breakage.
201198
# Not run as part of the normal test suite, but tested by bors on checkin.
202199
check-secondary: check-lexer check-pretty

branches/try/src/jemalloc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit aae04170ccbfeea620502106b581c3c216cd132a
1+
Subproject commit 2dba541881fb8e35246d653bbe2e7c7088777a4a

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4342,6 +4342,34 @@ impl<'a> Resolver<'a> {
43424342
self.resolve_trait_reference(id, tref, reference_type)
43434343
}
43444344
UnboxedFnTyParamBound(ref unboxed_function) => {
4345+
match self.resolve_path(unboxed_function.ref_id,
4346+
&unboxed_function.path,
4347+
TypeNS,
4348+
true) {
4349+
None => {
4350+
let path_str = self.path_idents_to_string(
4351+
&unboxed_function.path);
4352+
self.resolve_error(unboxed_function.path.span,
4353+
format!("unresolved trait `{}`",
4354+
path_str).as_slice())
4355+
}
4356+
Some(def) => {
4357+
match def {
4358+
(DefTrait(_), _) => {
4359+
self.record_def(unboxed_function.ref_id, def);
4360+
}
4361+
_ => {
4362+
let msg =
4363+
format!("`{}` is not a trait",
4364+
self.path_idents_to_string(
4365+
&unboxed_function.path));
4366+
self.resolve_error(unboxed_function.path.span,
4367+
msg.as_slice());
4368+
}
4369+
}
4370+
}
4371+
}
4372+
43454373
for argument in unboxed_function.decl.inputs.iter() {
43464374
self.resolve_type(&*argument.ty);
43474375
}

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,13 @@ pub fn decl_fn(ccx: &CrateContext, name: &str, cc: llvm::CallConv,
191191
match ty::get(output).sty {
192192
// functions returning bottom may unwind, but can never return normally
193193
ty::ty_bot => {
194-
unsafe {
195-
llvm::LLVMAddFunctionAttribute(llfn,
196-
llvm::FunctionIndex as c_uint,
197-
llvm::NoReturnAttribute as uint64_t)
198-
}
194+
llvm::SetFunctionAttribute(llfn, llvm::NoReturnAttribute)
199195
}
200196
_ => {}
201197
}
202198

203199
if ccx.tcx().sess.opts.cg.no_redzone {
204-
unsafe {
205-
llvm::LLVMAddFunctionAttribute(llfn,
206-
llvm::FunctionIndex as c_uint,
207-
llvm::NoRedZoneAttribute as uint64_t)
208-
}
200+
llvm::SetFunctionAttribute(llfn, llvm::NoRedZoneAttribute)
209201
}
210202

211203
llvm::SetFunctionCallConv(llfn, cc);

branches/try/src/librustc/middle/trans/debuginfo.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -738,12 +738,6 @@ pub fn finalize(cx: &CrateContext) {
738738
cx.sess().targ_cfg.os == abi::OsiOS {
739739
"Dwarf Version".with_c_str(
740740
|s| llvm::LLVMRustAddModuleFlag(cx.llmod(), s, 2));
741-
} else if cx.sess().targ_cfg.os == abi::OsLinux {
742-
// FIXME(#13611) this is a kludge fix because the Linux bots have
743-
// gdb 7.4 which doesn't understand dwarf4, we should
744-
// do something more graceful here.
745-
"Dwarf Version".with_c_str(
746-
|s| llvm::LLVMRustAddModuleFlag(cx.llmod(), s, 3));
747741
}
748742

749743
// Prevent bitcode readers from deleting the debug info.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ fn add_argument_attributes(tys: &ForeignTypes,
998998

999999
match tys.fn_ty.ret_ty.attr {
10001000
Some(attr) => unsafe {
1001-
llvm::LLVMAddFunctionAttribute(llfn, i as c_uint, attr as u64);
1001+
llvm::LLVMAddFunctionAttribute(llfn, i as c_uint, attr.bits() as u64);
10021002
},
10031003
None => {}
10041004
}
@@ -1014,7 +1014,7 @@ fn add_argument_attributes(tys: &ForeignTypes,
10141014

10151015
match arg_ty.attr {
10161016
Some(attr) => unsafe {
1017-
llvm::LLVMAddFunctionAttribute(llfn, i as c_uint, attr as u64);
1017+
llvm::LLVMAddFunctionAttribute(llfn, i as c_uint, attr.bits() as u64);
10181018
},
10191019
None => ()
10201020
}

branches/try/src/librustc/middle/typeck/astconv.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -585,32 +585,29 @@ pub fn trait_ref_for_unboxed_function<'tcx, AC: AstConv<'tcx>,
585585
RS:RegionScope>(
586586
this: &AC,
587587
rscope: &RS,
588-
unboxed_function: &ast::UnboxedFnTy,
588+
kind: ast::UnboxedClosureKind,
589+
decl: &ast::FnDecl,
589590
self_ty: Option<ty::t>)
590591
-> ty::TraitRef {
591-
let lang_item = match unboxed_function.kind {
592+
let lang_item = match kind {
592593
ast::FnUnboxedClosureKind => FnTraitLangItem,
593594
ast::FnMutUnboxedClosureKind => FnMutTraitLangItem,
594595
ast::FnOnceUnboxedClosureKind => FnOnceTraitLangItem,
595596
};
596597
let trait_did = this.tcx().lang_items.require(lang_item).unwrap();
597-
let input_types =
598-
unboxed_function.decl
599-
.inputs
600-
.iter()
601-
.map(|input| {
598+
let input_types = decl.inputs
599+
.iter()
600+
.map(|input| {
602601
ast_ty_to_ty(this, rscope, &*input.ty)
603-
}).collect::<Vec<_>>();
602+
}).collect::<Vec<_>>();
604603
let input_tuple = if input_types.len() == 0 {
605604
ty::mk_nil()
606605
} else {
607606
ty::mk_tup(this.tcx(), input_types)
608607
};
609-
let output_type = ast_ty_to_ty(this,
610-
rscope,
611-
&*unboxed_function.decl.output);
608+
let output_type = ast_ty_to_ty(this, rscope, &*decl.output);
612609
let mut substs = Substs::new_type(vec!(input_tuple, output_type),
613-
Vec::new());
610+
Vec::new());
614611

615612
match self_ty {
616613
Some(s) => substs.types.push(SelfSpace, s),
@@ -648,7 +645,8 @@ fn mk_pointer<'tcx, AC: AstConv<'tcx>, RS: RegionScope>(
648645
substs
649646
} = trait_ref_for_unboxed_function(this,
650647
rscope,
651-
&**unboxed_function,
648+
unboxed_function.kind,
649+
&*unboxed_function.decl,
652650
None);
653651
let r = ptr_ty.default_region();
654652
let tr = ty::mk_trait(this.tcx(),
@@ -1510,7 +1508,7 @@ fn compute_region_bound<'tcx, AC: AstConv<'tcx>, RS:RegionScope>(
15101508
pub struct PartitionedBounds<'a> {
15111509
pub builtin_bounds: ty::BuiltinBounds,
15121510
pub trait_bounds: Vec<&'a ast::TraitRef>,
1513-
pub unboxed_fn_ty_bounds: Vec<&'a ast::UnboxedFnTy>,
1511+
pub unboxed_fn_ty_bounds: Vec<&'a ast::UnboxedFnBound>,
15141512
pub region_bounds: Vec<&'a ast::Lifetime>,
15151513
}
15161514

@@ -1574,7 +1572,7 @@ pub fn partition_bounds<'a>(tcx: &ty::ctxt,
15741572
region_bounds.push(l);
15751573
}
15761574
ast::UnboxedFnTyParamBound(ref unboxed_function) => {
1577-
unboxed_fn_ty_bounds.push(unboxed_function);
1575+
unboxed_fn_ty_bounds.push(&**unboxed_function);
15781576
}
15791577
}
15801578
}

branches/try/src/librustc/middle/typeck/collect.rs

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,8 @@ pub fn instantiate_unboxed_fn_ty<'tcx,AC>(this: &AC,
14271427
let param_ty = param_ty.to_ty(this.tcx());
14281428
Rc::new(astconv::trait_ref_for_unboxed_function(this,
14291429
&rscope,
1430-
unboxed_function,
1430+
unboxed_function.kind,
1431+
&*unboxed_function.decl,
14311432
Some(param_ty)))
14321433
}
14331434

@@ -2165,9 +2166,42 @@ fn conv_param_bounds<'tcx,AC>(this: &AC,
21652166
region_bounds,
21662167
unboxed_fn_ty_bounds } =
21672168
astconv::partition_bounds(this.tcx(), span, all_bounds.as_slice());
2168-
let unboxed_fn_ty_bounds =
2169-
unboxed_fn_ty_bounds.into_iter()
2170-
.map(|b| instantiate_unboxed_fn_ty(this, b, param_ty));
2169+
2170+
let unboxed_fn_ty_bounds = unboxed_fn_ty_bounds.move_iter().map(|b| {
2171+
let trait_id = this.tcx().def_map.borrow().get(&b.ref_id).def_id();
2172+
let mut kind = None;
2173+
for &(lang_item, this_kind) in [
2174+
(this.tcx().lang_items.fn_trait(), ast::FnUnboxedClosureKind),
2175+
(this.tcx().lang_items.fn_mut_trait(),
2176+
ast::FnMutUnboxedClosureKind),
2177+
(this.tcx().lang_items.fn_once_trait(),
2178+
ast::FnOnceUnboxedClosureKind)
2179+
].iter() {
2180+
if Some(trait_id) == lang_item {
2181+
kind = Some(this_kind);
2182+
break
2183+
}
2184+
}
2185+
2186+
let kind = match kind {
2187+
Some(kind) => kind,
2188+
None => {
2189+
this.tcx().sess.span_err(b.path.span,
2190+
"unboxed function trait must be one \
2191+
of `Fn`, `FnMut`, or `FnOnce`");
2192+
ast::FnMutUnboxedClosureKind
2193+
}
2194+
};
2195+
2196+
let rscope = ExplicitRscope;
2197+
let param_ty = param_ty.to_ty(this.tcx());
2198+
Rc::new(astconv::trait_ref_for_unboxed_function(this,
2199+
&rscope,
2200+
kind,
2201+
&*b.decl,
2202+
Some(param_ty)))
2203+
});
2204+
21712205
let trait_bounds: Vec<Rc<ty::TraitRef>> =
21722206
trait_bounds.into_iter()
21732207
.map(|b| {

branches/try/src/librustc_llvm/lib.rs

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -91,34 +91,35 @@ pub enum DiagnosticSeverity {
9191
Note,
9292
}
9393

94-
#[deriving(Clone)]
95-
pub enum Attribute {
96-
ZExtAttribute = 1 << 0,
97-
SExtAttribute = 1 << 1,
98-
NoReturnAttribute = 1 << 2,
99-
InRegAttribute = 1 << 3,
100-
StructRetAttribute = 1 << 4,
101-
NoUnwindAttribute = 1 << 5,
102-
NoAliasAttribute = 1 << 6,
103-
ByValAttribute = 1 << 7,
104-
NestAttribute = 1 << 8,
105-
ReadNoneAttribute = 1 << 9,
106-
ReadOnlyAttribute = 1 << 10,
107-
NoInlineAttribute = 1 << 11,
108-
AlwaysInlineAttribute = 1 << 12,
109-
OptimizeForSizeAttribute = 1 << 13,
110-
StackProtectAttribute = 1 << 14,
111-
StackProtectReqAttribute = 1 << 15,
112-
AlignmentAttribute = 31 << 16,
113-
NoCaptureAttribute = 1 << 21,
114-
NoRedZoneAttribute = 1 << 22,
115-
NoImplicitFloatAttribute = 1 << 23,
116-
NakedAttribute = 1 << 24,
117-
InlineHintAttribute = 1 << 25,
118-
StackAttribute = 7 << 26,
119-
ReturnsTwiceAttribute = 1 << 29,
120-
UWTableAttribute = 1 << 30,
121-
NonLazyBindAttribute = 1 << 31,
94+
bitflags! {
95+
flags Attribute : u32 {
96+
static ZExtAttribute = 1 << 0,
97+
static SExtAttribute = 1 << 1,
98+
static NoReturnAttribute = 1 << 2,
99+
static InRegAttribute = 1 << 3,
100+
static StructRetAttribute = 1 << 4,
101+
static NoUnwindAttribute = 1 << 5,
102+
static NoAliasAttribute = 1 << 6,
103+
static ByValAttribute = 1 << 7,
104+
static NestAttribute = 1 << 8,
105+
static ReadNoneAttribute = 1 << 9,
106+
static ReadOnlyAttribute = 1 << 10,
107+
static NoInlineAttribute = 1 << 11,
108+
static AlwaysInlineAttribute = 1 << 12,
109+
static OptimizeForSizeAttribute = 1 << 13,
110+
static StackProtectAttribute = 1 << 14,
111+
static StackProtectReqAttribute = 1 << 15,
112+
static AlignmentAttribute = 31 << 16,
113+
static NoCaptureAttribute = 1 << 21,
114+
static NoRedZoneAttribute = 1 << 22,
115+
static NoImplicitFloatAttribute = 1 << 23,
116+
static NakedAttribute = 1 << 24,
117+
static InlineHintAttribute = 1 << 25,
118+
static StackAttribute = 7 << 26,
119+
static ReturnsTwiceAttribute = 1 << 29,
120+
static UWTableAttribute = 1 << 30,
121+
static NonLazyBindAttribute = 1 << 31,
122+
}
122123
}
123124

124125
#[repr(u64)]
@@ -160,13 +161,13 @@ trait AttrHelper {
160161
impl AttrHelper for Attribute {
161162
fn apply_llfn(&self, idx: c_uint, llfn: ValueRef) {
162163
unsafe {
163-
LLVMAddFunctionAttribute(llfn, idx, *self as uint64_t);
164+
LLVMAddFunctionAttribute(llfn, idx, self.bits() as uint64_t);
164165
}
165166
}
166167

167168
fn apply_callsite(&self, idx: c_uint, callsite: ValueRef) {
168169
unsafe {
169-
LLVMAddCallSiteAttribute(callsite, idx, *self as uint64_t);
170+
LLVMAddCallSiteAttribute(callsite, idx, self.bits() as uint64_t);
170171
}
171172
}
172173
}
@@ -2009,7 +2010,7 @@ pub fn ConstFCmp(pred: RealPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
20092010

20102011
pub fn SetFunctionAttribute(fn_: ValueRef, attr: Attribute) {
20112012
unsafe {
2012-
LLVMAddFunctionAttribute(fn_, FunctionIndex as c_uint, attr as uint64_t)
2013+
LLVMAddFunctionAttribute(fn_, FunctionIndex as c_uint, attr.bits() as uint64_t)
20132014
}
20142015
}
20152016

0 commit comments

Comments
 (0)