mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
Rollup merge of #111861 - compiler-errors:rtn-in-super, r=jackh726
Don't ICE on return-type notation when promoting trait preds to associated type bounds Fixes #111846
This commit is contained in:
commit
224b6511b1
@ -427,6 +427,8 @@ pub(super) fn explicit_predicates_of<'tcx>(
|
||||
// supertrait).
|
||||
if let ty::Alias(ty::Projection, projection) = ty.kind() {
|
||||
projection.substs == trait_identity_substs
|
||||
// FIXME(return_type_notation): This check should be more robust
|
||||
&& !tcx.is_impl_trait_in_trait(projection.def_id)
|
||||
&& tcx.associated_item(projection.def_id).container_id(tcx)
|
||||
== def_id.to_def_id()
|
||||
} else {
|
||||
|
@ -0,0 +1,11 @@
|
||||
// check-pass
|
||||
|
||||
#![feature(return_position_impl_trait_in_trait, return_type_notation)]
|
||||
//~^ WARN the feature `return_type_notation` is incomplete and may not be safe to use
|
||||
|
||||
trait IntFactory {
|
||||
fn stream(&self) -> impl Iterator<Item = i32>;
|
||||
}
|
||||
trait SendIntFactory: IntFactory<stream(): Send> + Send {}
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,11 @@
|
||||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/supertrait-bound.rs:3:49
|
||||
|
|
||||
LL | #![feature(return_position_impl_trait_in_trait, return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
Loading…
Reference in New Issue
Block a user