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

marker traits, cannot prefer impl with no bounds #109481

Open
lcnr opened this issue Mar 22, 2023 · 0 comments
Open

marker traits, cannot prefer impl with no bounds #109481

lcnr opened this issue Mar 22, 2023 · 0 comments
Labels
C-bug Category: This is a bug. F-marker_trait_attr `#![feature(marker_trait_attr)]` S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Mar 22, 2023

tracked in test suite as tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs, only relevant after #102472

// known-bug: #109481
//
// While the `T: Copy` is always applicable when checking
// that the impl `impl<T: Copy> F for T {}` is well formed,
// the old trait solver can only approximate this by checking
// that there are no inference variables in the obligation and
// no region constraints in the evaluation result.
//
// Because of this we end up with ambiguity here.
#![feature(marker_trait_attr)]

#[marker]
pub trait F {}
impl<T: Copy> F for T {}
impl<T: 'static> F for T {}

fn main() {}
@lcnr lcnr added C-bug Category: This is a bug. F-marker_trait_attr `#![feature(marker_trait_attr)]` labels Mar 22, 2023
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
@jackh726 jackh726 added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-marker_trait_attr `#![feature(marker_trait_attr)]` S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants