rust/tests/ui/privacy/privacy4.rs
David Wood 322cc31504
tests: {Meta,Pointee}Sized in non-minicore tests
As before, add `MetaSized` and `PointeeSized` traits to all of the
non-minicore `no_core` tests so that they don't fail for lack of
language items.
2025-06-16 23:04:33 +00:00

28 lines
608 B
Rust

#![feature(lang_items, no_core)]
#![no_core] // makes debugging this test *a lot* easier (during resolve)
#[lang = "sized"] pub trait Sized: MetaSized {}
#[lang = "meta_sized"] pub trait MetaSized: PointeeSized {}
#[lang = "pointee_sized"] pub trait PointeeSized {}
#[lang="copy"] pub trait Copy {}
// Test to make sure that private items imported through globs remain private
// when they're used.
mod bar {
pub use self::glob::*;
mod glob {
fn gpriv() {}
}
}
pub fn foo() {}
fn test2() {
use bar::glob::gpriv; //~ ERROR: module `glob` is private
gpriv();
}
fn main() {}