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 Box>; -// Const opt-out +// Const bound -trait T: ? const Super {} +trait T: ~ const Super {} -const fn maybe_const() -> i32 { ::CONST } +const fn not_quite_const() -> i32 { ::CONST } -struct S(std::marker::PhantomData); +struct S(std::marker::PhantomData); -impl ? const T {} +impl ~ const T {} -fn trait_object() -> &'static dyn ? const T { &S } +fn apit(_: impl ~ const T) {} -fn i(_: impl IntoIterator>) {} - -fn apit(_: impl ?const T) {} - -fn rpit() -> impl ? const T { S } +fn rpit() -> impl ~ const T { S } pub struct Foo(T); -impl Foo { +impl Foo { fn new(t: T) -> Self { - // not calling methods on `t`, so we opt out of requiring - // `` to have const methods via `?const` Self(t) } } @@ -171,4 +165,4 @@ impl Foo { 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(std::marker::PhantomData); impl ~const T {} -fn trait_object() -> &'static dyn ~const T { - &S -} - -fn i(_: impl IntoIterator>) {} - fn apit(_: impl ~const T) {} fn rpit() -> impl ~const T {