Skip to content

Commit 4bb9b3a

Browse files
author
Lenny222
committed
---
yaml --- r: 65265 b: refs/heads/master c: 1009c21 h: refs/heads/master i: 65263: c94ebea v: v3
1 parent 9ef3e34 commit 4bb9b3a

File tree

15 files changed

+172
-242
lines changed

15 files changed

+172
-242
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b5ab1012f1f5786f550e511ba1302a22c85fcd71
2+
refs/heads/master: 1009c21ad7b1db366a5c600946652cc490598ec1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/doc/rust.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,11 +2435,10 @@ match x {
24352435
}
24362436
~~~~
24372437

2438-
Patterns that bind variables default to binding to a copy or move of the matched value
2439-
(depending on the matched value's type).
2440-
This can be made explicit using the ```copy``` keyword,
2441-
changed to bind to a borrowed pointer by using the ```ref``` keyword,
2442-
or to a mutable borrowed pointer using ```ref mut```.
2438+
Patterns that bind variables default to binding to a copy of the matched value. This can be made
2439+
explicit using the ```copy``` keyword, changed to bind to a borrowed pointer by using the ```ref```
2440+
keyword, or to a mutable borrowed pointer using ```ref mut```, or the value can be moved into
2441+
the new binding using ```move```.
24432442

24442443
A pattern that's just an identifier,
24452444
like `Nil` in the previous answer,

trunk/src/librustc/back/link.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -727,17 +727,6 @@ pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
727727
path_name(ccx.sess.ident_of(hash))]);
728728
}
729729

730-
pub fn mangle_internal_name_by_type_and_seq(ccx: @CrateContext,
731-
t: ty::t,
732-
name: &str) -> ~str {
733-
let s = ppaux::ty_to_str(ccx.tcx, t);
734-
let hash = get_symbol_hash(ccx, t);
735-
return mangle(ccx.sess,
736-
~[path_name(ccx.sess.ident_of(s)),
737-
path_name(ccx.sess.ident_of(hash)),
738-
path_name((ccx.names)(name))]);
739-
}
740-
741730
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
742731
path: path,
743732
flav: &str) -> ~str {

trunk/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
811811
for detail)", "FEATURE"),
812812
optopt("", "android-cross-path",
813813
"The path to the Android NDK", "PATH"),
814-
optmulti("W", "warn",
814+
optflagopt("W", "warn",
815815
"Set lint warnings", "OPT"),
816816
optmulti("A", "allow",
817817
"Set lint allowed", "OPT"),

trunk/src/librustc/middle/trans/foreign.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -845,26 +845,6 @@ pub fn trans_intrinsic(ccx: @CrateContext,
845845
T_ptr(T_nil()));
846846
Store(bcx, morestack_addr, fcx.llretptr.get());
847847
}
848-
~"memcpy32" => {
849-
let dst_ptr = get_param(decl, first_real_arg);
850-
let src_ptr = get_param(decl, first_real_arg + 1);
851-
let size = get_param(decl, first_real_arg + 2);
852-
let align = C_i32(1);
853-
let volatile = C_i1(false);
854-
let llfn = *bcx.ccx().intrinsics.get(
855-
&~"llvm.memcpy.p0i8.p0i8.i32");
856-
Call(bcx, llfn, [dst_ptr, src_ptr, size, align, volatile]);
857-
}
858-
~"memcpy64" => {
859-
let dst_ptr = get_param(decl, first_real_arg);
860-
let src_ptr = get_param(decl, first_real_arg + 1);
861-
let size = get_param(decl, first_real_arg + 2);
862-
let align = C_i32(1);
863-
let volatile = C_i1(false);
864-
let llfn = *bcx.ccx().intrinsics.get(
865-
&~"llvm.memcpy.p0i8.p0i8.i64");
866-
Call(bcx, llfn, [dst_ptr, src_ptr, size, align, volatile]);
867-
}
868848
~"memmove32" => {
869849
let dst_ptr = get_param(decl, first_real_arg);
870850
let src_ptr = get_param(decl, first_real_arg + 1);

trunk/src/librustc/middle/trans/glue.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,12 @@ pub fn declare_tydesc(ccx: @CrateContext, t: ty::t) -> @mut tydesc_info {
683683
let llsize = llsize_of(ccx, llty);
684684
let llalign = llalign_of(ccx, llty);
685685
let addrspace = declare_tydesc_addrspace(ccx, t);
686-
let name = @mangle_internal_name_by_type_and_seq(ccx, t, "tydesc");
686+
// FIXME #6574: this triggers duplicate LLVM symbols
687+
let name = @(if false /*ccx.sess.opts.debuginfo*/ {
688+
mangle_internal_name_by_type_only(ccx, t, "tydesc")
689+
} else {
690+
mangle_internal_name_by_seq(ccx, "tydesc")
691+
});
687692
note_unique_llvm_symbol(ccx, name);
688693
debug!("+++ declare_tydesc %s %s", ppaux::ty_to_str(ccx.tcx, t), *name);
689694
let gvar = str::as_c_str(*name, |buf| {
@@ -712,7 +717,12 @@ pub fn declare_generic_glue(ccx: @CrateContext, t: ty::t, llfnty: TypeRef,
712717
name: ~str) -> ValueRef {
713718
let _icx = ccx.insn_ctxt("declare_generic_glue");
714719
let name = name;
715-
let fn_nm = @mangle_internal_name_by_type_and_seq(ccx, t, (~"glue_" + name));
720+
// FIXME #6574 this triggers duplicate LLVM symbols
721+
let fn_nm = @(if false /*ccx.sess.opts.debuginfo*/ {
722+
mangle_internal_name_by_type_only(ccx, t, (~"glue_" + name))
723+
} else {
724+
mangle_internal_name_by_seq(ccx, (~"glue_" + name))
725+
});
716726
debug!("%s is for type %s", *fn_nm, ppaux::ty_to_str(ccx.tcx, t));
717727
note_unique_llvm_symbol(ccx, fn_nm);
718728
let llfn = decl_cdecl_fn(ccx.llmod, *fn_nm, llfnty);

trunk/src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn type_uses_for(ccx: @CrateContext, fn_id: def_id, n_tps: uint)
135135
~"visit_tydesc" | ~"forget" | ~"frame_address" |
136136
~"morestack_addr" => 0,
137137

138-
~"memcpy32" | ~"memcpy64" | ~"memmove32" | ~"memmove64" => 0,
138+
~"memmove32" | ~"memmove64" => 0,
139139

140140
~"sqrtf32" | ~"sqrtf64" | ~"powif32" | ~"powif64" |
141141
~"sinf32" | ~"sinf64" | ~"cosf32" | ~"cosf64" |

trunk/src/librustc/middle/typeck/check/mod.rs

Lines changed: 115 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -3451,152 +3451,122 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
34513451

34523452
let tcx = ccx.tcx;
34533453
let (n_tps, inputs, output) = match *ccx.tcx.sess.str_of(it.ident) {
3454-
~"size_of" |
3455-
~"pref_align_of" | ~"min_align_of" => (1u, ~[], ty::mk_uint()),
3456-
~"init" => (1u, ~[], param(ccx, 0u)),
3457-
~"uninit" => (1u, ~[], param(ccx, 0u)),
3458-
~"forget" => (1u, ~[ param(ccx, 0) ], ty::mk_nil()),
3459-
~"transmute" => (2, ~[ param(ccx, 0) ], param(ccx, 1)),
3460-
~"move_val" | ~"move_val_init" => {
3461-
(1u,
3462-
~[
3463-
ty::mk_mut_rptr(tcx, ty::re_bound(ty::br_anon(0)), param(ccx, 0)),
3464-
param(ccx, 0u)
3465-
],
3466-
ty::mk_nil())
3467-
}
3468-
~"needs_drop" => (1u, ~[], ty::mk_bool()),
3469-
3470-
~"atomic_cxchg" | ~"atomic_cxchg_acq"| ~"atomic_cxchg_rel" => {
3471-
(0,
3454+
~"size_of" |
3455+
~"pref_align_of" | ~"min_align_of" => (1u, ~[], ty::mk_uint()),
3456+
~"init" => (1u, ~[], param(ccx, 0u)),
3457+
~"uninit" => (1u, ~[], param(ccx, 0u)),
3458+
~"forget" => (1u, ~[ param(ccx, 0) ], ty::mk_nil()),
3459+
~"transmute" => (2, ~[ param(ccx, 0) ], param(ccx, 1)),
3460+
~"move_val" | ~"move_val_init" => {
3461+
(1u,
34723462
~[
3473-
ty::mk_mut_rptr(tcx,
3474-
ty::re_bound(ty::br_anon(0)),
3475-
ty::mk_int()),
3476-
ty::mk_int(),
3477-
ty::mk_int()
3478-
],
3479-
ty::mk_int())
3480-
}
3481-
~"atomic_load" | ~"atomic_load_acq" => {
3482-
(0,
3483-
~[
3484-
ty::mk_imm_rptr(tcx, ty::re_bound(ty::br_anon(0)), ty::mk_int())
3485-
],
3486-
ty::mk_int())
3487-
}
3488-
~"atomic_store" | ~"atomic_store_rel" => {
3489-
(0,
3490-
~[
3491-
ty::mk_mut_rptr(tcx, ty::re_bound(ty::br_anon(0)), ty::mk_int()),
3492-
ty::mk_int()
3493-
],
3494-
ty::mk_nil())
3495-
}
3496-
~"atomic_xchg" | ~"atomic_xadd" | ~"atomic_xsub" |
3497-
~"atomic_xchg_acq" | ~"atomic_xadd_acq" | ~"atomic_xsub_acq" |
3498-
~"atomic_xchg_rel" | ~"atomic_xadd_rel" | ~"atomic_xsub_rel" => {
3499-
(0,
3500-
~[
3501-
ty::mk_mut_rptr(tcx, ty::re_bound(ty::br_anon(0)), ty::mk_int()),
3502-
ty::mk_int()
3503-
],
3504-
ty::mk_int())
3505-
}
3506-
3507-
~"get_tydesc" => {
3508-
// FIXME (#3730): return *intrinsic::tydesc, not *()
3509-
(1u, ~[], ty::mk_nil_ptr(ccx.tcx))
3510-
}
3511-
~"visit_tydesc" => {
3512-
let tydesc_name = special_idents::tydesc;
3513-
assert!(tcx.intrinsic_defs.contains_key(&tydesc_name));
3514-
let (_, tydesc_ty) = tcx.intrinsic_defs.get_copy(&tydesc_name);
3515-
let (_, visitor_object_ty) = ty::visitor_object_ty(tcx);
3516-
let td_ptr = ty::mk_ptr(ccx.tcx, ty::mt {
3517-
ty: tydesc_ty,
3518-
mutbl: ast::m_imm
3519-
});
3520-
(0, ~[ td_ptr, visitor_object_ty ], ty::mk_nil())
3521-
}
3522-
~"frame_address" => {
3523-
let fty = ty::mk_closure(ccx.tcx, ty::ClosureTy {
3524-
purity: ast::impure_fn,
3525-
sigil: ast::BorrowedSigil,
3526-
onceness: ast::Once,
3527-
region: ty::re_bound(ty::br_anon(0)),
3528-
bounds: ty::EmptyBuiltinBounds(),
3529-
sig: ty::FnSig {
3530-
bound_lifetime_names: opt_vec::Empty,
3531-
inputs: ~[ty::mk_imm_ptr(ccx.tcx, ty::mk_mach_uint(ast::ty_u8))],
3532-
output: ty::mk_nil()
3533-
}
3534-
});
3535-
(0u, ~[fty], ty::mk_nil())
3536-
}
3537-
~"morestack_addr" => {
3538-
(0u, ~[], ty::mk_nil_ptr(ccx.tcx))
3539-
}
3540-
~"memcpy32" => {
3541-
(0,
3542-
~[
3543-
ty::mk_ptr(tcx, ty::mt {
3544-
ty: ty::mk_u8(),
3545-
mutbl: ast::m_mutbl
3546-
}),
3547-
ty::mk_ptr(tcx, ty::mt {
3548-
ty: ty::mk_u8(),
3549-
mutbl: ast::m_imm
3550-
}),
3551-
ty::mk_u32()
3552-
],
3553-
ty::mk_nil())
3554-
}
3555-
~"memcpy64" => {
3556-
(0,
3557-
~[
3558-
ty::mk_ptr(tcx, ty::mt {
3559-
ty: ty::mk_u8(),
3560-
mutbl: ast::m_mutbl
3561-
}),
3562-
ty::mk_ptr(tcx, ty::mt {
3563-
ty: ty::mk_u8(),
3564-
mutbl: ast::m_imm
3565-
}),
3566-
ty::mk_u64()
3567-
],
3568-
ty::mk_nil())
3569-
}
3570-
~"memmove32" => {
3571-
(0,
3572-
~[
3573-
ty::mk_ptr(tcx, ty::mt {
3574-
ty: ty::mk_u8(),
3575-
mutbl: ast::m_mutbl
3576-
}),
3577-
ty::mk_ptr(tcx, ty::mt {
3578-
ty: ty::mk_u8(),
3579-
mutbl: ast::m_imm
3580-
}),
3581-
ty::mk_u32()
3582-
],
3583-
ty::mk_nil())
3584-
}
3585-
~"memmove64" => {
3586-
(0,
3587-
~[
3588-
ty::mk_ptr(tcx, ty::mt {
3589-
ty: ty::mk_u8(),
3590-
mutbl: ast::m_mutbl
3591-
}),
3592-
ty::mk_ptr(tcx, ty::mt {
3593-
ty: ty::mk_u8(),
3594-
mutbl: ast::m_imm
3595-
}),
3596-
ty::mk_u64()
3597-
],
3598-
ty::mk_nil())
3599-
}
3463+
ty::mk_mut_rptr(tcx, ty::re_bound(ty::br_anon(0)), param(ccx, 0)),
3464+
param(ccx, 0u)
3465+
],
3466+
ty::mk_nil())
3467+
}
3468+
~"needs_drop" => (1u, ~[], ty::mk_bool()),
3469+
3470+
~"atomic_cxchg" | ~"atomic_cxchg_acq"| ~"atomic_cxchg_rel" => {
3471+
(0,
3472+
~[
3473+
ty::mk_mut_rptr(tcx,
3474+
ty::re_bound(ty::br_anon(0)),
3475+
ty::mk_int()),
3476+
ty::mk_int(),
3477+
ty::mk_int()
3478+
],
3479+
ty::mk_int())
3480+
}
3481+
~"atomic_load" | ~"atomic_load_acq" => {
3482+
(0,
3483+
~[
3484+
ty::mk_imm_rptr(tcx, ty::re_bound(ty::br_anon(0)), ty::mk_int())
3485+
],
3486+
ty::mk_int())
3487+
}
3488+
~"atomic_store" | ~"atomic_store_rel" => {
3489+
(0,
3490+
~[
3491+
ty::mk_mut_rptr(tcx, ty::re_bound(ty::br_anon(0)), ty::mk_int()),
3492+
ty::mk_int()
3493+
],
3494+
ty::mk_nil())
3495+
}
3496+
~"atomic_xchg" | ~"atomic_xadd" | ~"atomic_xsub" |
3497+
~"atomic_xchg_acq" | ~"atomic_xadd_acq" | ~"atomic_xsub_acq" |
3498+
~"atomic_xchg_rel" | ~"atomic_xadd_rel" | ~"atomic_xsub_rel" => {
3499+
(0,
3500+
~[
3501+
ty::mk_mut_rptr(tcx, ty::re_bound(ty::br_anon(0)), ty::mk_int()),
3502+
ty::mk_int()
3503+
],
3504+
ty::mk_int())
3505+
}
3506+
3507+
~"get_tydesc" => {
3508+
// FIXME (#3730): return *intrinsic::tydesc, not *()
3509+
(1u, ~[], ty::mk_nil_ptr(ccx.tcx))
3510+
}
3511+
~"visit_tydesc" => {
3512+
let tydesc_name = special_idents::tydesc;
3513+
assert!(tcx.intrinsic_defs.contains_key(&tydesc_name));
3514+
let (_, tydesc_ty) = tcx.intrinsic_defs.get_copy(&tydesc_name);
3515+
let (_, visitor_object_ty) = ty::visitor_object_ty(tcx);
3516+
let td_ptr = ty::mk_ptr(ccx.tcx, ty::mt {
3517+
ty: tydesc_ty,
3518+
mutbl: ast::m_imm
3519+
});
3520+
(0, ~[ td_ptr, visitor_object_ty ], ty::mk_nil())
3521+
}
3522+
~"frame_address" => {
3523+
let fty = ty::mk_closure(ccx.tcx, ty::ClosureTy {
3524+
purity: ast::impure_fn,
3525+
sigil: ast::BorrowedSigil,
3526+
onceness: ast::Once,
3527+
region: ty::re_bound(ty::br_anon(0)),
3528+
bounds: ty::EmptyBuiltinBounds(),
3529+
sig: ty::FnSig {
3530+
bound_lifetime_names: opt_vec::Empty,
3531+
inputs: ~[ty::mk_imm_ptr(ccx.tcx, ty::mk_mach_uint(ast::ty_u8))],
3532+
output: ty::mk_nil()
3533+
}
3534+
});
3535+
(0u, ~[fty], ty::mk_nil())
3536+
}
3537+
~"morestack_addr" => {
3538+
(0u, ~[], ty::mk_nil_ptr(ccx.tcx))
3539+
}
3540+
~"memmove32" => {
3541+
(0,
3542+
~[
3543+
ty::mk_ptr(tcx, ty::mt {
3544+
ty: ty::mk_u8(),
3545+
mutbl: ast::m_mutbl
3546+
}),
3547+
ty::mk_ptr(tcx, ty::mt {
3548+
ty: ty::mk_u8(),
3549+
mutbl: ast::m_imm
3550+
}),
3551+
ty::mk_u32()
3552+
],
3553+
ty::mk_nil())
3554+
}
3555+
~"memmove64" => {
3556+
(0,
3557+
~[
3558+
ty::mk_ptr(tcx, ty::mt {
3559+
ty: ty::mk_u8(),
3560+
mutbl: ast::m_mutbl
3561+
}),
3562+
ty::mk_ptr(tcx, ty::mt {
3563+
ty: ty::mk_u8(),
3564+
mutbl: ast::m_imm
3565+
}),
3566+
ty::mk_u64()
3567+
],
3568+
ty::mk_nil())
3569+
}
36003570
~"sqrtf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
36013571
~"sqrtf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
36023572
~"powif32" => {

trunk/src/librustc/rustc.rc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
228228
return;
229229
}
230230

231+
// Display the available lint options if "-W help" or only "-W" is given.
231232
let lint_flags = vec::append(getopts::opt_strs(matches, "W"),
232233
getopts::opt_strs(matches, "warn"));
233-
if lint_flags.contains(&~"help") {
234+
235+
let show_lint_options = lint_flags.contains(&~"help") ||
236+
(opt_present(matches, "W") && lint_flags.is_empty());
237+
238+
if show_lint_options {
234239
describe_warnings();
235240
return;
236241
}

0 commit comments

Comments
 (0)