Skip to content

std::rt::backtrace::write() call triggers "use of unmarked library feature" error/warning #22429

Closed
@nnethercote

Description

@nnethercote

I compiled this program with a rustc tip build:

//#![feature(unmarked_api)]
#![feature(io)]

struct Blah;

impl Writer for Blah {
    fn write_all(&mut self, buf: &[u8]) -> std::old_io::IoResult<()> {
        Ok(())
    }
}

fn f2() -> i32 {
    let mut blah: Blah = Blah;
    std::rt::backtrace::write(&mut blah).unwrap();
    99
}

fn f1() -> i32 {
    f2()
}

fn main() {
    println!("{}", f1());
}

and got this in the output:

b.rs:14:5: 14:30 error: use of unmarked library feature
b.rs:14     std::rt::backtrace::write(&mut blah).unwrap();
            ^~~~~~~~~~~~~~~~~~~~~~~~~
b.rs:14:5: 14:30 note: this is either a bug in the library you are using and a bug in the compiler - please report it in both places
b.rs:14     std::rt::backtrace::write(&mut blah).unwrap();
            ^~~~~~~~~~~~~~~~~~~~~~~~~
b.rs:14:5: 14:30 note: use #![feature(unmarked_api)] in the crate attributes to override this
b.rs:14     std::rt::backtrace::write(&mut blah).unwrap();

BTW, the "and" in the first note probably should be an "or", to match the "either".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions