X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_passes%2Ferror_codes.rs;h=3f5b0dcab74e0a67271ad76c6040bc6c0020ff83;hb=8b7d2bc270af4bc873303e7c43000e49a0d5fa5a;hp=a2626617afec33f880c11b431a50a54d5d40e730;hpb=518deda77feb4957bfd311b6cb50baa7ef9ca6a2;p=rust.git diff --git a/src/librustc_passes/error_codes.rs b/src/librustc_passes/error_codes.rs index a2626617afe..3f5b0dcab74 100644 --- a/src/librustc_passes/error_codes.rs +++ b/src/librustc_passes/error_codes.rs @@ -552,6 +552,30 @@ trait Foo { ``` "##, +E0666: r##" +`impl Trait` types cannot appear nested in the +generic arguments of other `impl Trait` types. + +Example of erroneous code: + +```compile_fail,E0666 +trait MyGenericTrait {} +trait MyInnerTrait {} + +fn foo(bar: impl MyGenericTrait) {} +``` + +Type parameters for `impl Trait` types must be +explicitly defined as named generic parameters: + +``` +trait MyGenericTrait {} +trait MyInnerTrait {} + +fn foo(bar: impl MyGenericTrait) {} +``` +"##, + E0695: r##" A `break` statement without a label appeared inside a labeled block. @@ -602,10 +626,31 @@ async fn foo() {} Switch to the Rust 2018 edition to use `async fn`. "##, +E0744: r##" +Control-flow expressions are not allowed inside a const context. + +At the moment, `if` and `match`, as well as the looping constructs `for`, +`while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`. + +```compile_fail,E0744 +const _: { + let mut x = 0; + loop { + x += 1; + if x == 4 { + break; + } + } + + x +}; +``` + +"##, + ; E0226, // only a single explicit lifetime bound is permitted E0472, // asm! is unsupported on this target - E0666, // nested `impl Trait` is illegal E0667, // `impl Trait` in projections E0696, // `continue` pointing to a labeled block E0706, // `async fn` in trait