diff options
| author | Michael Goulet <michael@errs.io> | 2022-02-17 19:18:42 -0800 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-02-17 19:18:42 -0800 |
| commit | 207fb5f070174368ebb56a17b6f4e5a161cabe51 (patch) | |
| tree | 56ccd3588578c71e303a20b34ebd152122767533 /compiler/rustc_ast_lowering/src | |
| parent | f04f732503a239b3fac22be2238d21971aa03dce (diff) | |
| download | rust-207fb5f070174368ebb56a17b6f4e5a161cabe51.tar.gz rust-207fb5f070174368ebb56a17b6f4e5a161cabe51.zip | |
fix impl trait message, bless tests
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 803c93c259e..bdbee3e2f4b 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -297,7 +297,7 @@ impl std::fmt::Display for ImplTraitPosition { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let name = match self { ImplTraitPosition::Path => "path", - ImplTraitPosition::Variable => "variable", + ImplTraitPosition::Variable => "variable binding", ImplTraitPosition::Type => "type", ImplTraitPosition::Trait => "trait", ImplTraitPosition::AsyncBlock => "async block", @@ -1419,10 +1419,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { self.sess, t.span, E0562, - "`impl Trait` not allowed outside of \ - function and inherent method return types", + "`impl Trait` only allowed in function and inherent method return types, not in {}", + position ); - err.note(&format!("found `impl Trait` in {}", position)); err.emit(); hir::TyKind::Err } |
