File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/tools/rust-analyzer/crates/hir-ty/src/tests Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -4994,3 +4994,35 @@ fn main() {
49944994 "# ] ] ,
49954995 ) ;
49964996}
4997+
4998+ #[ test]
4999+ fn trait_object_binders ( ) {
5000+ check_infer (
5001+ r#"
5002+ //- minicore: iterator, dispatch_from_dyn
5003+ fn main() {
5004+ struct Box<T: ?Sized>(*const T);
5005+ impl<I: Iterator + ?Sized> Iterator for Box<I> {
5006+ type Item = I::Item;
5007+ fn next(&mut self) -> Option<I::Item> {
5008+ loop {}
5009+ }
5010+ }
5011+ let iter: Box<dyn Iterator<Item = &[u8]> + 'static> = loop {};
5012+ let _ = iter.into_iter();
5013+ }"# ,
5014+ expect ! [ [ r#"
5015+ 10..313 '{ ...r(); }': ()
5016+ 223..227 'iter': Box<dyn Iterator<Item = &'? [u8]> + 'static>
5017+ 273..280 'loop {}': !
5018+ 278..280 '{}': ()
5019+ 290..291 '_': Box<dyn Iterator<Item = &'? [u8]> + 'static>
5020+ 294..298 'iter': Box<dyn Iterator<Item = &'? [u8]> + 'static>
5021+ 294..310 'iter.i...iter()': Box<dyn Iterator<Item = &'? [u8]> + 'static>
5022+ 152..156 'self': &'? mut Box<I>
5023+ 177..208 '{ ... }': Option<Iterator::Item<I>>
5024+ 191..198 'loop {}': !
5025+ 196..198 '{}': ()
5026+ "# ] ] ,
5027+ ) ;
5028+ }
You can’t perform that action at this time.
0 commit comments