diff options
| author | varkor <github@varkor.com> | 2020-02-22 01:56:05 +0000 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2020-02-22 11:34:29 +0000 |
| commit | e372ad48001920a77464c94cb2f48702af7e9ad3 (patch) | |
| tree | 24e648ced10848ae313b5910cca0be9913823272 | |
| parent | 76fb26b8c2ad48a8194dceb06073b636ca7ae6d6 (diff) | |
| download | rust-e372ad48001920a77464c94cb2f48702af7e9ad3.tar.gz rust-e372ad48001920a77464c94cb2f48702af7e9ad3.zip | |
Expand the documentation for E0747
4 files changed, 11 insertions, 10 deletions
diff --git a/src/librustc_error_codes/error_codes/E0747.md b/src/librustc_error_codes/error_codes/E0747.md index 9bdfb5ef0bc..df1afbfef46 100644 --- a/src/librustc_error_codes/error_codes/E0747.md +++ b/src/librustc_error_codes/error_codes/E0747.md @@ -9,3 +9,12 @@ struct S<'a, T>(&'a T); type X = S<(), 'static>; // error: the type argument is provided before the // lifetime argument ``` + +The argument order should be changed to match the parameter declaration +order, as in the following. + +``` +struct S<'a, T>(&'a T); + +type X = S<'static, ()>; // ok +``` diff --git a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs b/src/test/ui/const-generics/const-param-after-const-literal-arg.rs index 683bcc867c7..19c4120eb2f 100644 --- a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs +++ b/src/test/ui/const-generics/const-param-after-const-literal-arg.rs @@ -1,7 +1,7 @@ // check-pass +#![allow(incomplete_features)] #![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash struct Foo<const A: usize, const B: usize>; diff --git a/src/test/ui/const-generics/const-param-after-const-literal-arg.stderr b/src/test/ui/const-generics/const-param-after-const-literal-arg.stderr deleted file mode 100644 index a949a6ec9ff..00000000000 --- a/src/test/ui/const-generics/const-param-after-const-literal-arg.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: the feature `const_generics` is incomplete and may cause the compiler to crash - --> $DIR/const-param-after-const-literal-arg.rs:3:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs index 2c81681b85e..756e961ce91 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ b/src/test/ui/const-generics/const-param-before-other-params.rs @@ -1,5 +1,5 @@ +#![allow(incomplete_features)] #![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash fn bar<const X: (), 'a>(_: &'a ()) { //~^ ERROR lifetime parameters must be declared prior to const parameters |
