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

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

Closed
nnethercote opened this issue Feb 17, 2015 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@nnethercote
Copy link
Contributor

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".

steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 17, 2015
@steveklabnik
Copy link
Member

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

Just sumbitted a PR to fix this.

@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Feb 17, 2015
alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 18, 2015
@jethrogb
Copy link
Contributor

Still unmarked in stable, beta, nightly. Note the playpen won't let you compile this at all in stable, beta because of unstable.

use std::rt::backtrace;
use std::io::stdout;

fn main() {
    backtrace::write(&mut stdout());
}

@petrochenkov
Copy link
Contributor

This can be closed - backtrace is private now, even if it were still public it would be fixed by #29083

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

5 participants