Skip to content

Commit 210db7d

Browse files
committed
Test case for #2631
1 parent 093faaa commit 210db7d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/test/auxiliary/issue-2631-a.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#[link(name = "req")];
2+
#[crate_type = "lib"];
3+
4+
use std;
5+
6+
import dvec::*;
7+
import dvec::dvec;
8+
import std::map::hashmap;
9+
10+
type header_map = hashmap<str, @dvec<@str>>;
11+
12+
// the unused ty param is necessary so this gets monomorphized
13+
fn request<T: copy>(req: header_map) {
14+
let _x = *(*req.get("METHOD"))[0u];
15+
}

src/test/run-pass/issue-2631-b.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// xfail-fast
2+
// aux-build:issue-2631-a.rs
3+
4+
use req;
5+
use std;
6+
7+
import req::*;
8+
import std::map::*;
9+
import std::map::str_hash;
10+
import dvec;
11+
12+
fn main() {
13+
let v = [mut @"hi"];
14+
let m: req::header_map = str_hash();
15+
m.insert("METHOD", @dvec::from_vec(v));
16+
request::<int>(m);
17+
}

0 commit comments

Comments
 (0)