forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#114781 - fee1-dead-contrib:param-impl-source,…
… r=davidtwco Remove constness from `ImplSource::Param`
- Loading branch information
Showing
29 changed files
with
119 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
error[E0015]: cannot call non-const fn `<<T as Foo>::Assoc as Foo>::foo` in constant functions | ||
error[E0277]: the trait bound `T: Foo` is not satisfied | ||
--> $DIR/assoc-type-const-bound-usage.rs:12:5 | ||
| | ||
LL | <T as Foo>::Assoc::foo(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `T` | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
help: consider further restricting this bound | ||
| | ||
LL | const fn foo<T: ~const Foo + Foo>() { | ||
| +++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. | ||
For more information about this error, try `rustc --explain E0277`. |
5 changes: 3 additions & 2 deletions
5
tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...s/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
.../rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
error[E0015]: cannot call non-const fn `<T as Value>::value` in constant functions | ||
--> $DIR/non-const-default-const-specialized.rs:15:5 | ||
error[E0119]: conflicting implementations of trait `Value` for type `FortyTwo` | ||
--> $DIR/non-const-default-const-specialized.rs:27:1 | ||
| | ||
LL | T::value() | ||
| ^^^^^^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
LL | impl<T> Value for T { | ||
| ------------------- first implementation here | ||
... | ||
LL | impl const Value for FortyTwo { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `FortyTwo` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. | ||
For more information about this error, try `rustc --explain E0119`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 18 additions & 8 deletions
26
tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
error: `~const` is not allowed here | ||
--> $DIR/tilde-const-and-const-params.rs:25:11 | ||
--> $DIR/tilde-const-and-const-params.rs:26:11 | ||
| | ||
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { | ||
| ^^^^^^^^^^^^ | ||
| | ||
note: this function is not `const`, so it cannot have `~const` trait bounds | ||
--> $DIR/tilde-const-and-const-params.rs:25:4 | ||
--> $DIR/tilde-const-and-const-params.rs:26:4 | ||
| | ||
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { | ||
| ^^^ | ||
|
||
error[E0015]: cannot call non-const fn `<A as Add42>::add` in constants | ||
--> $DIR/tilde-const-and-const-params.rs:25:61 | ||
error[E0308]: mismatched types | ||
--> $DIR/tilde-const-and-const-params.rs:26:61 | ||
| | ||
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { | ||
| ^^^^^^^^^ | ||
| ^^^^^^^^^ expected `false`, found `true` | ||
| | ||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants | ||
= note: expected constant `false` | ||
found constant `true` | ||
|
||
error: aborting due to 2 previous errors | ||
error[E0308]: mismatched types | ||
--> $DIR/tilde-const-and-const-params.rs:9:44 | ||
| | ||
LL | fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> { | ||
| ^^^^^^^^^ expected `false`, found `true` | ||
| | ||
= note: expected constant `false` | ||
found constant `true` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0015`. | ||
For more information about this error, try `rustc --explain E0308`. |
2 changes: 1 addition & 1 deletion
2
tests/ui/rfcs/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.