-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Traits can be inherited multiple times without rustc throwing an error #3953
Comments
I have a fix, just testing it. |
I am not sure that this is a bug. Depending on the rules we settle on, it might be reasonable to allow (for example)
and trait semantics are designed to ensure that this has a reasonable meaning (as indeed does |
My feeling is that while C: A, B as in your example is reasonable, |
Fixed pthread_getname_np impl for glibc The behavior of `glibc` differs a bit different for `pthread_getname_np` from other implementations. It requires the buffer to be at least 16 bytes wide without exception. [Docs](https://www.man7.org/linux/man-pages/man3/pthread_setname_np.3.html): ``` The pthread_getname_np() function can be used to retrieve the name of the thread. The thread argument specifies the thread whose name is to be retrieved. The buffer name is used to return the thread name; size specifies the number of bytes available in name. The buffer specified by name should be at least 16 characters in length. The returned thread name in the output buffer will be null terminated. ``` [Source](https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getname.c;hb=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307#l37): ```c int __pthread_getname_np (pthread_t th, char *buf, size_t len) { const struct pthread *pd = (const struct pthread *) th; /* Unfortunately the kernel headers do not export the TASK_COMM_LEN macro. So we have to define it here. */ #define TASK_COMM_LEN 16 if (len < TASK_COMM_LEN) return ERANGE; ```
The code below compiles and executes fine:
Surely rustc should throw an error...?
The text was updated successfully, but these errors were encountered: