Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to OCaml 5 #694

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Note:

1. Make sure to have the following installed on your system:

- [`opam`](https://opam.ocaml.org/) (`opam switch create 4.14.1`)
- [`opam`](https://opam.ocaml.org/) (`opam switch create 5.1.1`)
- [`rustup`](https://rustup.rs/)
- [`nodejs`](https://nodejs.org/)
- [`jq`](https://jqlang.github.io/jq/)
Expand Down
4 changes: 2 additions & 2 deletions engine/backends/fstar/fstar-surface-ast/FStar_String.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ let get s i = BatUChar.code (BatUTF8.get s (Z.to_int i))
let collect f s =
let r = ref "" in
BatUTF8.iter (fun c -> r := !r ^ f (BatUChar.code c)) s; !r
let lowercase = BatString.lowercase
let uppercase = BatString.uppercase
let lowercase = BatString.lowercase_ascii
let uppercase = BatString.uppercase_ascii
let escaped = BatString.escaped
let index = get
exception Found of int
Expand Down
87 changes: 21 additions & 66 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
crane = {
url = "github:ipetkov/crane";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
rust-overlay = {
Expand Down
12 changes: 9 additions & 3 deletions frontend/exporter/src/types/copied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,11 +1205,17 @@ impl<'tcx, S: ExprState<'tcx>> SInto<S, Expr> for rustc_middle::thir::Expr<'tcx>
Some(contents) => contents,
None => match kind {
// Introduce intermediate `Cast` from `T` to `U` when casting from a `#[repr(T)]` enum to `U`
rustc_middle::thir::ExprKind::Cast { source } if let rustc_middle::ty::TyKind::Adt(def, _) = s.thir().exprs[source].ty.kind() => {
rustc_middle::thir::ExprKind::Cast { source }
if let rustc_middle::ty::TyKind::Adt(def, _) =
s.thir().exprs[source].ty.kind() =>
{
let tcx = s.base().tcx;
let contents = kind.sinto(s);
use crate::rustc_middle::ty::util::IntTypeExt;
let repr_type = tcx.repr_options_of_def(def.did()).discr_type().to_ty(s.base().tcx);
let repr_type = tcx
.repr_options_of_def(def.did())
.discr_type()
.to_ty(s.base().tcx);
if repr_type == ty {
contents
} else {
Expand All @@ -1220,7 +1226,7 @@ impl<'tcx, S: ExprState<'tcx>> SInto<S, Expr> for rustc_middle::thir::Expr<'tcx>
contents: Box::new(contents),
hir_id,
attributes: vec![],
}
},
}
}
}
Expand Down
Loading