rust icon indicating copy to clipboard operation
rust copied to clipboard

nll-relate: improve hr opaque types support

Open lcnr opened this issue 7 months ago • 1 comments

blocked on rust-lang/rust#142071

r? types

lcnr avatar Jun 05 '25 13:06 lcnr

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_middle v0.0.0 (/checkout/compiler/rustc_middle)
[RUSTC-TIMING] rustc_attr_parsing test:false 3.270
[RUSTC-TIMING] rustc_query_system test:false 3.357
[RUSTC-TIMING] rustc_session test:false 8.509
error[E0700]: hidden type for `impl std::iter::Iterator<Item = rustc_span::def_id::DefId>` captures lifetime that does not appear in bounds
   --> compiler/rustc_middle/src/ty/trait_def.rs:186:9
    |
176 |     ) -> impl Iterator<Item = DefId> {
    |          --------------------------- opaque type defined here
...
186 |         [].iter().copied()
    |         ^^^^^^^^^^^^^^^^^^
    |
    = note: hidden type `Copied<std::slice::Iter<'_, rustc_span::def_id::DefId>>` captures lifetime `'_`

error[E0700]: hidden type for `impl std::iter::Iterator<Item = rustc_span::def_id::DefId>` captures lifetime that does not appear in bounds
    --> compiler/rustc_middle/src/ty/context.rs:2295:9
     |
2291 |       pub fn visible_traits(self) -> impl Iterator<Item = DefId> {
     |                                      --------------------------- opaque type defined here
...
2295 | /         iter::once(LOCAL_CRATE)
2296 | |             .chain(visible_crates)
2297 | |             .flat_map(move |cnum| self.traits(cnum).iter().copied())
     | |____________________________________________________________________^
     |
     = note: hidden type `FlatMap<std::iter::Chain<std::iter::Once<rustc_span::def_id::CrateNum>, Filter<Copied<std::slice::Iter<'_, rustc_span::def_id::CrateNum>>, {closure@compiler/rustc_middle/src/ty/context.rs:2293:52: 2293:63}>>, Copied<std::slice::Iter<'tcx, rustc_span::def_id::DefId>>, {closure@compiler/rustc_middle/src/ty/context.rs:2297:23: 2297:34}>` captures lifetime `'_`

error[E0700]: hidden type for `impl Iterator<Item = ...> + DoubleEndedIterator + ExactSizeIterator` captures lifetime that does not appear in bounds
   --> compiler/rustc_middle/src/ty/generics.rs:378:9
    |
377 |     ) -> impl Iterator<Item = (Clause<'tcx>, Span)> + DoubleEndedIterator + ExactSizeIterator {
    |          ------------------------------------------------------------------------------------ opaque type defined here
378 |         EarlyBinder::bind(self.predicates).iter_instantiated_copied(tcx, args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: hidden type `IterInstantiatedCopied<'_, context::TyCtxt<'tcx>, &'tcx [(predicate::Clause<'tcx>, rustc_span::Span)]>` captures lifetime `'_`
    = note: the full name for the type has been written to '/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_middle-75e530dd71570b3d.long-type-3836989807784408509.txt'
    = note: consider using `--verbose` to print the full type name to the console

error[E0700]: hidden type for `impl Iterator<Item = ...> + DoubleEndedIterator + ExactSizeIterator` captures lifetime that does not appear in bounds
   --> compiler/rustc_middle/src/ty/generics.rs:449:9
    |
447 |     ) -> impl Iterator<Item = (ty::PolyTraitRef<'tcx>, Span)> + DoubleEndedIterator + ExactSizeIterator
    |          ---------------------------------------------------------------------------------------------- opaque type defined here
448 |     {
449 |         EarlyBinder::bind(self.predicates).iter_instantiated_copied(tcx, args)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: hidden type `IterInstantiatedCopied<'_, context::TyCtxt<'tcx>, &'tcx [(rustc_type_ir::Binder<context::TyCtxt<'tcx>, rustc_type_ir::TraitRef<context::TyCtxt<'tcx>>>, rustc_span::Span)]>` captures lifetime `'_`
    = note: the full name for the type has been written to '/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_middle-75e530dd71570b3d.long-type-14247980776413188929.txt'
    = note: consider using `--verbose` to print the full type name to the console

error[E0700]: hidden type for `impl Iterator<Item = Binder<TyCtxt<'tcx>, ExistentialPredicate<...>>>` captures lifetime that does not appear in bounds
   --> compiler/rustc_middle/src/ty/predicate.rs:352:9
    |
351 |       pub fn without_auto_traits(&self) -> impl Iterator<Item = ty::PolyExistentialPredicate<'tcx>> {
    |                                            -------------------------------------------------------- opaque type defined here
352 | /         self.iter().filter(|predicate| {
353 | |             !matches!(predicate.as_ref().skip_binder(), ExistentialPredicate::AutoTrait(_))
354 | |         })
    | |__________^
    |
    = note: hidden type `Filter<Copied<std::slice::Iter<'_, rustc_type_ir::Binder<context::TyCtxt<'tcx>, rustc_type_ir::ExistentialPredicate<context::TyCtxt<'tcx>>>>>, {closure@compiler/rustc_middle/src/ty/predicate.rs:352:28: 352:39}>` captures lifetime `'_`
    = note: the full name for the type has been written to '/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_middle-75e530dd71570b3d.long-type-15332952601754336030.txt'
    = note: consider using `--verbose` to print the full type name to the console

   Compiling rustc_ast_passes v0.0.0 (/checkout/compiler/rustc_ast_passes)
   Compiling rustc_expand v0.0.0 (/checkout/compiler/rustc_expand)
[RUSTC-TIMING] rustc_ast_passes test:false 4.532

rust-log-analyzer avatar Jun 05 '25 13:06 rust-log-analyzer

:umbrella: The latest upstream changes (presumably #142071) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Aug 15 '25 23:08 bors

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

rustbot avatar Aug 18 '25 07:08 rustbot

@rustbot ready

lcnr avatar Aug 18 '25 07:08 lcnr

@bors r+ rollup

BoxyUwU avatar Aug 18 '25 13:08 BoxyUwU

:pushpin: Commit f5e43d5ee31f0740a96479b4ffa2dcff009c226f has been approved by BoxyUwU

It is now in the queue for this repository.

bors avatar Aug 18 '25 13:08 bors