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.
Bless tests and handle tests/crashes
- Loading branch information
Showing
35 changed files
with
386 additions
and
285 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
3 changes: 1 addition & 2 deletions
3
...onst-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.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,13 +1,12 @@ | ||
//@ edition:2021 | ||
//@ check-pass | ||
// issues rust-lang/rust#111911 | ||
// test for ICE opaque type with non-universal region substs | ||
|
||
#![feature(adt_const_params)] | ||
#![allow(incomplete_features)] | ||
|
||
pub async fn foo<const X: &'static str>() {} | ||
//~^ ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias | ||
//~| ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias | ||
fn bar<const N: &'static u8>() -> impl Sized {} | ||
|
||
pub fn main() {} |
16 changes: 0 additions & 16 deletions
16
...-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.stderr
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
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
21 changes: 21 additions & 0 deletions
21
tests/ui/const-generics/generic_const_exprs/error_in_ty.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,21 @@ | ||
//@ compile-flags: -Znext-solver=coherence | ||
|
||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
pub struct A<const z: [usize; x]> {} | ||
//~^ ERROR: cannot find value `x` in this scope | ||
//~| ERROR: `[usize; x]` is forbidden as the type of a const generic parameter | ||
|
||
impl A<2> { | ||
//~^ ERROR: mismatched types | ||
pub const fn B() {} | ||
//~^ ERROR: duplicate definitions | ||
} | ||
|
||
impl A<2> { | ||
//~^ ERROR: mismatched types | ||
pub const fn B() {} | ||
} | ||
|
||
fn main() {} |
45 changes: 45 additions & 0 deletions
45
tests/ui/const-generics/generic_const_exprs/error_in_ty.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,45 @@ | ||
error[E0425]: cannot find value `x` in this scope | ||
--> $DIR/error_in_ty.rs:6:31 | ||
| | ||
LL | pub struct A<const z: [usize; x]> {} | ||
| - ^ help: a const parameter with a similar name exists: `z` | ||
| | | ||
| similarly named const parameter `z` defined here | ||
|
||
error: `[usize; x]` is forbidden as the type of a const generic parameter | ||
--> $DIR/error_in_ty.rs:6:23 | ||
| | ||
LL | pub struct A<const z: [usize; x]> {} | ||
| ^^^^^^^^^^ | ||
| | ||
= note: the only supported types are integers, `bool` and `char` | ||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | ||
| | ||
LL + #![feature(adt_const_params)] | ||
| | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/error_in_ty.rs:10:8 | ||
| | ||
LL | impl A<2> { | ||
| ^ expected `[usize; x]`, found integer | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/error_in_ty.rs:16:8 | ||
| | ||
LL | impl A<2> { | ||
| ^ expected `[usize; x]`, found integer | ||
|
||
error[E0592]: duplicate definitions with name `B` | ||
--> $DIR/error_in_ty.rs:12:5 | ||
| | ||
LL | pub const fn B() {} | ||
| ^^^^^^^^^^^^^^^^ duplicate definitions for `B` | ||
... | ||
LL | pub const fn B() {} | ||
| ---------------- other definition for `B` | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0308, E0425, E0592. | ||
For more information about an error, try `rustc --explain E0308`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ edition:2021 | ||
|
||
trait Trait<const N: Trait = bar> { | ||
//~^ ERROR: cannot find value `bar` in this scope | ||
//~| ERROR: cycle detected when computing type of `Trait::N` | ||
//~| ERROR: the trait `Trait` cannot be made into an object | ||
//~| ERROR: the trait `Trait` cannot be made into an object | ||
//~| ERROR: the trait `Trait` cannot be made into an object | ||
//~| ERROR: `(dyn Trait<{const error}> + 'static)` is forbidden as the type of a const generic parameter | ||
//~| ERROR: trait objects must include the `dyn` keyword | ||
async fn a() {} | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.