From e300b8047f57920f518ab32eadef12d8e6047c5d Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 28 Apr 2011 16:37:18 -0700 Subject: [PATCH] Consider unop deref as an lval. Un-XFAIL vec-push. --- src/comp/middle/ty.rs | 1 + src/test/run-pass/vec-push.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 47442f2b803..b99ae33a334 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1958,6 +1958,7 @@ fn is_lval(@ast.expr expr) -> bool { case (ast.expr_field(_,_,_)) { ret true; } case (ast.expr_index(_,_,_)) { ret true; } case (ast.expr_path(_,_,_)) { ret true; } + case (ast.expr_unary(ast.deref,_,_)) { ret true; } case (_) { ret false; } } } diff --git a/src/test/run-pass/vec-push.rs b/src/test/run-pass/vec-push.rs index 93b93687702..fc4f19eae33 100644 --- a/src/test/run-pass/vec-push.rs +++ b/src/test/run-pass/vec-push.rs @@ -1,11 +1,9 @@ -// xfail-stage0 - fn push[T](&mutable vec[mutable? T] v, &T t) { v += vec(t); } fn main() { auto v = @vec(1, 2, 3); - push(*v, 1); + push[int](*v, 1); }