-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Unconditionally-const supertraits are considered not dyn compatible #145627
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
Unconditionally-const supertraits are considered not dyn compatible #145627
Conversation
d367474
to
a65a29d
Compare
if !tcx.features().const_trait_impl() { | ||
return SmallVec::new(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong? If I am a downstream crate that attempts to use a trait upstream that has : const Tr
, then I should see that the trait isn't dyn compatible no matter whether I enable const_trait_impl
.
I checked the callers of this and it looks like it's not limited to just local items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I kinda don't care about crate composability when it comes to nightly features, but I think it's fine to just remove this check and always run it. There isn't much of an overhead.
a65a29d
to
e57e5f0
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…r=<try> Unconditionally-const supertraits are considered not dyn compatible
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (1d5de18): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 1.6%, secondary -2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 471.66s -> 471.441s (-0.05%) |
@bors r+ rollup |
…yn-compat, r=fee1-dead Unconditionally-const supertraits are considered not dyn compatible Let's save some space in the design of const traits by making `dyn Trait` where `trait Trait: const Super` not dyn compatible. Such a trait cannot satisfy `dyn Trait: Trait`; we could in the future make this dyn compatible but *NOT* implement `Trait`, but that's a bit weird and seems like it needs to be independently justified moving forward. Fixes rust-lang#145198 r? fee1-dead
Rollup of 19 pull requests Successful merges: - #143383 (stabilize `const_array_each_ref`) - #144758 ([Doc] Add links to the various collections) - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145297 (fix(debuginfo): handle false positives in overflow check) - #145390 (Shorten some dependency chains in the compiler) - #145415 (std_detect: RISC-V: implement implication to "C") - #145525 (stdlib: Replace typedef -> type alias in doc comment) - #145590 (Prevent impossible combinations in `ast::ModKind`.) - #145593 (UnsafePinned::raw_get: sync signature with get) - #145621 (Fix some doc typos) - #145627 (Unconditionally-const supertraits are considered not dyn compatible) - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause) - #145650 (Fix JS search scripts path) - #145654 (Download CI GCC into the correct directory) - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions) - #145673 (Add flock support for cygwin) - #145674 (Enable triagebot `[review-changes-since]` feature) - #145678 (Fix typo in docstring) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145627 - compiler-errors:const-supertrait-dyn-compat, r=fee1-dead Unconditionally-const supertraits are considered not dyn compatible Let's save some space in the design of const traits by making `dyn Trait` where `trait Trait: const Super` not dyn compatible. Such a trait cannot satisfy `dyn Trait: Trait`; we could in the future make this dyn compatible but *NOT* implement `Trait`, but that's a bit weird and seems like it needs to be independently justified moving forward. Fixes #145198 r? fee1-dead
Let's save some space in the design of const traits by making
dyn Trait
wheretrait Trait: const Super
not dyn compatible.Such a trait cannot satisfy
dyn Trait: Trait
; we could in the future make this dyn compatible but NOT implementTrait
, but that's a bit weird and seems like it needs to be independently justified moving forward.Fixes #145198
r? fee1-dead