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

Bad ambigous error typechecking #3215

Open
philberty opened this issue Oct 24, 2024 · 2 comments
Open

Bad ambigous error typechecking #3215

philberty opened this issue Oct 24, 2024 · 2 comments

Comments

@philberty
Copy link
Member

we're also running into this with this code example - I suspect the fix would be the same and there is something wrong when it comes to references/pointers and mutability:

#![feature(intrinsics)]

#[lang = "sized"]
trait Sized {}

pub struct VaListImpl<'f>;

mod sealed_trait {
    pub trait VaArgSafe {}
}

impl<T> sealed_trait::VaArgSafe for *mut T {}
impl<T> sealed_trait::VaArgSafe for *const T {}

impl<'f> VaListImpl<'f> {
    /// Advance to the next arg.
    #[inline]
    pub unsafe fn arg<T: sealed_trait::VaArgSafe>(&mut self) {
        va_arg2(self);
    }
}

fn va_arg2<T: sealed_trait::VaArgSafe>(ap: &mut VaListImpl<'_>) {}

Originally posted by @CohenArthur in #3032 (comment)

@powerboat9
Copy link
Contributor

It looks like rustc might also find an ambiguity here

@CohenArthur
Copy link
Member

if rustc finds an ambiguity, then my testcase was reduced too far. there was definitely an issue with the original code which was taken directly from core when trying to compile it. I can try and get an old gccrs build to see what it was exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants