forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#70960 - Centril:rollup-9vmokvw, r=Centril
Rollup of 5 pull requests Successful merges: - rust-lang#70897 (bump Miri) - rust-lang#70900 (Update cargo) - rust-lang#70902 (Update Clippy) - rust-lang#70939 (Add two const generics regression tests) - rust-lang#70958 (Disable try_reserve tests on Android) Failed merges: r? @ghost
- Loading branch information
Showing
10 changed files
with
73 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]); | ||
//~^ ERROR constant expression depends on a generic parameter | ||
|
||
impl<const COUNT: usize> MyArray<COUNT> { | ||
fn inner(&self) -> &[u8; COUNT + 1] { | ||
//~^ ERROR constant expression depends on a generic parameter | ||
&self.0 | ||
} | ||
} | ||
|
||
fn main() {} |
26 changes: 26 additions & 0 deletions
26
src/test/ui/const-generics/issue-61522-array-len-succ.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,26 @@ | ||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash | ||
--> $DIR/issue-61522-array-len-succ.rs:1:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: constant expression depends on a generic parameter | ||
--> $DIR/issue-61522-array-len-succ.rs:4:40 | ||
| | ||
LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]); | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: constant expression depends on a generic parameter | ||
--> $DIR/issue-61522-array-len-succ.rs:8:24 | ||
| | ||
LL | fn inner(&self) -> &[u8; COUNT + 1] { | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: aborting due to 2 previous errors | ||
|
16 changes: 16 additions & 0 deletions
16
src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.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,16 @@ | ||
// check-pass | ||
|
||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
trait Trait<const NAME: &'static str> { | ||
type Assoc; | ||
} | ||
|
||
impl Trait<"0"> for () { | ||
type Assoc = (); | ||
} | ||
|
||
fn main() { | ||
let _: <() as Trait<"0">>::Assoc = (); | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.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,8 @@ | ||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash | ||
--> $DIR/issue-66596-impl-trait-for-str-const-arg.rs:3:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
Submodule cargo
updated
18 files
Submodule clippy
updated
4 files
+10 −2 | clippy_lints/src/let_underscore.rs | |
+16 −9 | clippy_lints/src/methods/mod.rs | |
+41 −50 | clippy_lints/src/use_self.rs | |
+1 −1 | setup-toolchain.sh |
Submodule miri
updated
34 files