Skip to content

Commit 088e19c

Browse files
luqmanaalexcrichton
authored andcommitted
---
yaml --- r: 153973 b: refs/heads/try2 c: bd15854 h: refs/heads/master i: 153971: 69cebae v: v3
1 parent d87f03a commit 088e19c

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: fd08d5fb2e4a466336419ad03501c85399e72429
8+
refs/heads/try2: bd158541143dd5677663c1e77b3079d1078169af
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/subst.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,11 @@ impl<'a> TypeFolder for SubstFolder<'a> {
584584
self.tcx().sess.span_bug(
585585
span,
586586
format!("Type parameter out of range \
587-
when substituting in region {} (root type={})",
587+
when substituting in region {} (root type={}) \
588+
(space={}, index={})",
588589
region_name.as_str(),
589-
self.root_ty.repr(self.tcx())).as_slice());
590+
self.root_ty.repr(self.tcx()),
591+
space, i).as_slice());
590592
}
591593
}
592594
}

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,9 @@ pub fn get_res_dtor(ccx: &CrateContext,
485485
if !substs.types.is_empty() {
486486
assert_eq!(did.krate, ast::LOCAL_CRATE);
487487

488+
// Since we're in trans we don't care for any region parameters
489+
let ref substs = subst::Substs::erased(substs.types.clone());
490+
488491
let vtables = typeck::check::vtable::trans_resolve_method(ccx.tcx(), did.node, substs);
489492
let (val, _) = monomorphize::monomorphic_fn(ccx, did, substs, vtables, None);
490493

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2012-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+
#![feature(unsafe_destructor)]
12+
13+
static mut DROP_RAN: bool = false;
14+
15+
trait Bar<'b> {
16+
fn do_something(&mut self);
17+
}
18+
19+
struct BarImpl<'b>;
20+
21+
impl<'b> Bar<'b> for BarImpl<'b> {
22+
fn do_something(&mut self) {}
23+
}
24+
25+
26+
struct Foo<B>;
27+
28+
#[unsafe_destructor]
29+
impl<'b, B: Bar<'b>> Drop for Foo<B> {
30+
fn drop(&mut self) {
31+
unsafe {
32+
DROP_RAN = true;
33+
}
34+
}
35+
}
36+
37+
38+
fn main() {
39+
{
40+
let _x: Foo<BarImpl> = Foo;
41+
}
42+
unsafe {
43+
assert_eq!(DROP_RAN, true);
44+
}
45+
}

0 commit comments

Comments
 (0)