Skip to content

Commit 1088e6e

Browse files
committed
Remove <os::Vars as Debug> workaround
Fixes rust-lang#114583.
1 parent b6d256b commit 1088e6e

File tree

8 files changed

+1
-138
lines changed

8 files changed

+1
-138
lines changed

library/std/src/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl Iterator for Vars {
179179
impl fmt::Debug for Vars {
180180
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
181181
let Self { inner: VarsOs { inner } } = self;
182-
f.debug_struct("Vars").field("inner", &inner.str_debug()).finish()
182+
f.debug_struct("Vars").field("inner", inner).finish()
183183
}
184184
}
185185

library/std/src/sys/hermit/os.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,6 @@ pub struct Env {
112112
iter: vec::IntoIter<(OsString, OsString)>,
113113
}
114114

115-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
116-
pub struct EnvStrDebug<'a> {
117-
slice: &'a [(OsString, OsString)],
118-
}
119-
120-
impl fmt::Debug for EnvStrDebug<'_> {
121-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
122-
let Self { slice } = self;
123-
f.debug_list()
124-
.entries(slice.iter().map(|(a, b)| (a.to_str().unwrap(), b.to_str().unwrap())))
125-
.finish()
126-
}
127-
}
128-
129-
impl Env {
130-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
131-
let Self { iter } = self;
132-
EnvStrDebug { slice: iter.as_slice() }
133-
}
134-
}
135-
136115
impl fmt::Debug for Env {
137116
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
138117
let Self { iter } = self;

library/std/src/sys/sgx/os.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,6 @@ pub struct Env {
100100
iter: vec::IntoIter<(OsString, OsString)>,
101101
}
102102

103-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
104-
pub struct EnvStrDebug<'a> {
105-
slice: &'a [(OsString, OsString)],
106-
}
107-
108-
impl fmt::Debug for EnvStrDebug<'_> {
109-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
110-
let Self { slice } = self;
111-
f.debug_list()
112-
.entries(slice.iter().map(|(a, b)| (a.to_str().unwrap(), b.to_str().unwrap())))
113-
.finish()
114-
}
115-
}
116-
117-
impl Env {
118-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
119-
let Self { iter } = self;
120-
EnvStrDebug { slice: iter.as_slice() }
121-
}
122-
}
123-
124103
impl fmt::Debug for Env {
125104
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
126105
let Self { iter } = self;

library/std/src/sys/solid/os.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,6 @@ pub struct Env {
8989
iter: vec::IntoIter<(OsString, OsString)>,
9090
}
9191

92-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
93-
pub struct EnvStrDebug<'a> {
94-
slice: &'a [(OsString, OsString)],
95-
}
96-
97-
impl fmt::Debug for EnvStrDebug<'_> {
98-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
99-
let Self { slice } = self;
100-
f.debug_list()
101-
.entries(slice.iter().map(|(a, b)| (a.to_str().unwrap(), b.to_str().unwrap())))
102-
.finish()
103-
}
104-
}
105-
106-
impl Env {
107-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
108-
let Self { iter } = self;
109-
EnvStrDebug { slice: iter.as_slice() }
110-
}
111-
}
112-
11392
impl fmt::Debug for Env {
11493
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11594
let Self { iter } = self;

library/std/src/sys/unix/os.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -540,27 +540,6 @@ pub struct Env {
540540
iter: vec::IntoIter<(OsString, OsString)>,
541541
}
542542

543-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
544-
pub struct EnvStrDebug<'a> {
545-
slice: &'a [(OsString, OsString)],
546-
}
547-
548-
impl fmt::Debug for EnvStrDebug<'_> {
549-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
550-
let Self { slice } = self;
551-
f.debug_list()
552-
.entries(slice.iter().map(|(a, b)| (a.to_str().unwrap(), b.to_str().unwrap())))
553-
.finish()
554-
}
555-
}
556-
557-
impl Env {
558-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
559-
let Self { iter } = self;
560-
EnvStrDebug { slice: iter.as_slice() }
561-
}
562-
}
563-
564543
impl fmt::Debug for Env {
565544
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
566545
let Self { iter } = self;

library/std/src/sys/unsupported/os.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ pub fn current_exe() -> io::Result<PathBuf> {
6565

6666
pub struct Env(!);
6767

68-
impl Env {
69-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
70-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
71-
let Self(inner) = self;
72-
match *inner {}
73-
}
74-
}
75-
7668
impl fmt::Debug for Env {
7769
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
7870
let Self(inner) = self;

library/std/src/sys/wasi/os.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -147,27 +147,6 @@ pub struct Env {
147147
iter: vec::IntoIter<(OsString, OsString)>,
148148
}
149149

150-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
151-
pub struct EnvStrDebug<'a> {
152-
slice: &'a [(OsString, OsString)],
153-
}
154-
155-
impl fmt::Debug for EnvStrDebug<'_> {
156-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
157-
let Self { slice } = self;
158-
f.debug_list()
159-
.entries(slice.iter().map(|(a, b)| (a.to_str().unwrap(), b.to_str().unwrap())))
160-
.finish()
161-
}
162-
}
163-
164-
impl Env {
165-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
166-
let Self { iter } = self;
167-
EnvStrDebug { slice: iter.as_slice() }
168-
}
169-
}
170-
171150
impl fmt::Debug for Env {
172151
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
173152
let Self { iter } = self;

library/std/src/sys/windows/os.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,6 @@ pub struct Env {
8484
iter: EnvIterator,
8585
}
8686

87-
// FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when <OsStr as Debug>::fmt matches <str as Debug>::fmt.
88-
pub struct EnvStrDebug<'a> {
89-
iter: &'a EnvIterator,
90-
}
91-
92-
impl fmt::Debug for EnvStrDebug<'_> {
93-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
94-
let Self { iter } = self;
95-
let iter: EnvIterator = (*iter).clone();
96-
let mut list = f.debug_list();
97-
for (a, b) in iter {
98-
list.entry(&(a.to_str().unwrap(), b.to_str().unwrap()));
99-
}
100-
list.finish()
101-
}
102-
}
103-
104-
impl Env {
105-
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
106-
let Self { base: _, iter } = self;
107-
EnvStrDebug { iter }
108-
}
109-
}
110-
11187
impl fmt::Debug for Env {
11288
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11389
let Self { base: _, iter } = self;

0 commit comments

Comments
 (0)