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.
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 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
14 changes: 14 additions & 0 deletions
14
src/test/ui/const-generics/generic_const_exprs/issue-102768.rs
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,14 @@ | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
trait X { | ||
type Y<'a>; | ||
} | ||
|
||
const _: () = { | ||
fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {} | ||
//~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments | ||
//~| ERROR this associated type takes 0 generic arguments but 1 generic argument | ||
}; | ||
|
||
fn main() {} |
33 changes: 33 additions & 0 deletions
33
src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr
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,33 @@ | ||
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied | ||
--> $DIR/issue-102768.rs:9:30 | ||
| | ||
LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {} | ||
| ^ expected 1 lifetime argument | ||
| | ||
note: associated type defined here, with 1 lifetime parameter: `'a` | ||
--> $DIR/issue-102768.rs:5:10 | ||
| | ||
LL | type Y<'a>; | ||
| ^ -- | ||
help: add missing lifetime argument | ||
| | ||
LL | fn f2<'a>(arg: Box<dyn X<Y<'a, 1> = &'a ()>>) {} | ||
| +++ | ||
|
||
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied | ||
--> $DIR/issue-102768.rs:9:30 | ||
| | ||
LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {} | ||
| ^--- help: remove these generics | ||
| | | ||
| expected 0 generic arguments | ||
| | ||
note: associated type defined here, with 0 generic parameters | ||
--> $DIR/issue-102768.rs:5:10 | ||
| | ||
LL | type Y<'a>; | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0107`. |