Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8dec09f
support wasm inline assembly in naked functions
folkertdev Jan 15, 2025
bcf478b
work around the `wasm32-unknown-unknown` ABI being broken
folkertdev Jan 17, 2025
bf5e634
proc_macro: add `#![warn(unreachable_pub)]`
Urgau Jan 9, 2025
939b704
test: add `#![warn(unreachable_pub)]`
Urgau Jan 9, 2025
00381ea
Make it possible to build GCC on CI
Kobzol Jan 2, 2025
9b70b8b
CI: free disk with in-tree script instead of GitHub Action
marcoieni Jan 21, 2025
aef640a
Only assert the `Parser` size on specific arches
cuviper Jan 22, 2025
eb3b3fe
ci: use 8 core arm runner for dist-aarch64-linux
marcoieni Jan 22, 2025
2a544ab
Target modifiers (special marked options) are recorded in metainfo an…
azhogin Nov 17, 2024
87f7535
Reword "crate not found" resolve message
estebank Nov 18, 2024
6b06aa6
Enable kernel sanitizers for aarch64-unknown-none-softfloat
workingjubilee Jan 22, 2025
ff39ce9
Rollup merge of #133138 - azhogin:azhogin/target-modifiers, r=davidtw…
jhpratt Jan 23, 2025
76f57a5
Rollup merge of #133154 - estebank:issue-133137, r=wesleywiser
jhpratt Jan 23, 2025
f05e0c1
Rollup merge of #135366 - Urgau:unreach_pub-std-2, r=cuviper
jhpratt Jan 23, 2025
6e33327
Rollup merge of #135638 - Kobzol:gcc-ci, r=onur-ozkan
jhpratt Jan 23, 2025
781e01f
Rollup merge of #135648 - folkertdev:naked-asm-wasm, r=bjorn3
jhpratt Jan 23, 2025
c7413a6
Rollup merge of #135827 - marcoieni:free-space-script, r=Kobzol
jhpratt Jan 23, 2025
a91ac7d
Rollup merge of #135855 - cuviper:parser-size, r=wesleywiser
jhpratt Jan 23, 2025
b03ec03
Rollup merge of #135878 - marcoieni:dist-aarch64-linux-8c, r=Kobzol
jhpratt Jan 23, 2025
30177b8
Rollup merge of #135905 - workingjubilee:softly-sanitize-aarch64-floa…
jhpratt Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/proc_macro/src/bridge/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::marker::PhantomData;

#[repr(C)]
pub struct Closure<'a, A, R> {
pub(super) struct Closure<'a, A, R> {
call: unsafe extern "C" fn(*mut Env, A) -> R,
env: *mut Env,
// Prevent Send and Sync impls. `!Send`/`!Sync` is the usual way of doing
Expand All @@ -26,7 +26,7 @@ impl<'a, A, R, F: FnMut(A) -> R> From<&'a mut F> for Closure<'a, A, R> {
}

impl<'a, A, R> Closure<'a, A, R> {
pub fn call(&mut self, arg: A) -> R {
pub(super) fn call(&mut self, arg: A) -> R {
unsafe { (self.call)(self.env, arg) }
}
}
4 changes: 2 additions & 2 deletions library/proc_macro/src/bridge/fxhash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::hash::{BuildHasherDefault, Hasher};
use std::ops::BitXor;

/// Type alias for a hashmap using the `fx` hash algorithm.
pub type FxHashMap<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;
pub(super) type FxHashMap<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;

/// A speedy hash algorithm for use within rustc. The hashmap in alloc by
/// default uses SipHash which isn't quite as speedy as we want. In the compiler
Expand All @@ -23,7 +23,7 @@ pub type FxHashMap<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;
/// similar or slightly worse than FNV, but the speed of the hash function
/// itself is much higher because it works on up to 8 bytes at a time.
#[derive(Default)]
pub struct FxHasher {
pub(super) struct FxHasher {
hash: usize,
}

Expand Down
4 changes: 2 additions & 2 deletions library/proc_macro/src/bridge/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ macro_rules! rpc_encode_decode {
mod tag {
#[repr(u8)] enum Tag { $($variant),* }

$(pub const $variant: u8 = Tag::$variant as u8;)*
$(pub(crate) const $variant: u8 = Tag::$variant as u8;)*
}

match self {
Expand All @@ -89,7 +89,7 @@ macro_rules! rpc_encode_decode {
mod tag {
#[repr(u8)] enum Tag { $($variant),* }

$(pub const $variant: u8 = Tag::$variant as u8;)*
$(pub(crate) const $variant: u8 = Tag::$variant as u8;)*
}

match u8::decode(r, s) {
Expand Down
2 changes: 1 addition & 1 deletion library/proc_macro/src/bridge/selfless_reify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ macro_rules! define_reify_functions {
fn $name:ident $(<$($param:ident),*>)?
for $(extern $abi:tt)? fn($($arg:ident: $arg_ty:ty),*) -> $ret_ty:ty;
)+) => {
$(pub const fn $name<
$(pub(super) const fn $name<
$($($param,)*)?
F: Fn($($arg_ty),*) -> $ret_ty + Copy
>(f: F) -> $(extern $abi)? fn($($arg_ty),*) -> $ret_ty {
Expand Down
1 change: 1 addition & 0 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#![allow(internal_features)]
#![deny(ffi_unwind_calls)]
#![warn(rustdoc::unescaped_backticks)]
#![warn(unreachable_pub)]

#[unstable(feature = "proc_macro_internals", issue = "27812")]
#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion library/test/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl TestOpts {
}

/// Result of parsing the options.
pub type OptRes = Result<TestOpts, String>;
pub(crate) type OptRes = Result<TestOpts, String>;
/// Result of parsing the option part.
type OptPartRes<T> = Result<T, String>;

Expand Down
18 changes: 9 additions & 9 deletions library/test/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use super::types::{NamePadding, TestDesc, TestDescAndFn};
use super::{filter_tests, run_tests, term};

/// Generic wrapper over stdout.
pub enum OutputLocation<T> {
pub(crate) enum OutputLocation<T> {
Pretty(Box<term::StdoutTerminal>),
Raw(T),
}
Expand All @@ -41,15 +41,15 @@ impl<T: Write> Write for OutputLocation<T> {
}
}

pub struct ConsoleTestDiscoveryState {
pub(crate) struct ConsoleTestDiscoveryState {
pub log_out: Option<File>,
pub tests: usize,
pub benchmarks: usize,
pub ignored: usize,
}

impl ConsoleTestDiscoveryState {
pub fn new(opts: &TestOpts) -> io::Result<ConsoleTestDiscoveryState> {
pub(crate) fn new(opts: &TestOpts) -> io::Result<ConsoleTestDiscoveryState> {
let log_out = match opts.logfile {
Some(ref path) => Some(File::create(path)?),
None => None,
Expand All @@ -58,7 +58,7 @@ impl ConsoleTestDiscoveryState {
Ok(ConsoleTestDiscoveryState { log_out, tests: 0, benchmarks: 0, ignored: 0 })
}

pub fn write_log<F, S>(&mut self, msg: F) -> io::Result<()>
pub(crate) fn write_log<F, S>(&mut self, msg: F) -> io::Result<()>
where
S: AsRef<str>,
F: FnOnce() -> S,
Expand All @@ -74,7 +74,7 @@ impl ConsoleTestDiscoveryState {
}
}

pub struct ConsoleTestState {
pub(crate) struct ConsoleTestState {
pub log_out: Option<File>,
pub total: usize,
pub passed: usize,
Expand All @@ -92,7 +92,7 @@ pub struct ConsoleTestState {
}

impl ConsoleTestState {
pub fn new(opts: &TestOpts) -> io::Result<ConsoleTestState> {
pub(crate) fn new(opts: &TestOpts) -> io::Result<ConsoleTestState> {
let log_out = match opts.logfile {
Some(ref path) => Some(File::create(path)?),
None => None,
Expand All @@ -116,7 +116,7 @@ impl ConsoleTestState {
})
}

pub fn write_log<F, S>(&mut self, msg: F) -> io::Result<()>
pub(crate) fn write_log<F, S>(&mut self, msg: F) -> io::Result<()>
where
S: AsRef<str>,
F: FnOnce() -> S,
Expand All @@ -131,7 +131,7 @@ impl ConsoleTestState {
}
}

pub fn write_log_result(
pub(crate) fn write_log_result(
&mut self,
test: &TestDesc,
result: &TestResult,
Expand Down Expand Up @@ -170,7 +170,7 @@ impl ConsoleTestState {
}

// List the tests to console, and optionally to logfile. Filters are honored.
pub fn list_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Result<()> {
pub(crate) fn list_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Result<()> {
let output = match term::stdout() {
None => OutputLocation::Raw(io::stdout().lock()),
Some(t) => OutputLocation::Pretty(t),
Expand Down
2 changes: 1 addition & 1 deletion library/test/src/formatters/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) struct JsonFormatter<T> {
}

impl<T: Write> JsonFormatter<T> {
pub fn new(out: OutputLocation<T>) -> Self {
pub(crate) fn new(out: OutputLocation<T>) -> Self {
Self { out }
}

Expand Down
4 changes: 2 additions & 2 deletions library/test/src/formatters/junit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use crate::test_result::TestResult;
use crate::time;
use crate::types::{TestDesc, TestType};

pub struct JunitFormatter<T> {
pub(crate) struct JunitFormatter<T> {
out: OutputLocation<T>,
results: Vec<(TestDesc, TestResult, Duration, Vec<u8>)>,
}

impl<T: Write> JunitFormatter<T> {
pub fn new(out: OutputLocation<T>) -> Self {
pub(crate) fn new(out: OutputLocation<T>) -> Self {
Self { out, results: Vec::new() }
}

Expand Down
26 changes: 13 additions & 13 deletions library/test/src/formatters/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) struct PrettyFormatter<T> {
}

impl<T: Write> PrettyFormatter<T> {
pub fn new(
pub(crate) fn new(
out: OutputLocation<T>,
use_color: bool,
max_name_len: usize,
Expand All @@ -31,43 +31,43 @@ impl<T: Write> PrettyFormatter<T> {
}

#[cfg(test)]
pub fn output_location(&self) -> &OutputLocation<T> {
pub(crate) fn output_location(&self) -> &OutputLocation<T> {
&self.out
}

pub fn write_ok(&mut self) -> io::Result<()> {
pub(crate) fn write_ok(&mut self) -> io::Result<()> {
self.write_short_result("ok", term::color::GREEN)
}

pub fn write_failed(&mut self) -> io::Result<()> {
pub(crate) fn write_failed(&mut self) -> io::Result<()> {
self.write_short_result("FAILED", term::color::RED)
}

pub fn write_ignored(&mut self, message: Option<&'static str>) -> io::Result<()> {
pub(crate) fn write_ignored(&mut self, message: Option<&'static str>) -> io::Result<()> {
if let Some(message) = message {
self.write_short_result(&format!("ignored, {message}"), term::color::YELLOW)
} else {
self.write_short_result("ignored", term::color::YELLOW)
}
}

pub fn write_time_failed(&mut self) -> io::Result<()> {
pub(crate) fn write_time_failed(&mut self) -> io::Result<()> {
self.write_short_result("FAILED (time limit exceeded)", term::color::RED)
}

pub fn write_bench(&mut self) -> io::Result<()> {
pub(crate) fn write_bench(&mut self) -> io::Result<()> {
self.write_pretty("bench", term::color::CYAN)
}

pub fn write_short_result(
pub(crate) fn write_short_result(
&mut self,
result: &str,
color: term::color::Color,
) -> io::Result<()> {
self.write_pretty(result, color)
}

pub fn write_pretty(&mut self, word: &str, color: term::color::Color) -> io::Result<()> {
pub(crate) fn write_pretty(&mut self, word: &str, color: term::color::Color) -> io::Result<()> {
match self.out {
OutputLocation::Pretty(ref mut term) => {
if self.use_color {
Expand All @@ -86,7 +86,7 @@ impl<T: Write> PrettyFormatter<T> {
}
}

pub fn write_plain<S: AsRef<str>>(&mut self, s: S) -> io::Result<()> {
pub(crate) fn write_plain<S: AsRef<str>>(&mut self, s: S) -> io::Result<()> {
let s = s.as_ref();
self.out.write_all(s.as_bytes())?;
self.out.flush()
Expand Down Expand Up @@ -154,15 +154,15 @@ impl<T: Write> PrettyFormatter<T> {
Ok(())
}

pub fn write_successes(&mut self, state: &ConsoleTestState) -> io::Result<()> {
pub(crate) fn write_successes(&mut self, state: &ConsoleTestState) -> io::Result<()> {
self.write_results(&state.not_failures, "successes")
}

pub fn write_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
pub(crate) fn write_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
self.write_results(&state.failures, "failures")
}

pub fn write_time_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
pub(crate) fn write_time_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
self.write_results(&state.time_failures, "failures (time limit exceeded)")
}

Expand Down
20 changes: 10 additions & 10 deletions library/test/src/formatters/terse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub(crate) struct TerseFormatter<T> {
}

impl<T: Write> TerseFormatter<T> {
pub fn new(
pub(crate) fn new(
out: OutputLocation<T>,
use_color: bool,
max_name_len: usize,
Expand All @@ -42,11 +42,11 @@ impl<T: Write> TerseFormatter<T> {
}
}

pub fn write_ok(&mut self) -> io::Result<()> {
pub(crate) fn write_ok(&mut self) -> io::Result<()> {
self.write_short_result(".", term::color::GREEN)
}

pub fn write_failed(&mut self, name: &str) -> io::Result<()> {
pub(crate) fn write_failed(&mut self, name: &str) -> io::Result<()> {
// Put failed tests on their own line and include the test name, so that it's faster
// to see which test failed without having to wait for them all to run.

Expand All @@ -62,15 +62,15 @@ impl<T: Write> TerseFormatter<T> {
self.write_plain("\n")
}

pub fn write_ignored(&mut self) -> io::Result<()> {
pub(crate) fn write_ignored(&mut self) -> io::Result<()> {
self.write_short_result("i", term::color::YELLOW)
}

pub fn write_bench(&mut self) -> io::Result<()> {
pub(crate) fn write_bench(&mut self) -> io::Result<()> {
self.write_pretty("bench", term::color::CYAN)
}

pub fn write_short_result(
pub(crate) fn write_short_result(
&mut self,
result: &str,
color: term::color::Color,
Expand All @@ -95,7 +95,7 @@ impl<T: Write> TerseFormatter<T> {
Ok(())
}

pub fn write_pretty(&mut self, word: &str, color: term::color::Color) -> io::Result<()> {
pub(crate) fn write_pretty(&mut self, word: &str, color: term::color::Color) -> io::Result<()> {
match self.out {
OutputLocation::Pretty(ref mut term) => {
if self.use_color {
Expand All @@ -114,13 +114,13 @@ impl<T: Write> TerseFormatter<T> {
}
}

pub fn write_plain<S: AsRef<str>>(&mut self, s: S) -> io::Result<()> {
pub(crate) fn write_plain<S: AsRef<str>>(&mut self, s: S) -> io::Result<()> {
let s = s.as_ref();
self.out.write_all(s.as_bytes())?;
self.out.flush()
}

pub fn write_outputs(&mut self, state: &ConsoleTestState) -> io::Result<()> {
pub(crate) fn write_outputs(&mut self, state: &ConsoleTestState) -> io::Result<()> {
self.write_plain("\nsuccesses:\n")?;
let mut successes = Vec::new();
let mut stdouts = String::new();
Expand All @@ -146,7 +146,7 @@ impl<T: Write> TerseFormatter<T> {
Ok(())
}

pub fn write_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
pub(crate) fn write_failures(&mut self, state: &ConsoleTestState) -> io::Result<()> {
self.write_plain("\nfailures:\n")?;
let mut failures = Vec::new();
let mut fail_out = String::new();
Expand Down
2 changes: 1 addition & 1 deletion library/test/src/helpers/concurrency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::num::NonZero;
use std::{env, thread};

pub fn get_concurrency() -> usize {
pub(crate) fn get_concurrency() -> usize {
if let Ok(value) = env::var("RUST_TEST_THREADS") {
match value.parse::<NonZero<usize>>().ok() {
Some(n) => n.get(),
Expand Down
6 changes: 3 additions & 3 deletions library/test/src/helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Module with common helpers not directly related to tests
//! but used in `libtest`.

pub mod concurrency;
pub mod metrics;
pub mod shuffle;
pub(crate) mod concurrency;
pub(crate) mod metrics;
pub(crate) mod shuffle;
4 changes: 2 additions & 2 deletions library/test/src/helpers/shuffle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
use crate::cli::TestOpts;
use crate::types::{TestDescAndFn, TestId, TestName};

pub fn get_shuffle_seed(opts: &TestOpts) -> Option<u64> {
pub(crate) fn get_shuffle_seed(opts: &TestOpts) -> Option<u64> {
opts.shuffle_seed.or_else(|| {
if opts.shuffle {
Some(
Expand All @@ -19,7 +19,7 @@ pub fn get_shuffle_seed(opts: &TestOpts) -> Option<u64> {
})
}

pub fn shuffle_tests(shuffle_seed: u64, tests: &mut [(TestId, TestDescAndFn)]) {
pub(crate) fn shuffle_tests(shuffle_seed: u64, tests: &mut [(TestId, TestDescAndFn)]) {
let test_names: Vec<&TestName> = tests.iter().map(|test| &test.1.desc.name).collect();
let test_names_hash = calculate_hash(&test_names);
let mut rng = Rng::new(shuffle_seed, test_names_hash);
Expand Down
1 change: 1 addition & 0 deletions library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#![feature(thread_spawn_hook)]
#![allow(internal_features)]
#![warn(rustdoc::unescaped_backticks)]
#![warn(unreachable_pub)]

pub use cli::TestOpts;

Expand Down
Loading