From 59279b5abbb8c7780f44c82bb8a8bdb0fbacbecd Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 9 Mar 2016 16:53:19 -0500 Subject: Do not report errors from regionck if other errors were already reported during the lifetime of this inferencer. Fixes #30580. --- src/test/compile-fail/issue-30580.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/compile-fail/issue-30580.rs (limited to 'src/test') diff --git a/src/test/compile-fail/issue-30580.rs b/src/test/compile-fail/issue-30580.rs new file mode 100644 index 00000000000..908a2d47401 --- /dev/null +++ b/src/test/compile-fail/issue-30580.rs @@ -0,0 +1,24 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct Foo { a: u32 } +pub struct Pass<'a, 'tcx: 'a>(&'a mut &'a (), &'a &'tcx ()); + +impl<'a, 'tcx> Pass<'a, 'tcx> +{ + pub fn tcx(&self) -> &'a &'tcx () { self.1 } + fn lol(&mut self, b: &Foo) + { + b.c; //~ ERROR no field with that name was found + self.tcx(); + } +} + +fn main() {} -- cgit 1.4.1-3-g733a5