Skip to content

Commit 2d7dbf2

Browse files
committed
Fix rustfmt test
1 parent 0a3a608 commit 2d7dbf2

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

src/tools/rustfmt/tests/source/type.rs

+9-15
Original file line numberDiff line numberDiff line change
@@ -140,29 +140,23 @@ fn foo(a: SomeLongComplexType, b: SomeOtherLongComplexType) -> Box<Future<Item =
140140

141141
type MyFn = fn(a: SomeLongComplexType, b: SomeOtherLongComplexType,) -> Box<Future<Item = AnotherLongType, Error = ALongErrorType>>;
142142

143-
// Const opt-out
143+
// Const bound
144144

145-
trait T: ? const Super {}
145+
trait T: ~ const Super {}
146146

147-
const fn maybe_const<S: ? const T>() -> i32 { <S as T>::CONST }
147+
const fn not_quite_const<S: ~ const T>() -> i32 { <S as T>::CONST }
148148

149-
struct S<T:? const ? Sized>(std::marker::PhantomData<T>);
149+
struct S<T:~ const ? Sized>(std::marker::PhantomData<T>);
150150

151-
impl ? const T {}
151+
impl ~ const T {}
152152

153-
fn trait_object() -> &'static dyn ? const T { &S }
153+
fn apit(_: impl ~ const T) {}
154154

155-
fn i(_: impl IntoIterator<Item = Box<dyn ? const T>>) {}
156-
157-
fn apit(_: impl ?const T) {}
158-
159-
fn rpit() -> impl ? const T { S }
155+
fn rpit() -> impl ~ const T { S }
160156

161157
pub struct Foo<T: Trait>(T);
162-
impl<T: ? const Trait> Foo<T> {
158+
impl<T: ~ const Trait> Foo<T> {
163159
fn new(t: T) -> Self {
164-
// not calling methods on `t`, so we opt out of requiring
165-
// `<T as Trait>` to have const methods via `?const`
166160
Self(t)
167161
}
168162
}
@@ -171,4 +165,4 @@ impl<T: ? const Trait> Foo<T> {
171165
type T = typeof(
172166
1);
173167
impl T for .. {
174-
}
168+
}

src/tools/rustfmt/tests/target/type.rs

-6
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,6 @@ struct S<T: ~const ?Sized>(std::marker::PhantomData<T>);
157157

158158
impl ~const T {}
159159

160-
fn trait_object() -> &'static dyn ~const T {
161-
&S
162-
}
163-
164-
fn i(_: impl IntoIterator<Item = Box<dyn ~const T>>) {}
165-
166160
fn apit(_: impl ~const T) {}
167161

168162
fn rpit() -> impl ~const T {

0 commit comments

Comments
 (0)