Auto merge of #52348 - oli-obk:bugfix, r=petrochenkov
Reach the body of functions returning `impl Trait` but don't treat it as public fixes #52128 r? @pnkfelix cc @eddyb
This commit is contained in:
commit
cc903c64eb
3 changed files with 41 additions and 6 deletions
35
src/test/ui/impl-trait/issue-52128.rs
Normal file
35
src/test/ui/impl-trait/issue-52128.rs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2018 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![deny(warnings)]
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
pub struct RangeMap {
|
||||
map: BTreeMap<Range, u8>,
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Ord, PartialOrd)]
|
||||
struct Range;
|
||||
|
||||
impl RangeMap {
|
||||
fn iter_with_range<'a>(&'a self) -> impl Iterator<Item = (&'a Range, &'a u8)> + 'a {
|
||||
self.map.range(Range..Range)
|
||||
}
|
||||
|
||||
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a u8> + 'a {
|
||||
self.iter_with_range().map(|(_, data)| data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue