Test case for #2631
This commit is contained in:
parent
093faaabe1
commit
210db7d8d4
2 changed files with 32 additions and 0 deletions
15
src/test/auxiliary/issue-2631-a.rs
Normal file
15
src/test/auxiliary/issue-2631-a.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#[link(name = "req")];
|
||||||
|
#[crate_type = "lib"];
|
||||||
|
|
||||||
|
use std;
|
||||||
|
|
||||||
|
import dvec::*;
|
||||||
|
import dvec::dvec;
|
||||||
|
import std::map::hashmap;
|
||||||
|
|
||||||
|
type header_map = hashmap<str, @dvec<@str>>;
|
||||||
|
|
||||||
|
// the unused ty param is necessary so this gets monomorphized
|
||||||
|
fn request<T: copy>(req: header_map) {
|
||||||
|
let _x = *(*req.get("METHOD"))[0u];
|
||||||
|
}
|
17
src/test/run-pass/issue-2631-b.rs
Normal file
17
src/test/run-pass/issue-2631-b.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
// xfail-fast
|
||||||
|
// aux-build:issue-2631-a.rs
|
||||||
|
|
||||||
|
use req;
|
||||||
|
use std;
|
||||||
|
|
||||||
|
import req::*;
|
||||||
|
import std::map::*;
|
||||||
|
import std::map::str_hash;
|
||||||
|
import dvec;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let v = [mut @"hi"];
|
||||||
|
let m: req::header_map = str_hash();
|
||||||
|
m.insert("METHOD", @dvec::from_vec(v));
|
||||||
|
request::<int>(m);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue