Closed
Description
This was reduced from diff.rs https://github.com/utkarshkukreti/diff.rs
pub fn lines<'a>(left: &'a str) {
iter(left.lines());
}
fn iter<I, T>(left: I)
where
I: Clone + Iterator<Item = T> + DoubleEndedIterator,
T: PartialEq,
{
let _left_count = left.clone().count();
}
RUSTFLAGS="-C passes=lint" cargo build --release
Compiling diff v0.1.11 (file:///tmp/diff.rs)
Unusual: Return statement in function with noreturn attribute
ret void
Finished release [optimized] target(s) in 0.30 secs
The lint warning vanishes when I remove the .count()
.
rustc 1.25.0-nightly (3ec5a99aa 2018-02-14)
binary: rustc
commit-hash: 3ec5a99aaa0084d97a9e845b34fdf03d1462c475
commit-date: 2018-02-14
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 6.0
EDIT: //cc #7463