-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #106984 - Dylan-DPC:rollup-xce8263, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #101698 (Constify `TypeId` ordering impls) - #106148 (Fix unused_parens issue for higher ranked function pointers) - #106922 (Avoid unsafe code in `to_ascii_[lower/upper]case()`) - #106951 (Remove ineffective run of SimplifyConstCondition) - #106962 (Fix use suggestion span) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
37 changed files
with
310 additions
and
106 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,24 @@ | ||
error[E0277]: can't compare `TypeId` with `_` in const contexts | ||
--> $DIR/issue-90318.rs:14:28 | ||
error: overly complex generic constant | ||
--> $DIR/issue-90318.rs:14:8 | ||
| | ||
LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True, | ||
| ^^ no implementation for `TypeId == _` | ||
| ^^-----------------^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| borrowing is not supported in generic constants | ||
| | ||
= help: the trait `~const PartialEq<_>` is not implemented for `TypeId` | ||
note: the trait `PartialEq<_>` is implemented for `TypeId`, but that implementation is not `const` | ||
--> $DIR/issue-90318.rs:14:28 | ||
| | ||
LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True, | ||
| ^^ | ||
= help: consider moving this anonymous constant into a `const` function | ||
= note: this operation may be supported in the future | ||
|
||
error[E0277]: can't compare `TypeId` with `_` in const contexts | ||
--> $DIR/issue-90318.rs:21:28 | ||
error: overly complex generic constant | ||
--> $DIR/issue-90318.rs:21:8 | ||
| | ||
LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True, | ||
| ^^ no implementation for `TypeId == _` | ||
| ^^-----------------^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| borrowing is not supported in generic constants | ||
| | ||
= help: the trait `~const PartialEq<_>` is not implemented for `TypeId` | ||
note: the trait `PartialEq<_>` is implemented for `TypeId`, but that implementation is not `const` | ||
--> $DIR/issue-90318.rs:21:28 | ||
| | ||
LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True, | ||
| ^^ | ||
= help: consider moving this anonymous constant into a `const` function | ||
= note: this operation may be supported in the future | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// run-pass | ||
#![feature(const_type_id)] | ||
#![feature(const_trait_impl)] | ||
|
||
use std::any::TypeId; | ||
|
||
const fn main() { | ||
assert!(TypeId::of::<u8>() == TypeId::of::<u8>()); | ||
assert!(TypeId::of::<()>() != TypeId::of::<u8>()); | ||
const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>(); | ||
// can't assert `_A` because it is not deterministic | ||
} |
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
Oops, something went wrong.