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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fc126df
Update the index.html of Option to make the summary more comprehensive
Natural-selection1 Mar 26, 2025
159ae8f
Keeps the inspect() classification the same as in Result
Natural-selection1 Mar 26, 2025
edfef42
ensure compiler existance of tools on the dist step
onur-ozkan Apr 18, 2025
4ba9fff
add regression test for dist compilation
onur-ozkan Apr 18, 2025
ea0b6cb
Solved suggestions
Natural-selection1 Apr 21, 2025
90fe280
Move `sys::pal::os::Env` into `sys::env`
thaliaarchi Apr 22, 2025
6518bcb
Fix `unsafe_op_in_unsafe_fn` for Unix env
thaliaarchi Apr 22, 2025
1b00ebe
Update !DynSend and !DynSync platform impls
thaliaarchi Apr 22, 2025
4695212
Deduplicate unsupported env items
thaliaarchi Apr 22, 2025
01485c9
Unify owned `Env` types between platforms
thaliaarchi Apr 22, 2025
7493e1c
Make #![feature(let_chains)] bootstrap conditional in compiler/
est31 Apr 23, 2025
c0446d3
keep the original text for is_some and is_none
Natural-selection1 Apr 24, 2025
d0ac97d
add examples using .as_ref() for is_some_and and is_none_or
Natural-selection1 Apr 24, 2025
d8528c6
Some drive-by housecleaning in `rustc_borrowck`
amandasystems Apr 24, 2025
e5e3a95
norm nested aliases before evaluating the parent goal
lcnr Apr 24, 2025
75a9be6
Deprecate the unstable `concat_idents!`
tgross35 Feb 26, 2025
1d0b3be
Don't use item name to look up associated item from trait item
compiler-errors Apr 25, 2025
84a921d
Rollup merge of #137653 - tgross35:deprecate-concat_idents, r=working…
matthiaskrgr Apr 25, 2025
59191fa
Rollup merge of #138957 - Natural-selection1:update-Option-doc, r=Ama…
matthiaskrgr Apr 25, 2025
8868163
Rollup merge of #140006 - onur-ozkan:138778, r=onur-ozkan
matthiaskrgr Apr 25, 2025
f3641df
Rollup merge of #140143 - thaliaarchi:move-env-pal, r=joboet
matthiaskrgr Apr 25, 2025
564e5cc
Rollup merge of #140202 - est31:let_chains_feature_compiler, r=lcnr
matthiaskrgr Apr 25, 2025
9eb0078
Rollup merge of #140236 - lcnr:normalizes-to-goals, r=compiler-errors
matthiaskrgr Apr 25, 2025
e534fad
Rollup merge of #140257 - amandasystems:housecleaning, r=wesleywiser
matthiaskrgr Apr 25, 2025
3c08a50
Rollup merge of #140278 - compiler-errors:name-based-comparison, r=nn…
matthiaskrgr Apr 25, 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
Deduplicate unsupported env items
  • Loading branch information
thaliaarchi committed Apr 22, 2025
commit 46952125661fa7bb6a016a6be4e03620da16a077
9 changes: 3 additions & 6 deletions library/std/src/sys/env/unsupported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ pub struct Env(!);
impl Env {
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
let Self(inner) = self;
match *inner {}
self.0
}
}

impl fmt::Debug for Env {
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
let Self(inner) = self;
match *inner {}
self.0
}
}

impl Iterator for Env {
type Item = (OsString, OsString);
fn next(&mut self) -> Option<(OsString, OsString)> {
let Self(inner) = self;
match *inner {}
self.0
}
}

Expand Down
41 changes: 5 additions & 36 deletions library/std/src/sys/env/zkvm.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
#[expect(dead_code)]
#[path = "unsupported.rs"]
mod unsupported_env;
pub use unsupported_env::{Env, env, setenv, unsetenv};

use crate::ffi::{OsStr, OsString};
use crate::sys::os_str;
use crate::sys::pal::{WORD_SIZE, abi};
use crate::sys_common::FromInner;
use crate::{fmt, io};

pub struct Env(!);

impl Iterator for Env {
type Item = (OsString, OsString);
fn next(&mut self) -> Option<(OsString, OsString)> {
self.0
}
}

pub fn env() -> Env {
panic!("not supported on this platform")
}

impl Env {
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
let Self(inner) = self;
match *inner {}
}
}

impl fmt::Debug for Env {
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
let Self(inner) = self;
match *inner {}
}
}

pub fn getenv(varname: &OsStr) -> Option<OsString> {
let varname = varname.as_encoded_bytes();
Expand All @@ -53,11 +30,3 @@ pub fn getenv(varname: &OsStr) -> Option<OsString> {
let u8s: &[u8] = unsafe { crate::slice::from_raw_parts(words.cast() as *const u8, nbytes) };
Some(OsString::from_inner(os_str::Buf { inner: u8s.to_vec() }))
}

pub unsafe fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> {
Err(io::const_error!(io::ErrorKind::Unsupported, "cannot set env vars on this platform"))
}

pub unsafe fn unsetenv(_: &OsStr) -> io::Result<()> {
Err(io::const_error!(io::ErrorKind::Unsupported, "cannot unset env vars on this platform"))
}