-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obk
Remove const_in_array_repeat Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682. I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.
- Loading branch information
Showing
27 changed files
with
61 additions
and
192 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
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
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
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
11 changes: 0 additions & 11 deletions
11
src/doc/unstable-book/src/language-features/const-in-array-repeat-expressions.md
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied | ||
--> $DIR/repeat_empty_ok.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 | ||
|
||
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied | ||
--> $DIR/repeat_empty_ok.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 | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
File renamed without changes.
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
2 changes: 0 additions & 2 deletions
2
...rray-repeat-exprs/fn-call-in-non-const.rs → ...nsts/const-blocks/fn-call-in-non-const.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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![feature(const_in_array_repeat_expressions)] | ||
|
||
// Some type that is not copyable. | ||
struct Bar; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...-repeat-exprs/fn-call-in-non-const.stderr → .../const-blocks/fn-call-in-non-const.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
1 change: 0 additions & 1 deletion
1
...-const-array-repeat-exprs/migrate-fail.rs → ...st/ui/consts/const-blocks/migrate-fail.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
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
1 change: 0 additions & 1 deletion
1
...-const-array-repeat-exprs/migrate-pass.rs → ...st/ui/consts/const-blocks/migrate-pass.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
1 change: 0 additions & 1 deletion
1
...2203-const-array-repeat-exprs/nll-fail.rs → src/test/ui/consts/const-blocks/nll-fail.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
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
1 change: 0 additions & 1 deletion
1
...2203-const-array-repeat-exprs/nll-pass.rs → src/test/ui/consts/const-blocks/nll-pass.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
1 change: 0 additions & 1 deletion
1
...2203-const-array-repeat-exprs/run-pass.rs → src/test/ui/consts/const-blocks/run-pass.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// run-pass | ||
#![feature(const_in_array_repeat_expressions)] | ||
|
||
#[derive(Debug, Eq, PartialEq)] | ||
struct Bar; | ||
|
2 changes: 0 additions & 2 deletions
2
...3-const-array-repeat-exprs/trait-error.rs → ...est/ui/consts/const-blocks/trait-error.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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![feature(const_in_array_repeat_expressions)] | ||
|
||
#[derive(Copy, Clone)] | ||
struct Foo<T>(T); | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...nst-array-repeat-exprs/trait-error.stderr → ...ui/consts/const-blocks/trait-error.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
17 changes: 0 additions & 17 deletions
17
src/test/ui/feature-gates/feature-gate-const_in_array_repeat_expressions.rs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.