about summary refs log tree commit diff
path: root/src/tools/rustfmt
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2021-08-27 11:53:03 +0000
committerDeadbeef <ent3rm4n@gmail.com>2021-08-27 11:53:03 +0000
commit2d7dbf2e05284aba0a99c40db007c512631872ca (patch)
tree05dd023c8530557d1fc12cc447f13e563ddd322e /src/tools/rustfmt
parent0a3a6087fb91d185700d18b13365ad5969c97eb9 (diff)
downloadrust-2d7dbf2e05284aba0a99c40db007c512631872ca.tar.gz
rust-2d7dbf2e05284aba0a99c40db007c512631872ca.zip
Fix rustfmt test
Diffstat (limited to 'src/tools/rustfmt')
-rw-r--r--src/tools/rustfmt/tests/source/type.rs24
-rw-r--r--src/tools/rustfmt/tests/target/type.rs6
2 files changed, 9 insertions, 21 deletions
diff --git a/src/tools/rustfmt/tests/source/type.rs b/src/tools/rustfmt/tests/source/type.rs
index 57f31dc901e..61ef73a3cab 100644
--- a/src/tools/rustfmt/tests/source/type.rs
+++ b/src/tools/rustfmt/tests/source/type.rs
@@ -140,29 +140,23 @@ fn foo(a: SomeLongComplexType, b: SomeOtherLongComplexType) -> Box<Future<Item =
 
 type MyFn = fn(a: SomeLongComplexType, b: SomeOtherLongComplexType,) -> Box<Future<Item = AnotherLongType, Error = ALongErrorType>>;
 
-// Const opt-out
+// Const bound
 
-trait T: ?   const  Super {}
+trait T: ~   const  Super {}
 
-const fn maybe_const<S: ?   const    T>() -> i32 { <S as T>::CONST }
+const fn not_quite_const<S: ~  const    T>() -> i32 { <S as T>::CONST }
 
-struct S<T:?  const   ?  Sized>(std::marker::PhantomData<T>);
+struct S<T:~  const   ?  Sized>(std::marker::PhantomData<T>);
 
-impl ?    const T {}
+impl ~    const T {}
 
-fn trait_object() -> &'static dyn ?  const T { &S }
+fn apit(_: impl ~   const T) {}
 
-fn i(_: impl IntoIterator<Item = Box<dyn ?    const    T>>) {}
-
-fn apit(_: impl ?const T) {}
-
-fn rpit() -> impl ?  const T { S }
+fn rpit() -> impl ~  const T { S }
 
 pub struct Foo<T: Trait>(T);
-impl<T:   ?  const Trait> Foo<T> {
+impl<T:   ~  const Trait> Foo<T> {
     fn new(t: T) -> Self {
-        // not calling methods on `t`, so we opt out of requiring
-        // `<T as Trait>` to have const methods via `?const`
         Self(t)
     }
 }
@@ -171,4 +165,4 @@ impl<T:   ?  const Trait> Foo<T> {
 type T = typeof(
 1);
 impl T for  .. {
-}
\ No newline at end of file
+}
diff --git a/src/tools/rustfmt/tests/target/type.rs b/src/tools/rustfmt/tests/target/type.rs
index 9ab66944c8c..38cf909c258 100644
--- a/src/tools/rustfmt/tests/target/type.rs
+++ b/src/tools/rustfmt/tests/target/type.rs
@@ -157,12 +157,6 @@ struct S<T: ~const ?Sized>(std::marker::PhantomData<T>);
 
 impl ~const T {}
 
-fn trait_object() -> &'static dyn ~const T {
-    &S
-}
-
-fn i(_: impl IntoIterator<Item = Box<dyn ~const T>>) {}
-
 fn apit(_: impl ~const T) {}
 
 fn rpit() -> impl ~const T {