rust/tests/ui/no_std/no-core-with-explicit-std-core.rs
2025-07-01 15:16:56 +05:00

22 lines
485 B
Rust

//! Test that you can use `#![no_core]` and still import std and core manually.
//!
//! The `#![no_core]` attribute disables the automatic core prelude, but you should
//! still be able to explicitly import both `std` and `core` crates and use types
//! like `Option` normally.
//@ run-pass
#![allow(stable_features)]
#![feature(no_core, core)]
#![no_core]
extern crate core;
extern crate std;
use std::option::Option::Some;
fn main() {
let a = Some("foo");
a.unwrap();
}