Skip to content

Commit 7f314b9

Browse files
committed
---
yaml --- r: 134974 b: refs/heads/snap-stage3 c: 62e5dc9 h: refs/heads/master v: v3
1 parent 8b8a706 commit 7f314b9

File tree

3 files changed

+2
-50
lines changed

3 files changed

+2
-50
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 7eb9337dace88c5ded431aa7507f06d50619131b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7119974f82cb239307ed9ea2e885eb66c0edba95
4+
refs/heads/snap-stage3: 62e5dc929c1e8535d4185073507e681f26ab7e6a
55
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/diagnostics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ register_diagnostics!(
150150
E0144,
151151
E0145,
152152
E0146,
153-
E0148,
154153
E0151,
155154
E0152,
156155
E0153,

branches/snap-stage3/src/librustc/middle/kind.rs

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use util::ppaux::UserString;
1515

1616
use syntax::ast::*;
1717
use syntax::codemap::Span;
18-
use syntax::print::pprust::{expr_to_string, ident_to_string};
18+
use syntax::print::pprust::{ident_to_string};
1919
use syntax::visit::Visitor;
2020
use syntax::visit;
2121

@@ -31,10 +31,6 @@ pub struct Context<'a,'tcx:'a> {
3131
}
3232

3333
impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
34-
fn visit_expr(&mut self, ex: &Expr) {
35-
check_expr(self, ex);
36-
}
37-
3834
fn visit_fn(&mut self, fk: visit::FnKind, fd: &'v FnDecl,
3935
b: &'v Block, s: Span, n: NodeId) {
4036
check_fn(self, fk, fd, b, s, n);
@@ -161,37 +157,6 @@ fn check_fn(
161157
}
162158
}
163159

164-
pub fn check_expr(cx: &mut Context, e: &Expr) {
165-
debug!("kind::check_expr({})", expr_to_string(e));
166-
167-
match e.node {
168-
ExprRepeat(ref element, ref count_expr) => {
169-
let count = ty::eval_repeat_count(cx.tcx, &**count_expr);
170-
if count > 1 {
171-
let element_ty = ty::expr_ty(cx.tcx, &**element);
172-
check_copy(cx, element_ty, element.span,
173-
"repeated element will be copied");
174-
}
175-
}
176-
ExprAssign(ref lhs, _) |
177-
ExprAssignOp(_, ref lhs, _) => {
178-
let lhs_ty = ty::expr_ty(cx.tcx, &**lhs);
179-
if !ty::type_is_sized(cx.tcx, lhs_ty) {
180-
cx.tcx.sess.span_err(lhs.span, "dynamically sized type on lhs of assignment");
181-
}
182-
}
183-
ExprStruct(..) => {
184-
let e_ty = ty::expr_ty(cx.tcx, e);
185-
if !ty::type_is_sized(cx.tcx, e_ty) {
186-
cx.tcx.sess.span_err(e.span, "trying to initialise a dynamically sized struct");
187-
}
188-
}
189-
_ => {}
190-
}
191-
192-
visit::walk_expr(cx, e);
193-
}
194-
195160
fn check_ty(cx: &mut Context, aty: &Ty) {
196161
match aty.node {
197162
TyPath(_, _, id) => {
@@ -274,18 +239,6 @@ pub fn check_freevar_bounds(cx: &Context, fn_span: Span, sp: Span, ty: ty::t,
274239
});
275240
}
276241

277-
fn check_copy(cx: &Context, ty: ty::t, sp: Span, reason: &str) {
278-
debug!("type_contents({})={}",
279-
ty_to_string(cx.tcx, ty),
280-
ty::type_contents(cx.tcx, ty).to_string());
281-
if ty::type_moves_by_default(cx.tcx, ty) {
282-
span_err!(cx.tcx.sess, sp, E0148,
283-
"copying a value of non-copyable type `{}`",
284-
ty_to_string(cx.tcx, ty));
285-
span_note!(cx.tcx.sess, sp, "{}", reason.as_slice());
286-
}
287-
}
288-
289242
// Ensure that `ty` has a statically known size (i.e., it has the `Sized` bound).
290243
fn check_sized(tcx: &ty::ctxt, ty: ty::t, name: String, sp: Span) {
291244
if !ty::type_is_sized(tcx, ty) {

0 commit comments

Comments
 (0)