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

"multiple applicable items" since raw pointers to unsized implement Debug #37354

Closed
TimNN opened this Issue Oct 22, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@TimNN
Copy link
Contributor

TimNN commented Oct 22, 2016

Breaking change from #36880

use std::fmt::{Formatter, Debug, Pointer};

fn foo(f: &mut Formatter) {
    let a: *const [i32] = &[0] as *const _;
    let _ = a.fmt(f);
}

fn main() {}

Affects mbox v0.1.3.

@TimNN TimNN changed the title multiple applicable items since raw pointers to unsized implement Debug "multiple applicable items" since raw pointers to unsized implement Debug Oct 22, 2016

@nagisa

This comment has been minimized.

Copy link
Contributor

nagisa commented Oct 22, 2016

One of those things we consider not-actually-breaking changes as being more explicit in user code would have prevented the breakage.

Still need to re-evaluate if such a breakage is acceptable for what it brings to the table. Certainly not T-compiler, most likely T-libs.

@TimNN TimNN added T-libs and removed T-compiler labels Oct 22, 2016

@TimNN

This comment has been minimized.

Copy link
Contributor Author

TimNN commented Oct 22, 2016

Certainly not T-compiler, most likely T-libs.

Yes, of course, not sure what I was thinking there...

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Oct 23, 2016

We shouldn't have ever done that bloody "all formatting traits have a fmt method" thing, but my solutions weren't exactly that great either (e.g. unsafe conversion between &T and &fmt::Debug<T>).

Either way there's a reason they're not in the prelude: you should never import those traits.
Just use std::fmt; and use paths from that.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 25, 2016

The libs team discussed this during triage and the conclusion was that this falls under the "acceptable breakage" umbrella and we'll send a patch upstream for this, so closing.

alexcrichton added a commit to alexcrichton/mbox that referenced this issue Oct 25, 2016

Fix compat with nightly Rust
This regression was detected in rust-lang/rust#37354 and the libs team just
wanted to make sure everything kept compiling!

@TimNN TimNN closed this Oct 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.