Skip to content

Commit 878a154

Browse files
committed
---
yaml --- r: 151499 b: refs/heads/try2 c: b6c9dbd h: refs/heads/master i: 151497: b172a9a 151495: 0d500af v: v3
1 parent 3b90149 commit 878a154

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
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: fa43727781833cfbc17e3161dc131b9c243e965f
8+
refs/heads/try2: b6c9dbd3e40e9de4a907ce5cb1e5d8ee0b5d6220
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/typeck/check/vtable.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,8 @@ pub fn early_resolve_expr(ex: &ast::Expr, fcx: &FnCtxt, is_early: bool) {
733733
pub fn resolve_impl(tcx: &ty::ctxt,
734734
impl_item: &ast::Item,
735735
impl_generics: &ty::Generics,
736-
impl_trait_ref: &ty::TraitRef) {
736+
impl_trait_ref: &ty::TraitRef)
737+
{
737738
let param_env = ty::construct_parameter_environment(
738739
tcx,
739740
None,
@@ -774,6 +775,7 @@ pub fn resolve_impl(tcx: &ty::ctxt,
774775
lookup_vtables_for_param(&vcx, impl_item.span, None,
775776
&param_bounds, t, false);
776777

778+
infcx.resolve_regions_and_report_errors();
777779

778780
let res = impl_res {
779781
trait_vtables: vtbls,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
// Check that when we test the supertrait we ensure consistent use of
12+
// lifetime parameters. In this case, implementing T2<'a,'b> requires
13+
// an impl of T1<'a>, but we have an impl of T1<'b>.
14+
15+
trait T1<'x> {
16+
fn x(&self) -> &'x int;
17+
}
18+
19+
trait T2<'x, 'y> : T1<'x> {
20+
fn y(&self) -> &'y int;
21+
}
22+
23+
struct S<'a, 'b> {
24+
a: &'a int,
25+
b: &'b int
26+
}
27+
28+
impl<'a,'b> T1<'b> for S<'a, 'b> {
29+
fn x(&self) -> &'b int {
30+
self.b
31+
}
32+
}
33+
34+
impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { //~ ERROR cannot infer an appropriate lifetime
35+
fn y(&self) -> &'b int {
36+
self.b
37+
}
38+
}
39+
40+
pub fn main() {
41+
}

0 commit comments

Comments
 (0)