Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8b20e9b
Add shortcut for theme picker menu
GuillaumeGomez Nov 5, 2020
1216432
Consider mutable ident binding patterns to be simple
ebkalderon Sep 15, 2020
26b11d6
Don't reuse bindings for `ref mut`
jyn514 Nov 8, 2020
d76cdb0
const param macro test
lcnr Nov 10, 2020
359031e
add generic param mismatch test
lcnr Nov 10, 2020
dd78188
add macro_rules test regarding braces
lcnr Nov 10, 2020
a8310e2
add associated type bounds test
lcnr Nov 10, 2020
19a3fe6
exhaustively enumerate all values of a const param
lcnr Nov 10, 2020
a30b28e
try referencing outer params
lcnr Nov 10, 2020
de1ebbb
const param in async
lcnr Nov 10, 2020
4b5cd04
add test for where clauses mentioning const params
lcnr Nov 10, 2020
f4790ec
add cross crate test
lcnr Nov 10, 2020
96793d3
Handle and test wildcard arguments
jyn514 Nov 10, 2020
46c921d
Improve the page title switch handling between search and doc
GuillaumeGomez Nov 10, 2020
9cf8a49
Don't print thread ids and names in `tracing` logs
jyn514 Nov 10, 2020
6e9ed8b
Enable thread names in debug logging only for `parallel_compiler`
jyn514 Nov 11, 2020
7d9f815
add rustdoc test
lcnr Nov 10, 2020
a9eacf3
add error-in-impl-trait const generics test
lcnr Nov 10, 2020
ad7f330
Add test `default_function_param`
eopb Nov 11, 2020
1d3f9d0
default_trait_param
eopb Nov 11, 2020
a8bc954
Update books
ehuss Nov 12, 2020
25fd89a
Rollup merge of #76730 - ebkalderon:rustdoc-fix-mut-args-async-fn, r=…
GuillaumeGomez Nov 12, 2020
7305584
Rollup merge of #78773 - GuillaumeGomez:theme-picker-shortcut, r=jyn514
GuillaumeGomez Nov 12, 2020
b31c678
Rollup merge of #78916 - lcnr:const-generics-tests, r=varkor
GuillaumeGomez Nov 12, 2020
7b25abf
Rollup merge of #78921 - GuillaumeGomez:search-result-title, r=jyn514
GuillaumeGomez Nov 12, 2020
9e28eb9
Rollup merge of #78933 - jyn514:tracing-output, r=oli-obk
GuillaumeGomez Nov 12, 2020
4ada95f
Rollup merge of #78960 - ethanboxx:const-gen-test-default-error, r=lcnr
GuillaumeGomez Nov 12, 2020
4d0f068
Rollup merge of #78971 - ehuss:update-books, r=ehuss
GuillaumeGomez Nov 12, 2020
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
Prev Previous commit
Next Next commit
add macro_rules test regarding braces
  • Loading branch information
lcnr committed Nov 10, 2020
commit dd78188185de99645178c75036415cbda55d553c
61 changes: 61 additions & 0 deletions src/test/ui/const-generics/macro_rules-braces.full.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:34:17
|
LL | let _: baz!(N);
| ^
|
help: enclose the `const` expression in braces
|
LL | let _: baz!({ N });
| ^ ^

error: constant expression depends on a generic parameter
--> $DIR/macro_rules-braces.rs:10:13
|
LL | [u8; $x]
| ^^^^^^^^
...
LL | let _: foo!({{ N }});
| ------------- in this macro invocation
|
= note: this may fail depending on what value the parameter takes
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
--> $DIR/macro_rules-braces.rs:15:13
|
LL | [u8; { $x }]
| ^^^^^^^^^^^^
...
LL | let _: bar!({ N });
| ----------- in this macro invocation
|
= note: this may fail depending on what value the parameter takes
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
--> $DIR/macro_rules-braces.rs:20:13
|
LL | Foo<$x>
| ^^^^^^^
...
LL | let _: baz!({{ N }});
| ------------- in this macro invocation
|
= note: this may fail depending on what value the parameter takes
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
--> $DIR/macro_rules-braces.rs:25:13
|
LL | Foo<{ $x }>
| ^^^^^^^^^^^
...
LL | let _: biz!({ N });
| ----------- in this macro invocation
|
= note: this may fail depending on what value the parameter takes
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 5 previous errors

45 changes: 45 additions & 0 deletions src/test/ui/const-generics/macro_rules-braces.min.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:34:17
|
LL | let _: baz!(N);
| ^
|
help: enclose the `const` expression in braces
|
LL | let _: baz!({ N });
| ^ ^

error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:31:20
|
LL | let _: foo!({{ N }});
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:33:19
|
LL | let _: bar!({ N });
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:36:20
|
LL | let _: baz!({{ N }});
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:38:19
|
LL | let _: biz!({ N });
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: aborting due to 5 previous errors

43 changes: 43 additions & 0 deletions src/test/ui/const-generics/macro_rules-braces.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]

fn test<const N: usize>() {
struct Foo<const M: usize>;
macro_rules! foo {
($x:expr) => {
[u8; $x] //[full]~ ERROR constant expression depends
}
}
macro_rules! bar {
($x:expr) => {
[u8; { $x }] //[full]~ ERROR constant expression depends
}
}
macro_rules! baz {
( $x:expr) => {
Foo<$x> //[full]~ ERROR constant expression depends
}
}
macro_rules! biz {
($x:expr) => {
Foo<{ $x }> //[full]~ ERROR constant expression depends
};
}

let _: foo!(N);
let _: foo!({ N });
let _: foo!({{ N }}); //[min]~ ERROR generic parameters may not
let _: bar!(N);
let _: bar!({ N }); //[min]~ ERROR generic parameters may not
let _: baz!(N); //~ ERROR expressions must be enclosed in braces
let _: baz!({ N });
let _: baz!({{ N }}); //[min]~ ERROR generic parameters may not
let _: biz!(N);
let _: biz!({ N }); //[min]~ ERROR generic parameters may not
}

fn main() {
test::<3>();
}