Skip to content

Commit

Permalink
Rm unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
azdavis committed Aug 7, 2023
1 parent ae5120f commit 1b292ba
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
3 changes: 2 additions & 1 deletion crates/sml-hir-lower/src/dec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ fn get_spec_one(st: &mut St<'_>, dec: Option<ast::DecOne>) -> Vec<sml_hir::SpecI
st.err(dec.syntax(), ErrorKind::Disallowed(Disallowed::Dec("`datatype`")));
}
if let Some(with_type) = dec.with_type() {
st.err(with_type.syntax(), ErrorKind::Unsupported("`withtype` in specifications"));
let e = ErrorKind::Disallowed(Disallowed::SuccMl("`withtype` in specifications"));
st.err(with_type.syntax(), e);
}
let binds = dat_binds(st, dec.dat_binds());
binds.into_iter().map(|x| st.spec(sml_hir::Spec::Datatype(x), ptr.clone())).collect()
Expand Down
4 changes: 0 additions & 4 deletions crates/sml-hir-lower/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ impl Ptrs {

#[derive(Debug)]
pub(crate) enum ErrorKind {
/// must be first here, but have the highest error codes
Unsupported(&'static str),
FunBindMismatchedName(String, String),
FunBindWrongNumPats(usize, usize),
InvalidIntLit(sml_hir::ParseIntError),
Expand Down Expand Up @@ -87,7 +85,6 @@ pub(crate) enum ErrorKind {
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match &self.kind {
ErrorKind::Unsupported(s) => write!(f, "unsupported: {s}"),
ErrorKind::FunBindMismatchedName(want, got) => {
write!(f, "expected a function clause for `{want}`, found one for `{got}`")
}
Expand Down Expand Up @@ -236,7 +233,6 @@ impl Error {
#[must_use]
pub fn code(&self) -> Code {
match self.kind {
ErrorKind::Unsupported(_) => Code::n(4999),
ErrorKind::FunBindMismatchedName(_, _) => Code::n(4001),
ErrorKind::FunBindWrongNumPats(_, _) => Code::n(4002),
ErrorKind::InvalidIntLit(_) | ErrorKind::InvalidWordLit(_) => Code::n(4003),
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/src/deviations/successor_ml/withtype_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ signature STREAM =
sig
datatype 'a u = Nil | Cons of 'a * 'a t
withtype 'a t = unit -> 'a u
(** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported: `withtype` in specifications *)
(** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `withtype` in specifications *)
end
"#,
);
Expand Down
2 changes: 2 additions & 0 deletions docs/diagnostics/4029.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ The language construct may have been explicitly disallowed in `millet.toml`, or
Either allow the thing in `millet.toml`, or remove the occurrence of the thing from the code.

Consult [the manual](/docs/manual.md#language) to see how to edit your `millet.toml` to allow the item.

Some constructs may not be allowable because support for them in Millet is not implemented.
24 changes: 0 additions & 24 deletions docs/diagnostics/4999.md

This file was deleted.

0 comments on commit 1b292ba

Please sign in to comment.