Skip to content

Add ConstParamTy trait #108161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/ui/const-generics/nested-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]

struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
struct Foo<const N: [u8; {
struct Foo<const N: usize>;

impl<const N: usize> Foo<N> {
Expand All @@ -15,5 +15,9 @@ struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
Foo::<17>::value()
//~^ ERROR cannot call non-const fn
}]>;
//[min]~^^^^^^^^^^^^ ERROR `[u8; {

// N.B. it is important that the comment above is not inside the array length,
// otherwise it may check for itself, instead of the actual error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is hilarious actually
nice find :)


fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/fmt/format-string-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {
let _ = format!("}");
//~^ ERROR invalid format string: unmatched `}` found
let _ = format!("{\\}");
//~^ ERROR invalid format string: expected `'}'`, found `'\\'`
//~^ ERROR invalid format string: expected `'}'`, found `'\'`
let _ = format!("\n\n\n{\n\n\n");
//~^ ERROR invalid format string
let _ = format!(r###"
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/parser/issues/issue-62913.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"\u\\"
//~^ ERROR incorrect unicode escape sequence
//~| ERROR invalid trailing slash in literal
//~| ERROR expected item, found `"\u\\"`
//~| ERROR expected item, found `"\u\"`