Skip to content

Commit d464dd0

Browse files
committed
fix tests
1 parent d1f4bc5 commit d464dd0

File tree

8 files changed

+44
-22
lines changed

8 files changed

+44
-22
lines changed

Diff for: compiler/rustc_middle/src/ty/print/pretty.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2896,7 +2896,8 @@ define_print_and_forward_display! {
28962896
TraitPredPrintModifiersAndPath<'tcx> {
28972897
if let Some(idx) = cx.tcx().generics_of(self.0.trait_ref.def_id).host_effect_index
28982898
{
2899-
if self.0.trait_ref.args.const_at(idx) != cx.tcx().consts.true_ {
2899+
let arg = self.0.trait_ref.args.const_at(idx);
2900+
if arg != cx.tcx().consts.true_ && !arg.has_infer() {
29002901
p!("~const ");
29012902
}
29022903
}

Diff for: tests/ui/consts/fn_trait_refs.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ error[E0635]: unknown feature `const_fn_trait_ref_impls`
44
LL | #![feature(const_fn_trait_ref_impls)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
66

7-
error[E0635]: unknown feature `const_cmp`
8-
--> $DIR/fn_trait_refs.rs:8:12
9-
|
10-
LL | #![feature(const_cmp)]
11-
| ^^^^^^^^^
12-
137
error: ~const can only be applied to `#[const_trait]` traits
148
--> $DIR/fn_trait_refs.rs:15:15
159
|
@@ -80,6 +74,6 @@ LL | T: ~const FnMut<()> + ~const Destruct,
8074
|
8175
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
8276

83-
error: aborting due to 12 previous errors
77+
error: aborting due to 11 previous errors
8478

8579
For more information about this error, try `rustc --explain E0635`.

Diff for: tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const fn equals_self<T: ~const Foo>(t: &T) -> bool {
2121
// it not using the impl.
2222

2323
pub const EQ: bool = equals_self(&S);
24-
//~^ ERROR
25-
// FIXME(effects) the diagnostics here isn't ideal, we shouldn't get `<false>`
24+
//~^ ERROR: the trait bound `S: ~const Foo` is not satisfied
2625

2726
fn main() {}

Diff for: tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `S: ~const Foo<false>` is not satisfied
1+
error[E0277]: the trait bound `S: ~const Foo` is not satisfied
22
--> $DIR/call-generic-method-nonconst.rs:23:34
33
|
44
LL | pub const EQ: bool = equals_self(&S);

Diff for: tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr

+14-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ error[E0277]: can't compare `impl PartialEq + Destruct + Copy` with `impl Partia
44
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `impl PartialEq + Destruct + Copy == impl PartialEq + Destruct + Copy`
66
|
7-
= help: the trait `PartialEq<impl PartialEq + Destruct + Copy>` is not implemented for `impl PartialEq + Destruct + Copy`
7+
= help: the trait `~const PartialEq` is not implemented for `impl PartialEq + Destruct + Copy`
88
note: required by a bound in `Foo::{opaque#0}`
99
--> $DIR/const-impl-trait.rs:24:22
1010
|
1111
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
1212
| ^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
1313

14-
error: aborting due to 1 previous error
14+
error[E0277]: can't drop `impl PartialEq + Destruct + Copy`
15+
--> $DIR/const-impl-trait.rs:28:17
16+
|
17+
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy {
18+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `impl PartialEq + Destruct + Copy`
19+
|
20+
note: required by a bound in `Foo::{opaque#0}`
21+
--> $DIR/const-impl-trait.rs:24:41
22+
|
23+
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
24+
| ^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
25+
26+
error: aborting due to 2 previous errors
1527

1628
For more information about this error, try `rustc --explain E0277`.

Diff for: tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// check-pass
1+
// known-bug: #110395
2+
23
#![feature(const_trait_impl, const_cmp, const_default_impls, derive_const, effects)]
34

45
pub struct A;
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
error[E0635]: unknown feature `const_default_impls`
2-
--> $DIR/derive-const-use.rs:3:5
2+
--> $DIR/derive-const-use.rs:3:41
33
|
4-
LL | const_default_impls, derive_const)]
5-
| ^^^^^^^^^^^^^^^^^^^
4+
LL | #![feature(const_trait_impl, const_cmp, const_default_impls, derive_const, effects)]
5+
| ^^^^^^^^^^^^^^^^^^^
66

7-
error: aborting due to 1 previous error
7+
error: const `impl` for trait `Default` which is not marked with `#[const_trait]`
8+
--> $DIR/derive-const-use.rs:7:12
9+
|
10+
LL | impl const Default for A {
11+
| ^^^^^^^
12+
|
13+
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
14+
= note: adding a non-const method body in the future would be a breaking change
15+
16+
error: const `impl` for trait `Default` which is not marked with `#[const_trait]`
17+
--> $DIR/derive-const-use.rs:15:16
18+
|
19+
LL | #[derive_const(Default, PartialEq)]
20+
| ^^^^^^^
21+
|
22+
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
23+
= note: adding a non-const method body in the future would be a breaking change
24+
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
25+
26+
error: aborting due to 3 previous errors
827

928
For more information about this error, try `rustc --explain E0635`.

Diff for: tests/ui/suggestions/invalid-bin-op.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ help: consider annotating `S<T>` with `#[derive(PartialEq)]`
1616
LL + #[derive(PartialEq)]
1717
LL | struct S<T>(T);
1818
|
19-
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
20-
|
21-
LL | pub fn foo<T>(s: S<T>, t: S<T>) where S<T>: PartialEq {
22-
| +++++++++++++++++++++
2319

2420
error: aborting due to 1 previous error
2521

0 commit comments

Comments
 (0)