Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make create_def a side effect instead of marking the entire query as always red #115613

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 6, 2023

Before this PR:

  • query A creates def id D
  • query A is marked as depending on the always-red node, meaning it will always get re-run
  • in the next run of rustc: query A is not loaded from the incremental cache, but rerun

After this PR:

  • query A creates def id D
  • query system registers this a side effect (just like we collect diagnostics to re-emit them without running a query)
  • in the next run of rustc: query A is loaded from the incremental cache and its side effect is run (thus re-creating def id D without running query A)

r? @cjgillot

TODO:

  • need to make feeding queries a side effect, too. At least ones that aren't written to disk.
  • need to re-feed the def_span query
  • many more tests

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 6, 2023
@cjgillot
Copy link
Contributor

cjgillot commented Sep 6, 2023

Another tricky case:

  1. ensure() query A -> executes side-effect from the cache;
  2. fetch query A's result -> calls the provider for A -> gets to create_def -> ?

We wouldn't want to create 2 definitions where we only ask for one.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 6, 2023

Huh... why does that happen? Shouldn't we already be getting weird diagnostics in that case?

@cjgillot
Copy link
Contributor

cjgillot commented Sep 6, 2023

This happens if we don't have the result of A in the on-disk cache, but still need it later.
IIUC, diagnostic deduplication catches it, so there is no observable effect.

@cjgillot
Copy link
Contributor

cjgillot commented Sep 6, 2023

More precisely: the first call is ensure(), so we don't attempt to compute the result, but still mark the dep-node as green and re-execute side effects. The second call is get(), so we need the result, we don't find it in the on-disk cache, and compute it the only way we know, by calling the provider function.

@cjgillot
Copy link
Contributor

cjgillot commented Sep 6, 2023

The logic is the fallback case in try_load_from_disk_and_cache_in_memory.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 6, 2023

Thanks. I really need to dig into ensure and all its behaviours.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 7, 2023

More precisely: the first call is ensure(), so we don't attempt to compute the result, but still mark the dep-node as green and re-execute side effects. The second call is get(), so we need the result, we don't find it in the on-disk cache, and compute it the only way we know, by calling the provider function.

I did some testing and a code dive, and I don't think that's what's happening.

ensure does not execute side effects. It checks if something is in the cache, and if not, executes that query immediately. The cache lookup itself doesn't perform any actions but set up the dep graph dependency in case of a cache hit.

@cjgillot
Copy link
Contributor

cjgillot commented Sep 7, 2023

ensure() calls get_query_incr with QueryMode::Ensure, which calls ensure_must_run, which calls try_mark_green, which calls try_mark_previous_green, which calls emit_side_effects.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 7, 2023

yay, with this hint I was able to produce an example that actually exhibits an issue

index out of bounds: the len is 9 but the index is 9

oh wait... I even have this issue without doing any other changes to rustc. So it's not even ensure related yet

@cjgillot cjgillot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 9, 2023
@bors
Copy link
Contributor

bors commented Sep 22, 2023

☔ The latest upstream changes (presumably #115920) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot
Copy link
Contributor

The difficulty is to know when to skip creating the DefId and reuse the one created by side-effect replay.

What about adding a new variant Replay to TaskDepsRef?
That variant would hold the list of definitions created by this query in the previous invocation. The nth call to create_def in the query would return the nth DefId in that list.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 25, 2023

Thanks! I was thinking about doing

The nth call to create_def in the query would return the nth DefId in that list.

but didn't know how. I'll investigate the TaskDepsRef solution you hinted at.

@bors
Copy link
Contributor

bors commented Feb 16, 2024

☔ The latest upstream changes (presumably #120486) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the create_def_forever_red branch 2 times, most recently from 6d6b1eb to 6831868 Compare February 16, 2024 17:00
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 16, 2024

@cjgillot I implemented replaying, and that fixes the issues I was able to coax out of incremental tests, could you have a look? I'll keep working on it and adding more tests, but I think I could benefit from a review

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2024
@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 5, 2024

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented Jun 5, 2024

⌛ Trying commit c490a96 with merge 9b0899e...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
Make create_def a side effect instead of marking the entire query as always red

Before this PR:

* query A creates def id D
* query A is marked as depending on the always-red node, meaning it will always get re-run
* in the next run of rustc: query A is not loaded from the incremental cache, but rerun

After this PR:

* query A creates def id D
* query system registers this a side effect (just like we collect diagnostics to re-emit them without running a query)
* in the next run of rustc: query A is loaded from the incremental cache and its side effect is run (thus re-creating def id D without running query A)

r? `@cjgillot`

TODO:

* [ ] need to make feeding queries a side effect, too. At least ones that aren't written to disk.
* [ ] need to re-feed the `def_span` query
* [ ] many more tests
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jun 5, 2024

💔 Test failed - checks-actions

fmease added a commit to fmease/rust that referenced this pull request Jun 6, 2024
Some minor query system cleanups

* Improves diagnostics on conflicting query flags
* removes unnecessary impls
* `track_caller`

pulled out of rust-lang#115613
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 6, 2024
Some minor query system cleanups

* Improves diagnostics on conflicting query flags
* removes unnecessary impls
* `track_caller`

pulled out of rust-lang#115613
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 6, 2024
Some minor query system cleanups

* Improves diagnostics on conflicting query flags
* removes unnecessary impls
* `track_caller`

pulled out of rust-lang#115613
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2024
Rollup merge of rust-lang#126035 - oli-obk:query_macro_errors, r=fmease

Some minor query system cleanups

* Improves diagnostics on conflicting query flags
* removes unnecessary impls
* `track_caller`

pulled out of rust-lang#115613
@bors
Copy link
Contributor

bors commented Jun 7, 2024

☔ The latest upstream changes (presumably #126104) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the create_def_forever_red branch from c490a96 to d428f0a Compare June 7, 2024 05:42
@bors
Copy link
Contributor

bors commented Jun 7, 2024

☔ The latest upstream changes (presumably #125918) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the create_def_forever_red branch from d428f0a to 972210d Compare June 7, 2024 14:32
let _ = tcx.eval_static_initializer(item_def_id);
}
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this block necessary? The previous calls tcx.ensure().eval_static_initializer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just test code to replicate the bug I had initially, it should not land

Comment on lines 1382 to 1816
//
// This call also writes to the value of `source_span` and `expn_that_defined` queries.
// This is fine because:
// - those queries are `eval_always` so we won't miss their result changing;
// - this write will have happened before these queries are called.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment (pre-existing).

Comment on lines +1416 to +1858
TaskDepsRef::Replay { prev_side_effects, created_def_ids } => {
trace!(?created_def_ids, "replay side effects");
trace!("num_defs : {}", prev_side_effects.definitions.len());
let index = created_def_ids.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
let prev_info = &prev_side_effects.definitions[index];
let def_id = self.untracked.definitions.read().local_def_path_hash_to_def_id(
prev_info.hash,
&"should have already recreated def id in try_mark_green",
);
assert_eq!(prev_info.data, data);
assert_eq!(prev_info.parent, parent);
def_id
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is subtle, we should definitely document it somewhere. Here, or on DefIdInfo struct?

@bors
Copy link
Contributor

bors commented Jun 14, 2024

☔ The latest upstream changes (presumably #126439) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 16, 2024
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jun 28, 2024
Some minor query system cleanups

* Improves diagnostics on conflicting query flags
* removes unnecessary impls
* `track_caller`

pulled out of rust-lang/rust#115613
@alex-semenyuk alex-semenyuk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2024
@oli-obk oli-obk force-pushed the create_def_forever_red branch from 972210d to 5ebfe8a Compare December 10, 2024 09:33
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the create_def_forever_red branch from 5ebfe8a to 46c6750 Compare December 18, 2024 10:13
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
#21 exporting to docker image format
#21 sending tarball 28.6s done
#21 DONE 31.6s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
   Compiling rustc_middle v0.0.0 (/checkout/compiler/rustc_middle)
error[E0432]: unresolved import `self::context::Lift`
  --> compiler/rustc_middle/src/ty/mod.rs:66:85
   |
66 |     CtxtInterners, CurrentGcx, DeducedParamAttrs, Feed, FreeRegionInfo, GlobalCtxt, Lift, TyCtxt,
   |                                                                                     |
   |                                                                                     no `Lift` in `ty::context`
   |                                                                                     help: a similar name exists in the module: `Lint`
   |
   |
   = help: consider importing one of these traits instead:
           crate::ty::lift::Lift
           rustc_type_ir::lift::Lift

error: cannot find macro `trace` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1847:21
     |
1847 |                     trace!("num_defs : {}", prev_side_effects.definitions.len());
     |
help: consider importing this macro
     |
7    + use tracing::trace;
7    + use tracing::trace;
     |

error: cannot find macro `trace` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1846:21
     |
1846 |                     trace!(?created_def_ids, "replay side effects");
     |
help: consider importing this macro
     |
7    + use tracing::trace;
7    + use tracing::trace;
     |

error: cannot find macro `trace` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1836:21
     |
1836 |                     trace!(?def_id, "record side effects");
     |
help: consider importing this macro
     |
7    + use tracing::trace;
7    + use tracing::trace;
     |

error: cannot find macro `trace` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1827:21
     |
1827 |                     trace!(?def_id, "ignore");
     |
help: consider importing this macro
     |
7    + use tracing::trace;
7    + use tracing::trace;
     |

error: cannot find macro `trace` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1821:21
     |
1821 |                     trace!(?def_id, "eval always");
     |
help: consider importing this macro
     |
7    + use tracing::trace;
7    + use tracing::trace;
     |

error[E0433]: failed to resolve: use of undeclared crate or module `search_graph`
   --> compiler/rustc_middle/src/ty/context.rs:168:55
    |
168 |     fn with_global_cache<R>(self, f: impl FnOnce(&mut search_graph::GlobalCache<Self>) -> R) -> R {
    |                                                       ^^^^^^^^^^^^ use of undeclared crate or module `search_graph`
help: consider importing one of these modules
    |
7   + use crate::ty::search_graph;
    |
    |
7   + use rustc_type_ir::search_graph;
    |

error[E0405]: cannot find trait `TypeFoldable` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:176:34
    |
176 |     fn expand_abstract_consts<T: TypeFoldable<TyCtxt<'tcx>>>(self, t: T) -> T {
    |
help: consider importing one of these traits
    |
7   + use crate::ty::TypeFoldable;
7   + use crate::ty::TypeFoldable;
    |
7   + use rustc_type_ir::fold::TypeFoldable;
    |

error[E0412]: cannot find type `TraitSolverLangItem` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:413:43
    |
413 |     fn require_lang_item(self, lang_item: TraitSolverLangItem) -> DefId {
    |
help: consider importing one of these enums
    |
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

error[E0412]: cannot find type `TraitSolverLangItem` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:417:53
    |
    |
417 |     fn is_lang_item(self, def_id: DefId, lang_item: TraitSolverLangItem) -> bool {
    |
help: consider importing one of these enums
    |
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

error[E0412]: cannot find type `TraitSolverLangItem` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:421:52
    |
    |
421 |     fn as_lang_item(self, def_id: DefId) -> Option<TraitSolverLangItem> {
    |
help: consider importing one of these enums
    |
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

error[E0405]: cannot find trait `TypeFoldable` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:626:32
    |
    |
626 |     fn anonymize_bound_vars<T: TypeFoldable<TyCtxt<'tcx>>>(
    |
help: consider importing one of these traits
    |
7   + use crate::ty::TypeFoldable;
7   + use crate::ty::TypeFoldable;
    |
7   + use rustc_type_ir::fold::TypeFoldable;
    |

error[E0412]: cannot find type `TraitSolverLangItem` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:640:52
    |
638 | / macro_rules! bidirectional_lang_item_map {
639 | |     ($($name:ident),+ $(,)?) => {
640 | |         fn trait_lang_item_to_lang_item(lang_item: TraitSolverLangItem) -> LangItem {
641 | |             match lang_item {
...   |
652 | |     }
653 | | }
---
    | |_- in this macro invocation
    |
help: consider importing one of these enums
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

error[E0433]: failed to resolve: use of undeclared type `TraitSolverLangItem`
   --> compiler/rustc_middle/src/ty/context.rs:642:19
    |
    |
638 | / macro_rules! bidirectional_lang_item_map {
639 | |     ($($name:ident),+ $(,)?) => {
640 | |         fn trait_lang_item_to_lang_item(lang_item: TraitSolverLangItem) -> LangItem {
641 | |             match lang_item {
642 | |                 $(TraitSolverLangItem::$name => LangItem::$name,)+
    | |                   ^^^^^^^^^^^^^^^^^^^ use of undeclared type `TraitSolverLangItem`
652 | |     }
653 | | }
    | |_- in this expansion of `bidirectional_lang_item_map!`
654 |
---
    | |_- in this macro invocation
    |
help: consider importing one of these enums
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

   Compiling rustc_ast_passes v0.0.0 (/checkout/compiler/rustc_ast_passes)
error[E0412]: cannot find type `TraitSolverLangItem` in this scope
   --> compiler/rustc_middle/src/ty/context.rs:646:72
   --> compiler/rustc_middle/src/ty/context.rs:646:72
    |
638 | / macro_rules! bidirectional_lang_item_map {
639 | |     ($($name:ident),+ $(,)?) => {
640 | |         fn trait_lang_item_to_lang_item(lang_item: TraitSolverLangItem) -> LangItem {
...   |
...   |
646 | |         fn lang_item_to_trait_lang_item(lang_item: LangItem) -> Option<TraitSolverLangItem> {
...   |
652 | |     }
653 | | }
    | |_- in this expansion of `bidirectional_lang_item_map!`
---
    | |_- in this macro invocation
    |
help: consider importing one of these enums
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

error[E0433]: failed to resolve: use of undeclared type `TraitSolverLangItem`
   --> compiler/rustc_middle/src/ty/context.rs:648:38
    |
    |
638 | / macro_rules! bidirectional_lang_item_map {
639 | |     ($($name:ident),+ $(,)?) => {
640 | |         fn trait_lang_item_to_lang_item(lang_item: TraitSolverLangItem) -> LangItem {
...   |
...   |
648 | |                 $(LangItem::$name => TraitSolverLangItem::$name,)+
    | |                                      ^^^^^^^^^^^^^^^^^^^ use of undeclared type `TraitSolverLangItem`
652 | |     }
653 | | }
    | |_- in this expansion of `bidirectional_lang_item_map!`
654 |
---
    | |_- in this macro invocation
    |
help: consider importing one of these enums
    |
7   + use crate::ty::lang_items::TraitSolverLangItem;
    |
7   + use rustc_type_ir::lang_items::TraitSolverLangItem;

   Compiling rustc_expand v0.0.0 (/checkout/compiler/rustc_expand)
error[E0433]: failed to resolve: use of undeclared crate or module `search_graph`
    --> compiler/rustc_middle/src/ty/context.rs:1338:43
    --> compiler/rustc_middle/src/ty/context.rs:1338:43
     |
1338 |     pub new_solver_evaluation_cache: Lock<search_graph::GlobalCache<TyCtxt<'tcx>>>,
     |                                           ^^^^^^^^^^^^ use of undeclared crate or module `search_graph`
help: consider importing one of these modules
     |
7    + use crate::ty::search_graph;
     |
     |
7    + use rustc_type_ir::search_graph;
     |

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1480:20
     |
1480 |     pub fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted> {
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0422]: cannot find struct, variant or union type `DefIdInfo` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:1838:80
     |
     |
1838 |                     icx.side_effects.as_ref().unwrap().lock().definitions.push(DefIdInfo {
     |
help: consider importing this struct
     |
7    + use rustc_query_system::query::DefIdInfo;
7    + use rustc_query_system::query::DefIdInfo;
     |

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2203 |   nop_lift! {type_; Ty<'a> => Ty<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2204 |   nop_lift! {region; Region<'a> => Region<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2205 |   nop_lift! {const_; Const<'a> => Const<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2206 |   nop_lift! {pat; Pattern<'a> => Pattern<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2207 |   nop_lift! {const_allocation; ConstAllocation<'a> => ConstAllocation<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2208 |   nop_lift! {predicate; Predicate<'a> => Predicate<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2209 |   nop_lift! {predicate; Clause<'a> => Clause<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2148:24
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
     | |                        ^^^^ not found in this scope
2149 | |             type Lifted = $lifted;
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2210 |   nop_lift! {layout; Layout<'a> => Layout<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2183:24
     |
     |
2181 | / macro_rules! nop_list_lift {
2182 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2183 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
     | |                        ^^^^ not found in this scope
2184 | |             type Lifted = &'tcx List<$lifted>;
2200 | |     };
2201 | | }
2201 | | }
     | |_- in this expansion of `nop_list_lift!`
...
2212 |   nop_list_lift! {type_lists; Ty<'a> => Ty<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2183:24
     |
     |
2181 | / macro_rules! nop_list_lift {
2182 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2183 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
     | |                        ^^^^ not found in this scope
2184 | |             type Lifted = &'tcx List<$lifted>;
2200 | |     };
2201 | | }
2201 | | }
     | |_- in this expansion of `nop_list_lift!`
...
2213 |   nop_list_lift! {poly_existential_predicates; PolyExistentialPredicate<'a> => PolyExistentialPredicate<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2183:24
     |
     |
2181 | / macro_rules! nop_list_lift {
2182 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2183 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
     | |                        ^^^^ not found in this scope
2184 | |             type Lifted = &'tcx List<$lifted>;
2200 | |     };
2201 | | }
2201 | | }
     | |_- in this expansion of `nop_list_lift!`
...
2214 |   nop_list_lift! {bound_variable_kinds; ty::BoundVariableKind => ty::BoundVariableKind}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2183:24
     |
     |
2181 | / macro_rules! nop_list_lift {
2182 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2183 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
     | |                        ^^^^ not found in this scope
2184 | |             type Lifted = &'tcx List<$lifted>;
2200 | |     };
2201 | | }
2201 | | }
     | |_- in this expansion of `nop_list_lift!`
...
2217 |   nop_list_lift! {args; GenericArg<'a> => GenericArg<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0405]: cannot find trait `Lift` in this scope
    --> compiler/rustc_middle/src/ty/context.rs:2221:24
     |
     |
2219 | / macro_rules! nop_slice_lift {
2220 | |     ($ty:ty => $lifted:ty) => {
2221 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a [$ty] {
     | |                        ^^^^ not found in this scope
2222 | |             type Lifted = &'tcx [$lifted];
2234 | |     };
2235 | | }
     | |_- in this expansion of `nop_slice_lift!`
2236 |
2236 |
2237 |   nop_slice_lift! {ty::ValTree<'a> => ty::ValTree<'tcx>}
     |
help: consider importing one of these traits
     |
     |
7    + use crate::ty::lift::Lift;
     |
7    + use rustc_type_ir::lift::Lift;

error[E0220]: associated type `Lifted` not found for `T`
    --> compiler/rustc_middle/src/ty/context.rs:1480:69
     |
     |
1480 |     pub fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted> {
     |                                                                     ^^^^^^ there is an associated type `Lifted` in the trait `Lift`
help: consider further restricting this bound
     |
     |
1480 |     pub fn lift<T: Lift<TyCtxt<'tcx>> + Lift</* I */>>(self, value: T) -> Option<T::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2203 |   nop_lift! {type_; Ty<'a> => Ty<'tcx>}
     |
     |
help: if there were a trait named `Example` with associated type `Lifted` implemented for `ty::Ty<'a>`, you could use the fully-qualified path
     |
2150 |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<<ty::Ty<'a> as Example>::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2204 |   nop_lift! {region; Region<'a> => Region<'tcx>}
     |
     |
help: if there were a trait named `Example` with associated type `Lifted` implemented for `ty::region::Region<'a>`, you could use the fully-qualified path
     |
2150 |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<<ty::region::Region<'a> as Example>::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2205 |   nop_lift! {const_; Const<'a> => Const<'tcx>}
     |
     |
help: if there were a trait named `Example` with associated type `Lifted` implemented for `ty::consts::Const<'a>`, you could use the fully-qualified path
     |
2150 |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<<ty::consts::Const<'a> as Example>::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2206 |   nop_lift! {pat; Pattern<'a> => Pattern<'tcx>}
     |
     |
help: if there were a trait named `Example` with associated type `Lifted` implemented for `ty::pattern::Pattern<'a>`, you could use the fully-qualified path
     |
2150 |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<<ty::pattern::Pattern<'a> as Example>::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2207 |   nop_lift! {const_allocation; ConstAllocation<'a> => ConstAllocation<'tcx>}
     |
     |
help: if there were a trait named `Example` with associated type `Lifted` implemented for `ConstAllocation<'a>`, you could use the fully-qualified path
     |
2150 |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<<ConstAllocation<'a> as Example>::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }
2179 | | }
     | |_- in this expansion of `nop_lift!`
...
2208 |   nop_lift! {predicate; Predicate<'a> => Predicate<'tcx>}
     |
     |
help: if there were a trait named `Example` with associated type `Lifted` implemented for `predicate::Predicate<'a>`, you could use the fully-qualified path
     |
2150 |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<<predicate::Predicate<'a> as Example>::Lifted> {

error[E0223]: ambiguous associated type
    --> compiler/rustc_middle/src/ty/context.rs:2150:68
     |
     |
2146 | / macro_rules! nop_lift {
2147 | |     ($set:ident; $ty:ty => $lifted:ty) => {
2148 | |         impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
2149 | |             type Lifted = $lifted;
2150 | |             fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
...    |
2178 | |     };
2179 | | }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

7 participants