Skip to content

Format specifiers and runtime-logging macros die horribly with "use std::*;" #7838

Closed
@bblum

Description

@bblum
Contributor
use std::*;

fn main() {
    println(fmt!("%s", "hello world"));
}

This innocent-looking hello world program emits a zillion horrible errors. Using error!() or fail!() is not pretty either.

horrible.rs:4:23: 4:30 error: unresolved import: could not find `unstable` in `std::std`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: use of undeclared module `::std::unstable::extfmt::rt`
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: `std::unstable::extfmt::rt::Conv` does not name a structure
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved import: could not find `unstable` in `std::std`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: use of undeclared module `::std::unstable::extfmt::rt`
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved name `std::unstable::extfmt::rt::flag_none`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved import: could not find `unstable` in `std::std`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: use of undeclared module `::std::unstable::extfmt::rt`
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved name `std::unstable::extfmt::rt::CountImplied`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved import: could not find `unstable` in `std::std`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: use of undeclared module `::std::unstable::extfmt::rt`
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved name `std::unstable::extfmt::rt::CountImplied`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved import: could not find `unstable` in `std::std`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: use of undeclared module `::std::unstable::extfmt::rt`
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved name `std::unstable::extfmt::rt::TyDefault`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved import: could not find `unstable` in `std::std`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: use of undeclared module `::std::unstable::extfmt::rt`
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
horrible.rs:4:23: 4:30 error: unresolved name `std::unstable::extfmt::rt::conv_str`.
horrible.rs:4     println(fmt!("%s", "hello"));
                                     ^~~~~~~
note: in expansion of fmt!
horrible.rs:4:12: 4:32 note: expansion site
error: aborting due to 18 previous errors

Activity

alexcrichton

alexcrichton commented on Jul 17, 2013

@alexcrichton
Member

Dup of #7580 (although it's not fail it's fmt)

bblum

bblum commented on Jul 17, 2013

@bblum
ContributorAuthor

oops thanks

added a commit that references this issue on Oct 21, 2021

Auto merge of rust-lang#7838 - nhamovitz:trailing_zs_arr_wo_repr, r=M…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcrichton@bblum

        Issue actions

          Format specifiers and runtime-logging macros die horribly with "use std::*;" · Issue #7838 · rust-lang/rust