Skip to content

Commit

Permalink
Update hax and rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Aug 14, 2024
1 parent 93c558c commit 27d851d
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 107 deletions.
6 changes: 3 additions & 3 deletions charon/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion charon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ tracing-tree = "0.3"
tracing = { version = "0.1", features = [ "max_level_trace", "release_max_level_warn" ] }
which = "6.0.1"

hax-frontend-exporter = { git = "https://github.com/hacspec/hax", branch = "main", optional = true }
hax-frontend-exporter = { git = "https://github.com/Nadrieril/hax", branch = "update-rustc", optional = true }
# hax-frontend-exporter = { path = "../../hax/frontend/exporter", optional = true }
macros = { path = "./macros" }

Expand Down
1 change: 0 additions & 1 deletion charon/src/bin/charon-driver/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![feature(iter_array_chunks)]
#![feature(iterator_try_collect)]
#![feature(let_chains)]
#![feature(lint_reasons)]

extern crate rustc_ast;
extern crate rustc_ast_pretty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,17 +1162,6 @@ impl<'tcx, 'ctx, 'ctx1> BodyTransCtx<'tcx, 'ctx, 'ctx1> {
target,
}
}
TerminatorKind::Yield {
value: _,
resume: _,
resume_arg: _,
drop: _,
} => {
error_or_panic!(self, rustc_span, "Unsupported terminator: yield");
}
TerminatorKind::CoroutineDrop => {
error_or_panic!(self, rustc_span, "Unsupported terminator: coroutine drop");
}
TerminatorKind::FalseEdge {
real_target,
imaginary_target,
Expand Down Expand Up @@ -1203,6 +1192,15 @@ impl<'tcx, 'ctx, 'ctx1> BodyTransCtx<'tcx, 'ctx, 'ctx1> {
TerminatorKind::InlineAsm { .. } => {
error_or_panic!(self, rustc_span, "Inline assembly is not supported");
}
TerminatorKind::CoroutineDrop
| TerminatorKind::TailCall { .. }
| TerminatorKind::Yield { .. } => {
error_or_panic!(
self,
rustc_span,
format!("Unsupported terminator: {:?}", terminator.kind)
);
}
};

// Add the span information
Expand Down
1 change: 0 additions & 1 deletion charon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#![feature(impl_trait_in_assoc_type)]
#![feature(iterator_try_collect)]
#![feature(let_chains)]
#![feature(lint_reasons)]
#![feature(trait_alias)]
#![feature(register_tool)]
// For when we use charon on itself :3
Expand Down
1 change: 0 additions & 1 deletion charon/tests/crate_data.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(rustc_private)]
#![feature(lint_reasons)]

use assert_cmd::prelude::{CommandCargoExt, OutputAssertExt};
use itertools::Itertools;
Expand Down
6 changes: 3 additions & 3 deletions charon/tests/ui/external.out
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl core::clone::impls::{impl core::clone::Clone for u32}#8 : core::clone::Clon
fn clone = core::clone::impls::{impl core::clone::Clone for u32}#8::clone
}

impl core::marker::{impl core::marker::Copy for u32}#41 : core::marker::Copy<u32>
impl core::marker::{impl core::marker::Copy for u32}#40 : core::marker::Copy<u32>
{
parent_clause0 = core::clone::impls::{impl core::clone::Clone for u32}#8
}
Expand All @@ -75,7 +75,7 @@ impl core::num::nonzero::private::{impl core::marker::Copy for core::num::nonzer

impl core::num::nonzero::{impl core::num::nonzero::ZeroablePrimitive for u32}#20 : core::num::nonzero::ZeroablePrimitive<u32>
{
parent_clause0 = core::marker::{impl core::marker::Copy for u32}#41
parent_clause0 = core::marker::{impl core::marker::Copy for u32}#40
parent_clause1 = core::num::nonzero::{impl core::num::nonzero::private::Sealed for u32}#19
parent_clause2 = core::num::nonzero::private::{impl core::marker::Copy for core::num::nonzero::private::NonZeroU32Inner}#12
parent_clause3 = core::num::nonzero::private::{impl core::clone::Clone for core::num::nonzero::private::NonZeroU32Inner}#11
Expand Down Expand Up @@ -153,7 +153,7 @@ fn test_crate::use_get<'_0>(@1: &'_0 (core::cell::Cell<u32>)) -> u32
let @2: &'_ (core::cell::Cell<u32>); // anonymous local

@2 := &*(rc@1)
@0 := core::cell::{core::cell::Cell<T>}#10::get<u32>[core::marker::{impl core::marker::Copy for u32}#41](move (@2))
@0 := core::cell::{core::cell::Cell<T>}#10::get<u32>[core::marker::{impl core::marker::Copy for u32}#40](move (@2))
drop @2
return
}
Expand Down
18 changes: 9 additions & 9 deletions charon/tests/ui/generic-associated-types.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error: Ignoring the following item due to an error: test_crate::{impl#0}
10 | impl<'a, T> LendingIterator for Option<&'a T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at /rustc/6b0f4b5ec3aa707ecaa78230722117324a4ce23c/compiler/rustc_type_ir/src/binder.rs:785:9:
thread 'rustc' panicked at /rustc/730d5d4095a264ef5f7c0a0781eea68c15431d45/compiler/rustc_type_ir/src/binder.rs:783:9:
const parameter `'a/#1` ('a/#1/1) out of range when instantiating args=[Self/#0]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: Thread panicked when extracting item `test_crate::LendingIterator::next`.
Expand All @@ -38,9 +38,10 @@ warning[E9999]: Hax frontend found a projected type with escaping bound vars. Pl
- alias_ty: AliasTy {
args: [
impl for<'a> FnMut(I::Item<'a>)/#1,
(Alias(Projection, AliasTy { args: [I/#0, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item }),),
(Alias(Projection, AliasTy { args: [I/#0, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item, .. }),),
],
def_id: core::ops::function::FnOnce::Output,
..
}
- alias_kind: Projection
- trait_ref: <impl for<'a> FnMut(I::Item<'a>) as std::ops::FnOnce<(<I as LendingIterator>::Item<'a>,)>>
Expand All @@ -50,17 +51,17 @@ warning[E9999]: Hax frontend found a projected type with escaping bound vars. Pl
)
- rebased_generics: [
impl for<'a> FnMut(I::Item<'a>)/#1,
(Alias(Projection, AliasTy { args: [I/#0, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item }),),
(Alias(Projection, AliasTy { args: [I/#0, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item }),),
(Alias(Projection, AliasTy { args: [I/#0, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item, .. }),),
(Alias(Projection, AliasTy { args: [I/#0, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item, .. }),),
]
- norm_rebased_generics: Err(
Type(
(Alias(Projection, AliasTy { args: [impl for<'a> FnMut(I::Item<'a>)/#1, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item }),),
(Alias(Projection, AliasTy { args: [impl for<'a> FnMut(I::Item<'a>)/#1, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item, .. }),),
),
)
- norm_generics: Err(
Type(
(Alias(Projection, AliasTy { args: [impl for<'a> FnMut(I::Item<'a>)/#1, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item }),),
(Alias(Projection, AliasTy { args: [impl for<'a> FnMut(I::Item<'a>)/#1, '^0.Named(test_crate::for_each::'a, "'a")], def_id: test_crate::LendingIterator::Item, .. }),),
),
)
- early_binder_generics: Ok(
Expand All @@ -73,7 +74,7 @@ warning[E9999]: Hax frontend found a projected type with escaping bound vars. Pl
= note: ⚠️ This is a bug in Hax's frontend.
Please report this error to https://github.com/hacspec/hax/issues with some context (e.g. the current crate)!

thread 'rustc' panicked at /rustc/6b0f4b5ec3aa707ecaa78230722117324a4ce23c/compiler/rustc_type_ir/src/binder.rs:785:9:
thread 'rustc' panicked at /rustc/730d5d4095a264ef5f7c0a0781eea68c15431d45/compiler/rustc_type_ir/src/binder.rs:783:9:
const parameter `'a/#1` ('a/#1/1) out of range when instantiating args=[I/#0]
error: Thread panicked when extracting item `test_crate::for_each`.
--> tests/ui/generic-associated-types.rs:24:1
Expand All @@ -97,5 +98,4 @@ warning: unused variable: `x`

error: aborting due to 6 previous errors; 2 warnings emitted

[ERROR charon_driver:249] Compilation encountered 6 errors
Error: Charon driver exited with code 1
Error: Charon driver exited with code 101
4 changes: 2 additions & 2 deletions charon/tests/ui/issue-4-slice-try-into-array.out
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl core::clone::impls::{impl core::clone::Clone for u8}#6 : core::clone::Clone
fn clone = core::clone::impls::{impl core::clone::Clone for u8}#6::clone
}

impl core::marker::{impl core::marker::Copy for u8}#39 : core::marker::Copy<u8>
impl core::marker::{impl core::marker::Copy for u8}#38 : core::marker::Copy<u8>
{
parent_clause0 = core::clone::impls::{impl core::clone::Clone for u8}#6
}
Expand Down Expand Up @@ -102,7 +102,7 @@ fn test_crate::trait_error<'_0>(@1: &'_0 (Slice<u8>))
let @5: (); // anonymous local

@4 := &*(s@1)
@3 := core::convert::{impl core::convert::TryInto<U> for T}#6<&'_ (Slice<u8>), Array<u8, 4 : usize>>[core::array::{impl core::convert::TryFrom<&'_0 (Slice<T>)> for Array<T, const N : usize>}#7<'_, u8, 4 : usize>[core::marker::{impl core::marker::Copy for u8}#39]]::try_into(move (@4))
@3 := core::convert::{impl core::convert::TryInto<U> for T}#6<&'_ (Slice<u8>), Array<u8, 4 : usize>>[core::array::{impl core::convert::TryFrom<&'_0 (Slice<T>)> for Array<T, const N : usize>}#7<'_, u8, 4 : usize>[core::marker::{impl core::marker::Copy for u8}#38]]::try_into(move (@4))
drop @4
_array@2 := core::result::{core::result::Result<T, E>}::unwrap<Array<u8, 4 : usize>, core::array::TryFromSliceError>[core::array::{impl core::fmt::Debug for core::array::TryFromSliceError}#26](move (@3))
drop @3
Expand Down
4 changes: 2 additions & 2 deletions charon/tests/ui/issue-4-traits.out
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl core::clone::impls::{impl core::clone::Clone for u8}#6 : core::clone::Clone
fn clone = core::clone::impls::{impl core::clone::Clone for u8}#6::clone
}

impl core::marker::{impl core::marker::Copy for u8}#39 : core::marker::Copy<u8>
impl core::marker::{impl core::marker::Copy for u8}#38 : core::marker::Copy<u8>
{
parent_clause0 = core::clone::impls::{impl core::clone::Clone for u8}#6
}
Expand Down Expand Up @@ -102,7 +102,7 @@ fn test_crate::trait_error<'_0>(@1: &'_0 (Slice<u8>))
let @5: (); // anonymous local

@4 := &*(s@1)
@3 := core::convert::{impl core::convert::TryInto<U> for T}#6<&'_ (Slice<u8>), Array<u8, 4 : usize>>[core::array::{impl core::convert::TryFrom<&'_0 (Slice<T>)> for Array<T, const N : usize>}#7<'_, u8, 4 : usize>[core::marker::{impl core::marker::Copy for u8}#39]]::try_into(move (@4))
@3 := core::convert::{impl core::convert::TryInto<U> for T}#6<&'_ (Slice<u8>), Array<u8, 4 : usize>>[core::array::{impl core::convert::TryFrom<&'_0 (Slice<T>)> for Array<T, const N : usize>}#7<'_, u8, 4 : usize>[core::marker::{impl core::marker::Copy for u8}#38]]::try_into(move (@4))
drop @4
_array@2 := core::result::{core::result::Result<T, E>}::unwrap<Array<u8, 4 : usize>, core::array::TryFromSliceError>[core::array::{impl core::fmt::Debug for core::array::TryFromSliceError}#26](move (@3))
drop @3
Expand Down
4 changes: 2 additions & 2 deletions charon/tests/ui/issue-45-misc.out
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl core::clone::impls::{impl core::clone::Clone for usize}#5 : core::clone::Cl
fn clone = core::clone::impls::{impl core::clone::Clone for usize}#5::clone
}

impl core::marker::{impl core::marker::Copy for usize}#38 : core::marker::Copy<usize>
impl core::marker::{impl core::marker::Copy for usize}#37 : core::marker::Copy<usize>
{
parent_clause0 = core::clone::impls::{impl core::clone::Clone for usize}#5
}
Expand All @@ -324,7 +324,7 @@ impl core::num::nonzero::private::{impl core::marker::Copy for core::num::nonzer

impl core::num::nonzero::{impl core::num::nonzero::ZeroablePrimitive for usize}#26 : core::num::nonzero::ZeroablePrimitive<usize>
{
parent_clause0 = core::marker::{impl core::marker::Copy for usize}#38
parent_clause0 = core::marker::{impl core::marker::Copy for usize}#37
parent_clause1 = core::num::nonzero::{impl core::num::nonzero::private::Sealed for usize}#25
parent_clause2 = core::num::nonzero::private::{impl core::marker::Copy for core::num::nonzero::private::NonZeroUsizeInner}#27
parent_clause3 = core::num::nonzero::private::{impl core::clone::Clone for core::num::nonzero::private::NonZeroUsizeInner}#26
Expand Down
3 changes: 1 addition & 2 deletions charon/tests/ui/issue-91-enum-to-discriminant-cast.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ error: Unsupported statement kind: intrinsic

error: aborting due to 1 previous error

[ERROR charon_driver:249] Compilation encountered 1 errors
Error: Charon driver exited with code 1
Error: Charon driver exited with code 101
4 changes: 2 additions & 2 deletions charon/tests/ui/loops.out
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ impl core::clone::impls::{impl core::clone::Clone for usize}#5 : core::clone::Cl
fn clone = core::clone::impls::{impl core::clone::Clone for usize}#5::clone
}

impl core::marker::{impl core::marker::Copy for usize}#38 : core::marker::Copy<usize>
impl core::marker::{impl core::marker::Copy for usize}#37 : core::marker::Copy<usize>
{
parent_clause0 = core::clone::impls::{impl core::clone::Clone for usize}#5
}
Expand All @@ -1053,7 +1053,7 @@ impl core::num::nonzero::private::{impl core::marker::Copy for core::num::nonzer

impl core::num::nonzero::{impl core::num::nonzero::ZeroablePrimitive for usize}#26 : core::num::nonzero::ZeroablePrimitive<usize>
{
parent_clause0 = core::marker::{impl core::marker::Copy for usize}#38
parent_clause0 = core::marker::{impl core::marker::Copy for usize}#37
parent_clause1 = core::num::nonzero::{impl core::num::nonzero::private::Sealed for usize}#25
parent_clause2 = core::num::nonzero::private::{impl core::marker::Copy for core::num::nonzero::private::NonZeroUsizeInner}#27
parent_clause3 = core::num::nonzero::private::{impl core::clone::Clone for core::num::nonzero::private::NonZeroUsizeInner}#26
Expand Down
36 changes: 6 additions & 30 deletions charon/tests/ui/matches.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@ fn test_crate::test1(@1: test_crate::E1) -> bool
0 | 1 => {
@0 := const (true)
},
_ => {
match x@1 {
2 => {
@0 := const (false)
},
_ => {
@fake_read(x@1)
undefined_behavior
}
}
2 => {
@0 := const (false)
}
}
return
Expand Down Expand Up @@ -65,16 +57,8 @@ fn test_crate::test2(@1: test_crate::E2) -> u32
@0 := copy (n@2)
drop n@2
},
_ => {
match x@1 {
2 => {
@0 := const (0 : u32)
},
_ => {
@fake_read(x@1)
undefined_behavior
}
}
2 => {
@0 := const (0 : u32)
}
}
return
Expand Down Expand Up @@ -106,16 +90,8 @@ fn test_crate::test3(@1: test_crate::E2) -> u32
y@3 := copy (n@4)
drop n@4
},
_ => {
match x@1 {
2 => {
y@3 := const (0 : u32)
},
_ => {
@fake_read(x@1)
undefined_behavior
}
}
2 => {
y@3 := const (0 : u32)
}
}
@fake_read(y@3)
Expand Down
Loading

0 comments on commit 27d851d

Please sign in to comment.