Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit abaf2e8

Browse files
committed
Auto merge of rust-lang#119027 - GuillaumeGomez:rollup-bcxuwn7, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - rust-lang#118644 (Add test for Apple's `-weak_framework` linker argument) - rust-lang#118828 (Remove dead codes in rustc_codegen_gcc) - rust-lang#118830 (Add support for `--env` on `tracked_env::var`) - rust-lang#119001 (rustdoc-search: remove parallel searchWords array) - rust-lang#119020 (remove `hex` dependency in bootstrap) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4451777 + 6c50b61 commit abaf2e8

File tree

31 files changed

+263
-124
lines changed

31 files changed

+263
-124
lines changed

compiler/rustc_codegen_gcc/src/common.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ pub trait TypeReflection<'gcc, 'tcx> {
377377
fn is_i128(&self, cx: &CodegenCx<'gcc, 'tcx>) -> bool;
378378
fn is_u128(&self, cx: &CodegenCx<'gcc, 'tcx>) -> bool;
379379

380-
fn is_f32(&self, cx: &CodegenCx<'gcc, 'tcx>) -> bool;
381-
fn is_f64(&self, cx: &CodegenCx<'gcc, 'tcx>) -> bool;
382-
383380
fn is_vector(&self) -> bool;
384381
}
385382

@@ -464,14 +461,6 @@ impl<'gcc, 'tcx> TypeReflection<'gcc, 'tcx> for Type<'gcc> {
464461
self.unqualified() == cx.u128_type.unqualified()
465462
}
466463

467-
fn is_f32(&self, cx: &CodegenCx<'gcc, 'tcx>) -> bool {
468-
self.unqualified() == cx.context.new_type::<f32>()
469-
}
470-
471-
fn is_f64(&self, cx: &CodegenCx<'gcc, 'tcx>) -> bool {
472-
self.unqualified() == cx.context.new_type::<f64>()
473-
}
474-
475464
fn is_vector(&self) -> bool {
476465
let mut typ = self.clone();
477466
loop {

compiler/rustc_codegen_gcc/src/context.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ use rustc_target::spec::{HasTargetSpec, Target, TlsModel};
2222
use crate::callee::get_fn;
2323
use crate::common::SignType;
2424

25-
#[derive(Clone)]
26-
pub struct FuncSig<'gcc> {
27-
pub params: Vec<Type<'gcc>>,
28-
pub return_type: Type<'gcc>,
29-
}
30-
3125
pub struct CodegenCx<'gcc, 'tcx> {
3226
pub check_overflow: bool,
3327
pub codegen_unit: &'tcx CodegenUnit<'tcx>,

compiler/rustc_expand/src/proc_macro_server.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,10 @@ impl server::Types for Rustc<'_, '_> {
426426
}
427427

428428
impl server::FreeFunctions for Rustc<'_, '_> {
429+
fn injected_env_var(&mut self, var: &str) -> Option<String> {
430+
self.ecx.sess.opts.logical_env.get(var).cloned()
431+
}
432+
429433
fn track_env_var(&mut self, var: &str, value: Option<&str>) {
430434
self.sess()
431435
.env_depinfo

library/proc_macro/src/bridge/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ macro_rules! with_api {
5555
$m! {
5656
FreeFunctions {
5757
fn drop($self: $S::FreeFunctions);
58+
fn injected_env_var(var: &str) -> Option<String>;
5859
fn track_env_var(var: &str, value: Option<&str>);
5960
fn track_path(path: &str);
6061
fn literal_from_str(s: &str) -> Result<Literal<$S::Span, $S::Symbol>, ()>;

library/proc_macro/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,8 @@ pub mod tracked_env {
15031503
#[unstable(feature = "proc_macro_tracked_env", issue = "99515")]
15041504
pub fn var<K: AsRef<OsStr> + AsRef<str>>(key: K) -> Result<String, VarError> {
15051505
let key: &str = key.as_ref();
1506-
let value = env::var(key);
1506+
let value = crate::bridge::client::FreeFunctions::injected_env_var(key)
1507+
.map_or_else(|| env::var(key), Ok);
15071508
crate::bridge::client::FreeFunctions::track_env_var(key, value.as_deref().ok());
15081509
value
15091510
}

src/bootstrap/Cargo.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ dependencies = [
5555
"cmake",
5656
"fd-lock",
5757
"filetime",
58-
"hex",
5958
"home",
6059
"ignore",
6160
"junction",
@@ -313,12 +312,6 @@ version = "0.4.1"
313312
source = "registry+https://github.com/rust-lang/crates.io-index"
314313
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
315314

316-
[[package]]
317-
name = "hex"
318-
version = "0.4.3"
319-
source = "registry+https://github.com/rust-lang/crates.io-index"
320-
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
321-
322315
[[package]]
323316
name = "home"
324317
version = "0.5.4"

src/bootstrap/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ clap = { version = "4.4.7", default-features = false, features = ["std", "usage"
3939
clap_complete = "4.4.3"
4040
cmake = "0.1.38"
4141
filetime = "0.2"
42-
hex = "0.4"
4342
home = "0.5.4"
4443
ignore = "0.4.10"
4544
libc = "0.2.150"

src/bootstrap/src/core/build_steps/setup.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
22
use crate::t;
33
use crate::utils::change_tracker::CONFIG_CHANGE_HISTORY;
4+
use crate::utils::helpers::hex_encode;
45
use crate::Config;
56
use sha2::Digest;
67
use std::env::consts::EXE_SUFFIX;
@@ -566,7 +567,7 @@ fn create_vscode_settings_maybe(config: &Config) -> io::Result<bool> {
566567
if let Ok(current) = fs::read_to_string(&vscode_settings) {
567568
let mut hasher = sha2::Sha256::new();
568569
hasher.update(&current);
569-
let hash = hex::encode(hasher.finalize().as_slice());
570+
let hash = hex_encode(hasher.finalize().as_slice());
570571
if hash == *current_hash {
571572
return Ok(true);
572573
} else if historical_hashes.contains(&hash.as_str()) {

src/bootstrap/src/core/download.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use std::{
1111
use build_helper::ci::CiEnv;
1212
use xz2::bufread::XzDecoder;
1313

14-
use crate::core::build_steps::llvm::detect_llvm_sha;
1514
use crate::core::config::RustfmtMetadata;
1615
use crate::utils::helpers::{check_run, exe, program_out_of_date};
16+
use crate::{core::build_steps::llvm::detect_llvm_sha, utils::helpers::hex_encode};
1717
use crate::{t, Config};
1818

1919
static SHOULD_FIX_BINS_AND_DYLIBS: OnceLock<bool> = OnceLock::new();
@@ -345,7 +345,7 @@ impl Config {
345345
reader.consume(l);
346346
}
347347

348-
let checksum = hex::encode(hasher.finalize().as_slice());
348+
let checksum = hex_encode(hasher.finalize().as_slice());
349349
let verified = checksum == expected;
350350

351351
if !verified {

src/bootstrap/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use filetime::FileTime;
3434
use sha2::digest::Digest;
3535
use termcolor::{ColorChoice, StandardStream, WriteColor};
3636
use utils::channel::GitInfo;
37+
use utils::helpers::hex_encode;
3738

3839
use crate::core::builder;
3940
use crate::core::builder::Kind;
@@ -1871,7 +1872,7 @@ pub fn generate_smart_stamp_hash(dir: &Path, additional_input: &str) -> String {
18711872
hasher.update(status);
18721873
hasher.update(additional_input);
18731874

1874-
hex::encode(hasher.finalize().as_slice())
1875+
hex_encode(hasher.finalize().as_slice())
18751876
}
18761877

18771878
/// Ensures that the behavior dump directory is properly initialized.

0 commit comments

Comments
 (0)