This repository was archived by the owner on May 23, 2024. It is now read-only.
ices/108271-2.rs: fixed with errors#1719
Open
github-actions[bot] wants to merge 1 commit intomasterfrom
Open
Conversation
=== stdout === === stderr === error[E0658]: associated const equality is incomplete --> /home/runner/work/glacier/glacier/ices/108271-2.rs:5:35 | 5 | const A: dyn TraitWAssocConst<A = 0>; | ^^^^^ | = note: see issue #92827 <rust-lang/rust#92827> for more information = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable = note: this compiler was built on 2024-03-18; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete --> /home/runner/work/glacier/glacier/ices/108271-2.rs:8:28 | 8 | fn bar<A: TraitWAssocConst<A = 0>>() {} | ^^^^^ | = note: see issue #92827 <rust-lang/rust#92827> for more information = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable = note: this compiler was built on 2024-03-18; consider upgrading it if it is out of date error[E0391]: cycle detected when computing type of `TraitWAssocConst::A` --> /home/runner/work/glacier/glacier/ices/108271-2.rs:5:5 | 5 | const A: dyn TraitWAssocConst<A = 0>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ...which immediately requires computing type of `TraitWAssocConst::A` again note: cycle used when computing explicit predicates of `bar` --> /home/runner/work/glacier/glacier/ices/108271-2.rs:8:1 | 8 | fn bar<A: TraitWAssocConst<A = 0>>() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error: the type of the associated constant `A` must not depend on generic parameters --> /home/runner/work/glacier/glacier/ices/108271-2.rs:8:28 | 8 | fn bar<A: TraitWAssocConst<A = 0>>() {} | - ^ its type must not depend on the type parameter `A` | | | the type parameter `A` is defined here error: associated item referring to unboxed trait object for its own trait --> /home/runner/work/glacier/glacier/ices/108271-2.rs:5:14 | 4 | pub trait TraitWAssocConst { | ---------------- in this trait 5 | const A: dyn TraitWAssocConst<A = 0>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: you might have meant to use `Self` to refer to the implementing type | 5 | const A: Self; | ~~~~ error[E0038]: the trait `TraitWAssocConst` cannot be made into an object --> /home/runner/work/glacier/glacier/ices/108271-2.rs:5:14 | 5 | const A: dyn TraitWAssocConst<A = 0>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `TraitWAssocConst` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> /home/runner/work/glacier/glacier/ices/108271-2.rs:5:11 | 4 | pub trait TraitWAssocConst { | ---------------- this trait cannot be made into an object... 5 | const A: dyn TraitWAssocConst<A = 0>; | ^ ...because it contains this associated `const` = help: consider moving `A` to another trait error: aborting due to 6 previous errors Some errors have detailed explanations: E0038, E0391, E0658. For more information about an error, try `rustc --explain E0038`. ==============
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: rust-lang/rust#108271