Skip to content

Rollup of 18 pull requests #139612

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

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a11fbee
Small code improvement in rustdoc hidden stripper
GuillaumeGomez Mar 7, 2025
e89c849
Clean up librustdoc::html::render to be better encapsulated
xizheyin Mar 17, 2025
abe6e88
Allow drivers to supply a list of extra symbols to intern
Alexendoo Mar 19, 2025
f9770e7
Test linking and running no_std binaries
madsmtm Mar 24, 2025
b8c4c16
Suppress missing field error when autoderef bottoms out in infer
compiler-errors Apr 5, 2025
34e9759
compiletest: Trim whitespace from environment variable names
Zalathar Apr 8, 2025
a0d9c87
Inline `calc_default_binding_mode`
Nadrieril Apr 6, 2025
9f57903
Insert adjustments incrementally
Nadrieril Apr 6, 2025
19950b5
Turn the peeling loop into a recursive call
Nadrieril Apr 6, 2025
38adb99
Reorganize `check_pat_inner`
Nadrieril Apr 6, 2025
6588018
Return a type from `check_pat_inner`
Nadrieril Apr 6, 2025
f458151
Remove redundant assignment
Nadrieril Apr 6, 2025
12311ef
fix title of offset_of_enum feature
programmerjake Apr 8, 2025
f151cea
emit a better error message for using the macro incorrectly
ZuseZ4 Apr 9, 2025
f419b18
Return early on an error path in `parse_item_impl`.
nnethercote Apr 8, 2025
7ae5c7f
Avoid an empty trait name in impl blocks.
nnethercote Apr 9, 2025
b2aa9d0
Remove some dead or leftover code related to rustc-intrinsic abi removal
oli-obk Apr 8, 2025
cf68565
Temporarily leave the review rotation
fmease Apr 9, 2025
32c8f7d
librustdoc: remove IndexItem::new, use previous fields constructor
xizheyin Apr 9, 2025
67ff336
saethlin is back from vacation
saethlin Apr 9, 2025
50d0ce1
Ensure `swap_nonoverlapping` is really always untyped
scottmcm Feb 22, 2025
b06a88f
Add a Miri test for 134713
scottmcm Feb 22, 2025
8b227a4
rustdoc: Enable Markdown extensions when looking for doctests
camelid Apr 9, 2025
63dcac8
skip `tests/codegen/swap-small-types` when debug assertions are on
scottmcm Apr 9, 2025
7103aea
Tracking issue template: fine-grained information on style update status
joshtriplett Apr 9, 2025
d21ee7e
Update `compiler-builtins` to 0.1.153
tgross35 Apr 9, 2025
99b048c
compiletest: update to Edition 2024
jieyouxu Apr 10, 2025
37c9a3c
Rollup merge of #137412 - scottmcm:redo-swap, r=cuviper
Zalathar Apr 10, 2025
d5f5509
Rollup merge of #138167 - GuillaumeGomez:rustdoc-hidden-stripper-impr…
Zalathar Apr 10, 2025
3a9ab8d
Rollup merge of #138605 - xizheyin:issue-138567, r=GuillaumeGomez
Zalathar Apr 10, 2025
af220c3
Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-dead
Zalathar Apr 10, 2025
b7a7423
Rollup merge of #138904 - madsmtm:apple-test-no-std, r=tgross35
Zalathar Apr 10, 2025
0f80846
Rollup merge of #139423 - compiler-errors:field-autoderef, r=oli-obk
Zalathar Apr 10, 2025
6171b06
Rollup merge of #139449 - Nadrieril:peel-recursive, r=lcnr
Zalathar Apr 10, 2025
f5b6e88
Rollup merge of #139507 - Zalathar:trim-env-name, r=jieyouxu
Zalathar Apr 10, 2025
b316fb7
Rollup merge of #139530 - oli-obk:rustc-intrinsic-cleanup, r=RalfJung
Zalathar Apr 10, 2025
3657f4d
Rollup merge of #139560 - programmerjake:patch-5, r=jieyouxu
Zalathar Apr 10, 2025
a41c699
Rollup merge of #139563 - EnzymeAD:better-autodiff-err, r=jieyouxu
Zalathar Apr 10, 2025
49e0b9e
Rollup merge of #139568 - nnethercote:empty-trait-name, r=compiler-er…
Zalathar Apr 10, 2025
3358dce
Rollup merge of #139580 - fmease:unrotate, r=fmease
Zalathar Apr 10, 2025
13faa56
Rollup merge of #139589 - saethlin:vacation, r=camelid
Zalathar Apr 10, 2025
aacbcd1
Rollup merge of #139592 - camelid:doctest-md-opts, r=notriddle
Zalathar Apr 10, 2025
9145955
Rollup merge of #139599 - joshtriplett:style-tracking, r=traviscross
Zalathar Apr 10, 2025
57db7af
Rollup merge of #139600 - tgross35:update-builtins, r=tgross35
Zalathar Apr 10, 2025
e43645e
Rollup merge of #139606 - jieyouxu:compiletest-edition2024, r=compile…
Zalathar Apr 10, 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
Prev Previous commit
Next Next commit
compiletest: Trim whitespace from environment variable names
  • Loading branch information
Zalathar committed Apr 8, 2025
commit 34e97592f4dc8f4e44a309e3bf69cdcea22fc047
21 changes: 9 additions & 12 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl TestProps {
ln,
UNSET_EXEC_ENV,
&mut self.unset_exec_env,
|r| r,
|r| r.trim().to_owned(),
);
config.push_name_value_directive(
ln,
Expand All @@ -453,7 +453,7 @@ impl TestProps {
ln,
UNSET_RUSTC_ENV,
&mut self.unset_rustc_env,
|r| r,
|r| r.trim().to_owned(),
);
config.push_name_value_directive(
ln,
Expand Down Expand Up @@ -979,16 +979,13 @@ impl Config {

fn parse_env(nv: String) -> (String, String) {
// nv is either FOO or FOO=BAR
let mut strs: Vec<String> = nv.splitn(2, '=').map(str::to_owned).collect();

match strs.len() {
1 => (strs.pop().unwrap(), String::new()),
2 => {
let end = strs.pop().unwrap();
(strs.pop().unwrap(), end)
}
n => panic!("Expected 1 or 2 strings, not {}", n),
}
// FIXME(Zalathar): The form without `=` seems to be unused; should
// we drop support for it?
let (name, value) = nv.split_once('=').unwrap_or((&nv, ""));
// Trim whitespace from the name, so that `//@ exec-env: FOO=BAR`
// sees the name as `FOO` and not ` FOO`.
let name = name.trim();
(name.to_owned(), value.to_owned())
}

fn parse_pp_exact(&self, line: &str, testfile: &Path) -> Option<PathBuf> {
Expand Down
8 changes: 4 additions & 4 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,16 +971,16 @@ impl<'test> TestCx<'test> {
delete_after_success: bool,
) -> ProcRes {
let prepare_env = |cmd: &mut Command| {
for key in &self.props.unset_exec_env {
cmd.env_remove(key);
}

for (key, val) in &self.props.exec_env {
cmd.env(key, val);
}
for (key, val) in env_extra {
cmd.env(key, val);
}

for key in &self.props.unset_exec_env {
cmd.env_remove(key);
}
};

let proc_res = match &*self.config.target {
Expand Down
23 changes: 23 additions & 0 deletions tests/ui/compiletest-self-test/trim-env-name.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@ edition: 2024
//@ revisions: set unset
//@ run-pass
//@ ignore-cross-compile (assume that non-cross targets have working env vars)
//@ rustc-env: MY_RUSTC_ENV = my-rustc-value
//@ exec-env: MY_EXEC_ENV = my-exec-value
//@[unset] unset-rustc-env: MY_RUSTC_ENV
//@[unset] unset-exec-env: MY_EXEC_ENV

// Check that compiletest trims whitespace from environment variable names
// specified in `rustc-env` and `exec-env` directives, so that
// `//@ exec-env: FOO=bar` sees the name as `FOO` and not ` FOO`.
//
// Values are currently not trimmed.
//
// Since this is a compiletest self-test, only run it on non-cross targets,
// to avoid having to worry about weird targets that don't support env vars.

fn main() {
let is_set = cfg!(set);
assert_eq!(option_env!("MY_RUSTC_ENV"), is_set.then_some(" my-rustc-value"));
assert_eq!(std::env::var("MY_EXEC_ENV").ok().as_deref(), is_set.then_some(" my-exec-value"));
}
Loading