From 869daad8fce326a4a6976cbd51964da5efacec28 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Mon, 26 Jul 2021 12:29:18 +0800 Subject: [PATCH] Fix tests --- compiler/rustc_trait_selection/src/traits/select/mod.rs | 5 +++-- src/test/ui/consts/const-eval/issue-49296.rs | 4 +++- src/test/ui/consts/const-eval/issue-49296.stderr | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index f7c66f8b284..4c7ee5382d0 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1063,8 +1063,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { }) => {} // auto trait impl AutoImplCandidate(..) => {} - // FIXME check if this is right, but this would allow Sized impls - // BuiltinCandidate { .. } => {} + // generator, this will raise error in other places + // or ignore error with const_async_blocks feature + GeneratorCandidate => {} _ => { // reject all other types of candidates return Err(Unimplemented); diff --git a/src/test/ui/consts/const-eval/issue-49296.rs b/src/test/ui/consts/const-eval/issue-49296.rs index ba0885532f1..bb8113e53f9 100644 --- a/src/test/ui/consts/const-eval/issue-49296.rs +++ b/src/test/ui/consts/const-eval/issue-49296.rs @@ -1,8 +1,10 @@ // issue-49296: Unsafe shenigans in constants can result in missing errors #![feature(const_fn_trait_bound)] +#![feature(const_trait_bound_opt_out)] +#![allow(incomplete_features)] -const unsafe fn transmute(t: T) -> U { +const unsafe fn transmute(t: T) -> U { #[repr(C)] union Transmute { from: T, diff --git a/src/test/ui/consts/const-eval/issue-49296.stderr b/src/test/ui/consts/const-eval/issue-49296.stderr index e87ef160b82..28fdcb7c486 100644 --- a/src/test/ui/consts/const-eval/issue-49296.stderr +++ b/src/test/ui/consts/const-eval/issue-49296.stderr @@ -1,5 +1,5 @@ error[E0080]: evaluation of constant value failed - --> $DIR/issue-49296.rs:18:16 + --> $DIR/issue-49296.rs:20:16 | LL | const X: u64 = *wat(42); | ^^^^^^^^ pointer to alloc2 was dereferenced after this allocation got freed