-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
1 parent
78e2206
commit fe39653
Showing
3 changed files
with
39 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
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 @@ | ||
#![crate_type = "lib"] | ||
|
||
pub struct Header<'a> { | ||
pub value: &'a [u8], | ||
} | ||
|
||
pub fn test() { | ||
let headers = [Header{value: &[]}; 128]; | ||
//~^ ERROR the trait bound | ||
} | ||
|
||
pub fn test2() { | ||
let headers = [Header{value: &[0]}; 128]; | ||
//~^ ERROR the trait bound | ||
} |
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,23 @@ | ||
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied | ||
--> $DIR/issue-80371.rs:8:19 | ||
| | ||
LL | let headers = [Header{value: &[]}; 128]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Header<'_>` | ||
| | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
= note: this array initializer can be evaluated at compile-time, see issue #49147 <https://github.com/rust-lang/rust/issues/49147> for more information | ||
= help: add `#![feature(const_in_array_repeat_expressions)]` to the crate attributes to enable | ||
|
||
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied | ||
--> $DIR/issue-80371.rs:13:19 | ||
| | ||
LL | let headers = [Header{value: &[0]}; 128]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Header<'_>` | ||
| | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
= note: this array initializer can be evaluated at compile-time, see issue #49147 <https://github.com/rust-lang/rust/issues/49147> for more information | ||
= help: add `#![feature(const_in_array_repeat_expressions)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |