forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#114879 - matthiaskrgr:rollup-tim571q, r=matth…
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#114721 (Optimizing the rest of bool's Ord implementation) - rust-lang#114746 (Don't add associated type bound for non-types) - rust-lang#114779 (Add check before suggest removing parens) - rust-lang#114859 (Add trait related queries to SMIR's rustc_internal) - rust-lang#114861 (fix typo: affect -> effect) - rust-lang#114867 ([nit] Fix a comment typo.) - rust-lang#114871 (Update the link in the docs of `std::intrinsics`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
15 changed files
with
119 additions
and
15 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
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,10 @@ | ||
#![feature(associated_type_bounds)] | ||
|
||
pub fn accept(_: impl Trait<K: Copy>) {} | ||
//~^ ERROR expected associated type, found associated constant | ||
|
||
pub trait Trait { | ||
const K: i32; | ||
} | ||
|
||
fn main() {} |
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,10 @@ | ||
error: expected associated type, found associated constant | ||
--> $DIR/consts.rs:3:29 | ||
| | ||
LL | pub fn accept(_: impl Trait<K: Copy>) {} | ||
| ^ | ||
| | ||
= note: trait bounds not allowed on associated constant | ||
|
||
error: aborting due to previous error | ||
|
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,15 @@ | ||
enum Enum<T> { SVariant { v: T }, UVariant } | ||
|
||
macro_rules! is_variant { | ||
(TSVariant, ) => (!); | ||
(SVariant, ) => (!); | ||
(UVariant, $expr:expr) => (is_variant!(@check UVariant, {}, $expr)); | ||
(@check $variant:ident, $matcher:tt, $expr:expr) => ( | ||
assert!(if let Enum::$variant::<()> $matcher = $expr () { true } else { false }, | ||
); | ||
); | ||
} | ||
|
||
fn main() { | ||
is_variant!(UVariant, Enum::<()>::UVariant); //~ ERROR expected function | ||
} |
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,15 @@ | ||
error[E0618]: expected function, found `Enum<()>` | ||
--> $DIR/issue-114701.rs:14:27 | ||
| | ||
LL | enum Enum<T> { SVariant { v: T }, UVariant } | ||
| -------- `Enum::UVariant` defined here | ||
... | ||
LL | assert!(if let Enum::$variant::<()> $matcher = $expr () { true } else { false }, | ||
| -------- call expression requires function | ||
... | ||
LL | is_variant!(UVariant, Enum::<()>::UVariant); | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0618`. |