Files
rust/tests/ui/no_std/no-core-with-explicit-std-core.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
485 B
Rust
Raw Normal View History

2025-06-30 00:05:58 +05:00
//! 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;
2025-06-30 00:05:58 +05:00
extern crate std;
use std::option::Option::Some;
fn main() {
let a = Some("foo");
a.unwrap();
}