Skip to content

Commit fc6eb9a

Browse files
committed
rollup merge of #16889 : P1start/array-not-vector
2 parents aac078d + 5bc27d5 commit fc6eb9a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/librustc/middle/ty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3789,7 +3789,8 @@ pub fn ty_sort_string(cx: &ctxt, t: t) -> String {
37893789
ty_enum(id, _) => format!("enum {}", item_path_str(cx, id)),
37903790
ty_box(_) => "Gc-ptr".to_string(),
37913791
ty_uniq(_) => "box".to_string(),
3792-
ty_vec(_, _) => "vector".to_string(),
3792+
ty_vec(_, Some(_)) => "array".to_string(),
3793+
ty_vec(_, None) => "unsized array".to_string(),
37933794
ty_ptr(_) => "*-ptr".to_string(),
37943795
ty_rptr(_, _) => "&-ptr".to_string(),
37953796
ty_bare_fn(_) => "extern fn".to_string(),
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
let _x: int = [1i, 2, 3]; //~ ERROR expected int, found array
13+
14+
let x: &[int] = &[1, 2, 3];
15+
let _y: &int = x; //~ ERROR expected int, found unsized array
16+
}

0 commit comments

Comments
 (0)