File tree 3 files changed +48
-5
lines changed
3 files changed +48
-5
lines changed Original file line number Diff line number Diff line change @@ -523,16 +523,23 @@ pub fn get_res_dtor(ccx: @mut CrateContext,
523
523
substs: &[ty::t])
524
524
-> ValueRef {
525
525
let _icx = push_ctxt(" trans_res_dtor") ;
526
+ let did = if did. crate != ast:: LOCAL_CRATE {
527
+ inline:: maybe_instantiate_inline ( ccx, did)
528
+ } else {
529
+ did
530
+ } ;
526
531
if !substs. is_empty ( ) {
527
- let did = if did. crate != ast:: LOCAL_CRATE {
528
- inline:: maybe_instantiate_inline ( ccx, did)
529
- } else {
530
- did
531
- } ;
532
532
assert_eq ! ( did. crate , ast:: LOCAL_CRATE ) ;
533
533
let tsubsts = ty:: substs { regions : ty:: ErasedRegions ,
534
534
self_ty : None ,
535
535
tps : /*bad*/ substs. to_owned ( ) } ;
536
+
537
+ // FIXME: #4252: Generic destructors with type bounds are broken.
538
+ //
539
+ // Since the vtables aren't passed to `monomorphic_fn` here, generic destructors with type
540
+ // bounds are broken. Sadly, the `typeck` pass isn't outputting the necessary metadata
541
+ // because it does so based on method calls present in the AST. Destructor calls are not yet
542
+ // known about at that stage of compilation, since `trans` handles cleanups.
536
543
let ( val, _) = monomorphize:: monomorphic_fn ( ccx,
537
544
did,
538
545
& tsubsts,
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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
+ #[ link( name="inline_dtor" , vers="0.1" ) ] ;
12
+
13
+ pub struct Foo ;
14
+
15
+ impl Drop for Foo {
16
+ #[ inline]
17
+ fn drop ( & mut self ) { }
18
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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
+ // aux-build:inline_dtor.rs
12
+ // xfail-fast
13
+
14
+ extern mod inline_dtor;
15
+
16
+ fn main ( ) {
17
+ let _x = inline_dtor:: Foo ;
18
+ }
You can’t perform that action at this time.
0 commit comments