diff --git a/src/librustc_typeck/check/dropck.rs b/src/librustc_typeck/check/dropck.rs index 7d911cf8b03bc..8c9afbdc87347 100644 --- a/src/librustc_typeck/check/dropck.rs +++ b/src/librustc_typeck/check/dropck.rs @@ -525,6 +525,7 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'tcx>( // and bare functions don't own instances // of the types appearing within them. walker.skip_current_subtree(); + breadcrumbs.pop(); } _ => {} }; diff --git a/src/test/run-pass/issue-25750.rs b/src/test/run-pass/issue-25750.rs new file mode 100644 index 0000000000000..2ed48af03f94c --- /dev/null +++ b/src/test/run-pass/issue-25750.rs @@ -0,0 +1,15 @@ +// Copyright 2015 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. + +fn foo() -> Option<(Box, Box)> { + None +} + +fn main() {}