Skip to content

Confusing owned_box error message since nightly-2019-09-04 #64430

@phil-opp

Description

@phil-opp

Test Program:

// lib.rs

#![no_std]

pub fn foo() {
    pub struct Writer;
    write!(Writer, "");
}

Error message on nightly [9af1775 2019-09-02] and before:

error[E0599]: no method named `write_fmt` found for type `foo::Writer` in the current scope
 --> src/lib.rs:5:5
  |
4 |     pub struct Writer;
  |     ------------------ method `write_fmt` not found for this
5 |     write!(Writer, "");
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = help: items from traits can only be used if the trait is implemented and in scope
  = note: the following trait defines an item `write_fmt`, perhaps you need to implement it:
          candidate #1: `core::fmt::Write`
  = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Error message since nightly [b9de4ef 2019-09-03]:

error: requires `owned_box` lang_item

error: aborting due to previous error

Diff Between the Nightlies: 9af1775...b9de4ef


Reported by @wgfm and @ambye85 in phil-opp/blog_os#405 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions