Skip to content

Commit d6c5828

Browse files
committed
---
yaml --- r: 136062 b: refs/heads/master c: 893a114 h: refs/heads/master v: v3
1 parent 0f3147a commit d6c5828

File tree

25 files changed

+191
-339
lines changed

25 files changed

+191
-339
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: 7ce1a17caddb5dc21b2aa2d457f8a5ddf019ba39
2+
refs/heads/master: 893a114db54ec95c20596e485bc70dfeeeb2b66d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 749ff5e76a0d08837964e44c66654679a3a88bb8
55
refs/heads/try: ca87704735687dad44b26788c773df2d87b3b710

trunk/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ fn compose_and_run_compiler(
11961196

11971197
fn ensure_dir(path: &Path) {
11981198
if path.is_dir() { return; }
1199-
fs::mkdir(path, io::USER_RWX).unwrap();
1199+
fs::mkdir(path, io::UserRWX).unwrap();
12001200
}
12011201

12021202
fn compose_and_run(config: &Config, testfile: &Path,

trunk/src/jemalloc

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

trunk/src/librustc/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ pub fn invalid_output_for_target(sess: &Session,
466466
fn is_writeable(p: &Path) -> bool {
467467
match p.stat() {
468468
Err(..) => true,
469-
Ok(m) => m.perm & io::USER_WRITE == io::USER_WRITE
469+
Ok(m) => m.perm & io::UserWrite == io::UserWrite
470470
}
471471
}
472472

@@ -1322,7 +1322,7 @@ fn add_upstream_rust_crates(cmd: &mut Command, sess: &Session,
13221322
// Fix up permissions of the copy, as fs::copy() preserves
13231323
// permissions, but the original file may have been installed
13241324
// by a package manager and may be read-only.
1325-
match fs::chmod(&dst, io::USER_READ | io::USER_WRITE) {
1325+
match fs::chmod(&dst, io::UserRead | io::UserWrite) {
13261326
Ok(..) => {}
13271327
Err(e) => {
13281328
sess.err(format!("failed to chmod {} when preparing \

trunk/src/librustc/diagnostics.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ register_diagnostics!(
3838
E0017,
3939
E0019,
4040
E0020,
41+
E0021,
4142
E0022,
4243
E0023,
4344
E0024,
@@ -61,6 +62,7 @@ register_diagnostics!(
6162
E0045,
6263
E0046,
6364
E0047,
65+
E0048,
6466
E0049,
6567
E0050,
6668
E0051,
@@ -115,6 +117,8 @@ register_diagnostics!(
115117
E0109,
116118
E0110,
117119
E0113,
120+
E0114,
121+
E0115,
118122
E0116,
119123
E0117,
120124
E0118,
@@ -148,7 +152,5 @@ register_diagnostics!(
148152
E0158,
149153
E0159,
150154
E0161,
151-
E0162,
152-
E0163,
153-
E0164
155+
E0162
154156
)

trunk/src/librustc/middle/save/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ pub fn process_crate(sess: &Session,
14671467
},
14681468
};
14691469

1470-
match fs::mkdir_recursive(&root_path, io::USER_RWX) {
1470+
match fs::mkdir_recursive(&root_path, io::UserRWX) {
14711471
Err(e) => sess.err(format!("Could not create directory {}: {}",
14721472
root_path.display(), e).as_slice()),
14731473
_ => (),

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

Lines changed: 54 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -456,17 +456,60 @@ impl TypeMap {
456456
let return_type_id = self.get_unique_type_id_as_string(return_type_id);
457457
unique_type_id.push_str(return_type_id.as_slice());
458458
},
459-
ty::ty_closure(box ref closure_ty) => {
460-
self.get_unique_type_id_of_closure_type(cx,
461-
closure_ty.clone(),
462-
&mut unique_type_id);
463-
},
464-
ty::ty_unboxed_closure(ref def_id, _) => {
465-
let closure_ty = cx.tcx().unboxed_closures.borrow()
466-
.find(def_id).unwrap().closure_type.clone();
467-
self.get_unique_type_id_of_closure_type(cx,
468-
closure_ty,
469-
&mut unique_type_id);
459+
ty::ty_closure(box ty::ClosureTy { fn_style,
460+
onceness,
461+
store,
462+
ref bounds,
463+
ref sig,
464+
abi: _ }) => {
465+
if fn_style == ast::UnsafeFn {
466+
unique_type_id.push_str("unsafe ");
467+
}
468+
469+
if onceness == ast::Once {
470+
unique_type_id.push_str("once ");
471+
}
472+
473+
match store {
474+
ty::UniqTraitStore => unique_type_id.push_str("~|"),
475+
ty::RegionTraitStore(_, ast::MutMutable) => {
476+
unique_type_id.push_str("&mut|")
477+
}
478+
ty::RegionTraitStore(_, ast::MutImmutable) => {
479+
unique_type_id.push_str("&|")
480+
}
481+
};
482+
483+
for &parameter_type in sig.inputs.iter() {
484+
let parameter_type_id =
485+
self.get_unique_type_id_of_type(cx, parameter_type);
486+
let parameter_type_id =
487+
self.get_unique_type_id_as_string(parameter_type_id);
488+
unique_type_id.push_str(parameter_type_id.as_slice());
489+
unique_type_id.push_char(',');
490+
}
491+
492+
if sig.variadic {
493+
unique_type_id.push_str("...");
494+
}
495+
496+
unique_type_id.push_str("|->");
497+
498+
let return_type_id = self.get_unique_type_id_of_type(cx, sig.output);
499+
let return_type_id = self.get_unique_type_id_as_string(return_type_id);
500+
unique_type_id.push_str(return_type_id.as_slice());
501+
502+
unique_type_id.push_char(':');
503+
504+
for bound in bounds.builtin_bounds.iter() {
505+
match bound {
506+
ty::BoundSend => unique_type_id.push_str("Send"),
507+
ty::BoundSized => unique_type_id.push_str("Sized"),
508+
ty::BoundCopy => unique_type_id.push_str("Copy"),
509+
ty::BoundSync => unique_type_id.push_str("Sync"),
510+
};
511+
unique_type_id.push_char('+');
512+
}
470513
},
471514
_ => {
472515
cx.sess().bug(format!("get_unique_type_id_of_type() - unexpected type: {}, {:?}",
@@ -538,66 +581,6 @@ impl TypeMap {
538581
}
539582
}
540583

541-
fn get_unique_type_id_of_closure_type(&mut self,
542-
cx: &CrateContext,
543-
closure_ty: ty::ClosureTy,
544-
unique_type_id: &mut String) {
545-
let ty::ClosureTy { fn_style,
546-
onceness,
547-
store,
548-
ref bounds,
549-
ref sig,
550-
abi: _ } = closure_ty;
551-
if fn_style == ast::UnsafeFn {
552-
unique_type_id.push_str("unsafe ");
553-
}
554-
555-
if onceness == ast::Once {
556-
unique_type_id.push_str("once ");
557-
}
558-
559-
match store {
560-
ty::UniqTraitStore => unique_type_id.push_str("~|"),
561-
ty::RegionTraitStore(_, ast::MutMutable) => {
562-
unique_type_id.push_str("&mut|")
563-
}
564-
ty::RegionTraitStore(_, ast::MutImmutable) => {
565-
unique_type_id.push_str("&|")
566-
}
567-
};
568-
569-
for &parameter_type in sig.inputs.iter() {
570-
let parameter_type_id =
571-
self.get_unique_type_id_of_type(cx, parameter_type);
572-
let parameter_type_id =
573-
self.get_unique_type_id_as_string(parameter_type_id);
574-
unique_type_id.push_str(parameter_type_id.as_slice());
575-
unique_type_id.push_char(',');
576-
}
577-
578-
if sig.variadic {
579-
unique_type_id.push_str("...");
580-
}
581-
582-
unique_type_id.push_str("|->");
583-
584-
let return_type_id = self.get_unique_type_id_of_type(cx, sig.output);
585-
let return_type_id = self.get_unique_type_id_as_string(return_type_id);
586-
unique_type_id.push_str(return_type_id.as_slice());
587-
588-
unique_type_id.push_char(':');
589-
590-
for bound in bounds.builtin_bounds.iter() {
591-
match bound {
592-
ty::BoundSend => unique_type_id.push_str("Send"),
593-
ty::BoundSized => unique_type_id.push_str("Sized"),
594-
ty::BoundCopy => unique_type_id.push_str("Copy"),
595-
ty::BoundSync => unique_type_id.push_str("Sync"),
596-
};
597-
unique_type_id.push_char('+');
598-
}
599-
}
600-
601584
// Get the UniqueTypeId for an enum variant. Enum variants are not really
602585
// types of their own, so they need special handling. We still need a
603586
// UniqueTypeId for them, since to debuginfo they *are* real types.
@@ -2920,11 +2903,6 @@ fn type_metadata(cx: &CrateContext,
29202903
ty::ty_closure(ref closurety) => {
29212904
subroutine_type_metadata(cx, unique_type_id, &closurety.sig, usage_site_span)
29222905
}
2923-
ty::ty_unboxed_closure(ref def_id, _) => {
2924-
let sig = cx.tcx().unboxed_closures.borrow()
2925-
.find(def_id).unwrap().closure_type.sig.clone();
2926-
subroutine_type_metadata(cx, unique_type_id, &sig, usage_site_span)
2927-
}
29282906
ty::ty_struct(def_id, ref substs) => {
29292907
prepare_struct_metadata(cx,
29302908
t,

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

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -382,43 +382,26 @@ pub fn check_struct_like_enum_variant_pat(pcx: &pat_ctxt,
382382

383383
// Find the variant that was specified.
384384
match tcx.def_map.borrow().find(&pat_id) {
385-
Some(&def::DefVariant(found_enum_id, variant_id, true))
385+
Some(&def::DefVariant(found_enum_id, variant_id, _))
386386
if found_enum_id == enum_id => {
387387
// Get the struct fields from this struct-like enum variant.
388-
let struct_fields = ty::lookup_struct_fields(tcx, variant_id);
389-
check_struct_pat_fields(pcx, span, fields, struct_fields,
388+
let class_fields = ty::lookup_struct_fields(tcx, variant_id);
389+
390+
check_struct_pat_fields(pcx, span, fields, class_fields,
390391
variant_id, substitutions, etc);
391-
fcx.write_ty(pat_id, expected);
392-
}
393-
Some(&def::DefVariant(_, _, false)) => {
394-
let name = pprust::path_to_string(path);
395-
span_err!(tcx.sess, span, E0163,
396-
"`{}` does not name a struct variant", name);
397-
fcx.write_error(pat_id);
398-
}
399-
Some(&def::DefVariant(_, _, true)) => {
400-
let name = pprust::path_to_string(path);
401-
span_err!(tcx.sess, span, E0164,
402-
"`{}` does not name a variant of the type being matched against", name);
403-
fcx.write_error(pat_id);
404392
}
405393
Some(&def::DefStruct(..)) |
394+
Some(&def::DefVariant(..)) |
406395
Some(&def::DefTy(..)) => {
407396
let name = pprust::path_to_string(path);
408397
span_err!(tcx.sess, span, E0028,
409-
"`{}` does not name a variant", name);
410-
fcx.write_error(pat_id);
398+
"mismatched types: expected `{}`, found `{}`",
399+
fcx.infcx().ty_to_string(expected), name);
411400
}
412401
_ => {
413402
tcx.sess.span_bug(span, "resolve didn't write in variant");
414403
}
415404
}
416-
417-
if ty::type_is_error(fcx.node_ty(pat_id)) {
418-
for field in fields.iter() {
419-
check_pat(pcx, &*field.pat, ty::mk_err());
420-
}
421-
}
422405
}
423406

424407
// Pattern checking is top-down rather than bottom-up so that bindings get

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4330,7 +4330,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
43304330
// Resolve the path.
43314331
let def = tcx.def_map.borrow().find(&id).map(|i| *i);
43324332
let struct_id = match def {
4333-
Some(def::DefVariant(enum_id, variant_id, true)) => {
4333+
Some(def::DefVariant(enum_id, variant_id, _)) => {
43344334
check_struct_enum_variant(fcx, id, expr.span, enum_id,
43354335
variant_id, fields.as_slice());
43364336
enum_id

trunk/src/librustc_back/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mod test {
6868
let linkdir = tmpdir.join("test3");
6969

7070
File::create(&file).unwrap();
71-
mkdir(&dir, io::USER_RWX).unwrap();
71+
mkdir(&dir, io::UserRWX).unwrap();
7272
symlink(&file, &link).unwrap();
7373
symlink(&dir, &linkdir).unwrap();
7474

@@ -91,8 +91,8 @@ mod test {
9191
let e = d.join("e");
9292
let f = a.join("f");
9393

94-
mkdir_recursive(&b, io::USER_RWX).unwrap();
95-
mkdir_recursive(&d, io::USER_RWX).unwrap();
94+
mkdir_recursive(&b, io::UserRWX).unwrap();
95+
mkdir_recursive(&d, io::UserRWX).unwrap();
9696
File::create(&f).unwrap();
9797
symlink(&Path::new("../d/e"), &c).unwrap();
9898
symlink(&Path::new("../f"), &e).unwrap();

trunk/src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ fn write(dst: Path, contents: &[u8]) -> io::IoResult<()> {
618618
/// skipping if the directory already exists.
619619
fn mkdir(path: &Path) -> io::IoResult<()> {
620620
if !path.exists() {
621-
fs::mkdir(path, io::USER_RWX)
621+
fs::mkdir(path, io::UserRWX)
622622
} else {
623623
Ok(())
624624
}

0 commit comments

Comments
 (0)