Skip to content

Commit ff24ac4

Browse files
committed
Try fixing some tests
1 parent 1164c94 commit ff24ac4

27 files changed

+52
-255
lines changed

src/test/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// check-pass
22

33
#![feature(const_trait_impl)]
4-
#![feature(const_trait_bound_opt_out)]
54
#![feature(const_fn_trait_bound)]
6-
#![allow(incomplete_features)]
75

86
struct S;
97

@@ -16,9 +14,9 @@ impl const PartialEq for S {
1614
}
1715
}
1816

19-
// This duplicate bound should not result in ambiguities. It should be equivalent to a single const
17+
// This duplicate bound should not result in ambiguities. It should be equivalent to a single ~const
2018
// bound.
21-
const fn equals_self<T: PartialEq + ?const PartialEq>(t: &T) -> bool {
19+
const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
2220
*t == *t
2321
}
2422

src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#![feature(const_fn_trait_bound)]
22
#![feature(const_trait_impl)]
3-
#![feature(const_trait_bound_opt_out)]
4-
#![allow(incomplete_features)]
53

6-
pub const fn equals_self<T: ?const PartialEq>(t: &T) -> bool {
4+
pub const fn equals_self<T: PartialEq>(t: &T) -> bool {
75
*t == *t
86
//~^ ERROR calls in constant functions are limited to constant functions
97
}

src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-opt-out.rs renamed to src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// check-pass
22

33
#![feature(const_fn_trait_bound)]
4-
#![feature(const_trait_impl)]
5-
#![feature(const_trait_bound_opt_out)]
6-
#![allow(incomplete_features)]
74

85
struct S;
96

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.stderr

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.stderr

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.stderr

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#![feature(const_trait_bound_opt_out)]
21
#![feature(const_trait_impl)]
3-
#![allow(incomplete_features)]
42

53
struct S;
64
trait T {}
75

8-
impl ?const T for S {}
6+
impl ~const T for S {}
97
//~^ ERROR expected a trait, found type
108

119
fn main() {}

src/test/ui/rfc-2632-const-trait-impl/inherent-impl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#![feature(const_trait_impl)]
2-
#![feature(const_trait_bound_opt_out)]
3-
#![allow(incomplete_features)]
42
#![allow(bare_trait_objects)]
53

64
struct S;

src/test/ui/rfc-2632-const-trait-impl/syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
#![feature(const_trait_impl)]
66

77
// For now, this parses since an error does not occur until AST lowering.
8-
impl ?const T {}
8+
impl ~const T {}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#![feature(const_trait_impl)]
2+
#![feature(associated_type_bounds)]
3+
4+
trait T {}
5+
struct S;
6+
impl T for S {}
7+
8+
fn rpit() -> impl ~const T { S }
9+
//~^ ERROR `~const` is not allowed
10+
11+
fn apit(_: impl ~const T) {}
12+
//~^ ERROR `~const` is not allowed
13+
14+
fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
15+
//~^ ERROR `~const` is not allowed
16+
17+
fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
18+
//~^ ERROR `~const` is not allowed
19+
20+
fn generic<T: ~const T>() {}
21+
//~^ ERROR `~const` is not allowed
22+
23+
fn where_clause<T>() where T: ~const T {}
24+
//~^ ERROR `~const` is not allowed
25+
26+
impl ~const T {}
27+
//~^ ERROR `~const` is not allowed
28+
29+
fn trait_object() -> &'static dyn ~const T { &S }
30+
//~^ ERROR `~const` is not allowed
31+
32+
fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ~const T>>) {}
33+
//~^ ERROR `~const` is not allowed
34+
35+
struct S<T: ~const ?Sized>(std::marker::PhantomData<T>);
36+
//~^ ERROR `~const` and `?` are mutually exclusive
37+
38+
fn main() {}

src/test/ui/rfc-2632-const-trait-impl/tilde-const-on-non-const-fn.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/test/ui/rfc-2632-const-trait-impl/tilde-const-on-non-const-fn.stderr

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// compile-flags: -Z parse-only
2+
// check-pass
3+
4+
#![feature(const_trait_impl)]
5+
6+
struct S<
7+
T: ~const ?for<'a> Tr<'a> + 'static + ~const std::ops::Add,
8+
T: ~const ?for<'a: 'b> m::Trait<'a>,
9+
>;

0 commit comments

Comments
 (0)