File tree 3 files changed +24
-0
lines changed
compiler/rustc_hir_analysis/src/collect
tests/ui/async-await/return-type-notation
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,8 @@ pub(super) fn explicit_predicates_of<'tcx>(
427
427
// supertrait).
428
428
if let ty:: Alias ( ty:: Projection , projection) = ty. kind ( ) {
429
429
projection. substs == trait_identity_substs
430
+ // FIXME(return_type_notation): This check should be more robust
431
+ && !tcx. is_impl_trait_in_trait ( projection. def_id )
430
432
&& tcx. associated_item ( projection. def_id ) . container_id ( tcx)
431
433
== def_id. to_def_id ( )
432
434
} else {
Original file line number Diff line number Diff line change
1
+ // check-pass
2
+
3
+ #![ feature( return_position_impl_trait_in_trait, return_type_notation) ]
4
+ //~^ WARN the feature `return_type_notation` is incomplete and may not be safe to use
5
+
6
+ trait IntFactory {
7
+ fn stream ( & self ) -> impl Iterator < Item = i32 > ;
8
+ }
9
+ trait SendIntFactory : IntFactory < stream ( ) : Send > + Send { }
10
+
11
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
2
+ --> $DIR/supertrait-bound.rs:3:49
3
+ |
4
+ LL | #![feature(return_position_impl_trait_in_trait, return_type_notation)]
5
+ | ^^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
8
+ = note: `#[warn(incomplete_features)]` on by default
9
+
10
+ warning: 1 warning emitted
11
+
You can’t perform that action at this time.
0 commit comments