Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
91eabf5
Add a sane error for rust-call functions not taking tuples during typ…
CraftSpider Nov 11, 2020
bf04b04
Missing feature-gate-abi file
CraftSpider Nov 11, 2020
1e9d5c7
Minor stylistic / review changes
CraftSpider Nov 12, 2020
43bfbb1
Add column number support to Backtrace
est31 Nov 12, 2020
2b7ffec
Don't special case constant operands when lowering intrinsics
tmiasko Nov 16, 2020
92aa0e6
Use `span_suggestion_verbose` instead of `span_suggestion` for `fn` w…
ThePuzzlemaker Nov 15, 2020
b8ed466
Fix ui tests for `fn`s with qualifiers in `extern` blocks
ThePuzzlemaker Nov 15, 2020
c825c74
Move change to check_fn, fix up overloaded-calls-nontuple
CraftSpider Nov 17, 2020
42e45f8
Tidy should not check line lengths
Anthuang Oct 15, 2020
e8426a6
Remove unnecessary abi import
CraftSpider Nov 17, 2020
2c22c05
Fix tests
Anthuang Oct 15, 2020
614a748
Highlight MIR as Rust on GitHub
camelid Nov 17, 2020
7faebe5
Move capture lowering from THIR to MIR
arora-aman Nov 17, 2020
9f70e78
Remove THIR::ExprKind::SelfRef
arora-aman Nov 17, 2020
5163912
Allow using `download-ci-llvm` from directories other than the root
jyn514 Nov 18, 2020
efcbf1b
Permit standalone generic parameters as const generic arguments in ma…
varkor Nov 18, 2020
85bc953
Add tests for multi-segment paths in const generic arguments
varkor Nov 18, 2020
2098ade
Remove redundant notes in E0275
estebank Nov 16, 2020
3527964
Account for indirect cyclic requirements
estebank Nov 18, 2020
c12e77b
review comment
estebank Nov 18, 2020
3034209
Rollup merge of #77675 - Anthuang:tidy-line-length, r=Mark-Simulacrum
Dylan-DPC Nov 19, 2020
60c0316
Rollup merge of #78961 - CraftSpider:22565, r=oli-obk
Dylan-DPC Nov 19, 2020
bd51d55
Rollup merge of #79002 - est31:backtrace_colno, r=dtolnay
Dylan-DPC Nov 19, 2020
966b5c8
Rollup merge of #79082 - ThePuzzlemaker:issue-78941-fix, r=estebank
Dylan-DPC Nov 19, 2020
d7a4adb
Rollup merge of #79101 - tmiasko:lower-func-type, r=jonas-schievink
Dylan-DPC Nov 19, 2020
4efba31
Rollup merge of #79110 - estebank:issue-58964, r=oli-obk
Dylan-DPC Nov 19, 2020
21cb852
Rollup merge of #79147 - camelid:mir-gitattributes, r=oli-obk
Dylan-DPC Nov 19, 2020
05a947d
Rollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis
Dylan-DPC Nov 19, 2020
284017f
Rollup merge of #79156 - jyn514:relative-llvm, r=Mark-Simulacrum
Dylan-DPC Nov 19, 2020
59e475f
Rollup merge of #79164 - varkor:unbraced-single-segment-const-argumen…
Dylan-DPC Nov 19, 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 tests for multi-segment paths in const generic arguments
  • Loading branch information
varkor committed Nov 18, 2020
commit 85bc9538920850e5bd7c1023c9ffbf5e8e69be6a
23 changes: 17 additions & 6 deletions src/test/ui/const-generics/macro_rules-braces.full.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:54:17
--> $DIR/macro_rules-braces.rs:49:17
|
LL | let _: baz!(m::P);
| ^^^^
|
help: enclose the `const` expression in braces
|
LL | let _: baz!({ m::P });
| ^ ^

error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:69:17
|
LL | let _: baz!(10 + 7);
| ^^^^^^
Expand All @@ -10,7 +21,7 @@ LL | let _: baz!({ 10 + 7 });
| ^ ^

error: constant expression depends on a generic parameter
--> $DIR/macro_rules-braces.rs:10:13
--> $DIR/macro_rules-braces.rs:16:13
|
LL | [u8; $x]
| ^^^^^^^^
Expand All @@ -22,7 +33,7 @@ LL | let _: foo!({{ N }});
= 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
--> $DIR/macro_rules-braces.rs:21:13
|
LL | [u8; { $x }]
| ^^^^^^^^^^^^
Expand All @@ -34,7 +45,7 @@ LL | let _: bar!({ N });
= 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
--> $DIR/macro_rules-braces.rs:26:13
|
LL | Foo<$x>
| ^^^^^^^
Expand All @@ -46,7 +57,7 @@ LL | let _: baz!({{ N }});
= 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
--> $DIR/macro_rules-braces.rs:31:13
|
LL | Foo<{ $x }>
| ^^^^^^^^^^^
Expand All @@ -57,5 +68,5 @@ LL | let _: biz!({ N });
= 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
error: aborting due to 6 previous errors

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

error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:69:17
|
LL | let _: baz!(10 + 7);
| ^^^^^^
Expand All @@ -10,36 +21,36 @@ LL | let _: baz!({ 10 + 7 });
| ^ ^

error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:31:20
--> $DIR/macro_rules-braces.rs:37: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
--> $DIR/macro_rules-braces.rs:41: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
--> $DIR/macro_rules-braces.rs:46: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
--> $DIR/macro_rules-braces.rs:51: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
error: aborting due to 6 previous errors

15 changes: 15 additions & 0 deletions src/test/ui/const-generics/macro_rules-braces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]

mod m {
pub const P: usize = 0;
}

const Q: usize = 0;

fn test<const N: usize>() {
struct Foo<const M: usize>;
macro_rules! foo {
Expand All @@ -29,13 +35,22 @@ fn test<const N: usize>() {
let _: foo!(N);
let _: foo!({ N });
let _: foo!({{ N }}); //[min]~ ERROR generic parameters may not
let _: foo!(Q);
let _: foo!(m::P);
let _: bar!(N);
let _: bar!({ N }); //[min]~ ERROR generic parameters may not
let _: bar!(Q);
let _: bar!(m::P);
let _: baz!(N);
let _: baz!({ N });
let _: baz!({{ N }}); //[min]~ ERROR generic parameters may not
let _: baz!(Q);
let _: baz!({ m::P });
let _: baz!(m::P); //~ ERROR expressions must be enclosed in braces
let _: biz!(N);
let _: biz!({ N }); //[min]~ ERROR generic parameters may not
let _: biz!(Q);
let _: biz!(m::P);
let _: foo!(3);
let _: foo!({ 3 });
let _: foo!({{ 3 }});
Expand Down