summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-02 16:16:44 +0200
committerGitHub <noreply@github.com>2024-04-02 14:16:44 +0000
commitb3615ccd493c4791c3c7565fc7417cba50e8fd71 (patch)
tree264c711ead8cf76439816b1457429a157e614067
parentc4001662b686b0d52e99aa0b72a5b82af6f862fd (diff)
A few CI and crate config changes (#3852)
-rw-r--r--.github/workflows/ci.yml1
-rw-r--r--crates/typst-cli/Cargo.toml3
-rw-r--r--crates/typst-ide/Cargo.toml5
-rw-r--r--crates/typst-macros/Cargo.toml3
-rw-r--r--crates/typst-macros/src/category.rs1
-rw-r--r--crates/typst-macros/src/lib.rs2
-rw-r--r--crates/typst-macros/src/util.rs1
-rw-r--r--crates/typst-pdf/Cargo.toml4
-rw-r--r--crates/typst-pdf/src/lib.rs1
-rw-r--r--crates/typst-render/Cargo.toml4
-rw-r--r--crates/typst-svg/Cargo.toml4
-rw-r--r--crates/typst-syntax/Cargo.toml4
-rw-r--r--crates/typst/Cargo.toml4
-rw-r--r--crates/typst/src/diag.rs4
-rw-r--r--crates/typst/src/foundations/cast.rs4
-rw-r--r--crates/typst/src/foundations/selector.rs4
-rw-r--r--crates/typst/src/foundations/styles.rs7
-rw-r--r--crates/typst/src/layout/grid/lines.rs2
-rw-r--r--crates/typst/src/model/outline.rs1
-rw-r--r--docs/Cargo.toml5
-rw-r--r--tests/typ/compiler/bench.typ47
21 files changed, 10 insertions, 101 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6322e402..399fd0ab 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,6 +31,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.77.0
- uses: Swatinem/rust-cache@v2
+ - run: cargo test --workspace --no-run
- run: cargo test --workspace --no-fail-fast
checks:
diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml
index 65803a1d..c2b23df0 100644
--- a/crates/typst-cli/Cargo.toml
+++ b/crates/typst-cli/Cargo.toml
@@ -15,9 +15,6 @@ readme = { workspace = true }
[[bin]]
name = "typst"
path = "src/main.rs"
-test = false
-doctest = false
-bench = false
doc = false
[dependencies]
diff --git a/crates/typst-ide/Cargo.toml b/crates/typst-ide/Cargo.toml
index b2927562..45a83d55 100644
--- a/crates/typst-ide/Cargo.toml
+++ b/crates/typst-ide/Cargo.toml
@@ -12,11 +12,6 @@ categories = { workspace = true }
keywords = { workspace = true }
readme = { workspace = true }
-[lib]
-test = false
-doctest = false
-bench = false
-
[dependencies]
typst = { workspace = true }
comemo = { workspace = true }
diff --git a/crates/typst-macros/Cargo.toml b/crates/typst-macros/Cargo.toml
index caef7eb4..b6b496cb 100644
--- a/crates/typst-macros/Cargo.toml
+++ b/crates/typst-macros/Cargo.toml
@@ -14,9 +14,6 @@ readme = { workspace = true }
[lib]
proc-macro = true
-test = false
-doctest = false
-bench = false
[dependencies]
heck = { workspace = true }
diff --git a/crates/typst-macros/src/category.rs b/crates/typst-macros/src/category.rs
index ac8c813d..26ec879c 100644
--- a/crates/typst-macros/src/category.rs
+++ b/crates/typst-macros/src/category.rs
@@ -33,6 +33,7 @@ pub fn category(_: TokenStream, item: syn::Item) -> Result<TokenStream> {
}
/// Parse a bare `pub static CATEGORY: Category;` item.
+#[allow(dead_code)]
pub struct BareStatic {
pub attrs: Vec<Attribute>,
pub vis: Visibility,
diff --git a/crates/typst-macros/src/lib.rs b/crates/typst-macros/src/lib.rs
index 35c48b4a..58d96386 100644
--- a/crates/typst-macros/src/lib.rs
+++ b/crates/typst-macros/src/lib.rs
@@ -136,7 +136,7 @@ pub fn ty(stream: BoundaryStream, item: BoundaryStream) -> BoundaryStream {
///
/// This implements `NativeElement` for the given type.
///
-/// ```
+/// ```ignore
/// /// A section heading.
/// #[elem(Show, Count)]
/// struct HeadingElem {
diff --git a/crates/typst-macros/src/util.rs b/crates/typst-macros/src/util.rs
index bfe22285..b6acc7d8 100644
--- a/crates/typst-macros/src/util.rs
+++ b/crates/typst-macros/src/util.rs
@@ -232,6 +232,7 @@ impl Parse for BlockWithReturn {
}
/// Parse a bare `type Name;` item.
+#[allow(dead_code)]
pub struct BareType {
pub attrs: Vec<Attribute>,
pub type_token: Token![type],
diff --git a/crates/typst-pdf/Cargo.toml b/crates/typst-pdf/Cargo.toml
index 709ed108..99c52dc6 100644
--- a/crates/typst-pdf/Cargo.toml
+++ b/crates/typst-pdf/Cargo.toml
@@ -12,10 +12,6 @@ categories = { workspace = true }
keywords = { workspace = true }
readme = { workspace = true }
-[lib]
-doctest = false
-bench = false
-
[dependencies]
typst = { workspace = true }
typst-assets = { workspace = true }
diff --git a/crates/typst-pdf/src/lib.rs b/crates/typst-pdf/src/lib.rs
index 49ec0d86..e8b1c30a 100644
--- a/crates/typst-pdf/src/lib.rs
+++ b/crates/typst-pdf/src/lib.rs
@@ -9,7 +9,6 @@ mod outline;
mod page;
mod pattern;
-use std::cmp::Eq;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::hash::Hash;
use std::sync::Arc;
diff --git a/crates/typst-render/Cargo.toml b/crates/typst-render/Cargo.toml
index 2db9b5ed..cc58f785 100644
--- a/crates/typst-render/Cargo.toml
+++ b/crates/typst-render/Cargo.toml
@@ -12,10 +12,6 @@ categories = { workspace = true }
keywords = { workspace = true }
readme = { workspace = true }
-[lib]
-doctest = false
-bench = false
-
[dependencies]
typst = { workspace = true }
typst-macros = { workspace = true }
diff --git a/crates/typst-svg/Cargo.toml b/crates/typst-svg/Cargo.toml
index 143e88ed..df49a2b1 100644
--- a/crates/typst-svg/Cargo.toml
+++ b/crates/typst-svg/Cargo.toml
@@ -12,10 +12,6 @@ categories = { workspace = true }
keywords = { workspace = true }
readme = { workspace = true }
-[lib]
-doctest = false
-bench = false
-
[dependencies]
typst = { workspace = true }
typst-macros = { workspace = true }
diff --git a/crates/typst-syntax/Cargo.toml b/crates/typst-syntax/Cargo.toml
index f92b6d9b..001d405c 100644
--- a/crates/typst-syntax/Cargo.toml
+++ b/crates/typst-syntax/Cargo.toml
@@ -12,10 +12,6 @@ categories = { workspace = true }
keywords = { workspace = true }
readme = { workspace = true }
-[lib]
-doctest = false
-bench = false
-
[dependencies]
comemo = { workspace = true }
ecow = { workspace = true }
diff --git a/crates/typst/Cargo.toml b/crates/typst/Cargo.toml
index fd82c2cc..cfc4e32e 100644
--- a/crates/typst/Cargo.toml
+++ b/crates/typst/Cargo.toml
@@ -12,10 +12,6 @@ repository = { workspace = true }
license = { workspace = true }
readme = { workspace = true }
-[lib]
-doctest = false
-bench = false
-
[dependencies]
typst-assets = { workspace = true }
typst-macros = { workspace = true }
diff --git a/crates/typst/src/diag.rs b/crates/typst/src/diag.rs
index c6cd6acb..6e119591 100644
--- a/crates/typst/src/diag.rs
+++ b/crates/typst/src/diag.rs
@@ -21,7 +21,7 @@ use crate::{World, WorldExt};
///
/// You can also emit hints with the `; hint: "..."` syntax.
///
-/// ```
+/// ```ignore
/// bail!("bailing with a {}", "string result");
/// bail!(span, "bailing with a {}", "source result");
/// bail!(
@@ -81,7 +81,7 @@ macro_rules! __error {
///
/// You can also emit hints with the `; hint: "..."` syntax.
///
-/// ```
+/// ```ignore
/// warning!(span, "warning with a {}", "source result");
/// warning!(
/// span, "warning with a {}", "source result";
diff --git a/crates/typst/src/foundations/cast.rs b/crates/typst/src/foundations/cast.rs
index 3b74f1fb..b29e4473 100644
--- a/crates/typst/src/foundations/cast.rs
+++ b/crates/typst/src/foundations/cast.rs
@@ -44,9 +44,9 @@ pub trait Reflect {
/// Produce an error message for an inacceptable value type.
///
- /// ```
+ /// ```ignore
/// assert_eq!(
- /// <Int as Reflect>::error(&Value::None),
+ /// <i64 as Reflect>::error(&Value::None),
/// "expected integer, found none",
/// );
/// ```
diff --git a/crates/typst/src/foundations/selector.rs b/crates/typst/src/foundations/selector.rs
index 4dc8ab3b..90663500 100644
--- a/crates/typst/src/foundations/selector.rs
+++ b/crates/typst/src/foundations/selector.rs
@@ -15,10 +15,6 @@ use crate::symbols::Symbol;
use crate::text::TextElem;
/// A helper macro to create a field selector used in [`Selector::Elem`]
-///
-/// ```ignore
-/// select_where!(SequenceElem, Children => vec![]);
-/// ```
#[macro_export]
#[doc(hidden)]
macro_rules! __select_where {
diff --git a/crates/typst/src/foundations/styles.rs b/crates/typst/src/foundations/styles.rs
index dd09b605..35460088 100644
--- a/crates/typst/src/foundations/styles.rs
+++ b/crates/typst/src/foundations/styles.rs
@@ -321,9 +321,6 @@ trait Blockable: Debug + Send + Sync + 'static {
/// Equivalent to `downcast_ref` for the block.
fn as_any(&self) -> &dyn Any;
- /// Equivalent to `downcast_mut` for the block.
- fn as_any_mut(&mut self) -> &mut dyn Any;
-
/// Equivalent to [`Hash`] for the block.
fn dyn_hash(&self, state: &mut dyn Hasher);
@@ -336,10 +333,6 @@ impl<T: Debug + Clone + Hash + Send + Sync + 'static> Blockable for T {
self
}
- fn as_any_mut(&mut self) -> &mut dyn Any {
- self
- }
-
fn dyn_hash(&self, mut state: &mut dyn Hasher) {
// Also hash the TypeId since values with different types but
// equal data should be different.
diff --git a/crates/typst/src/layout/grid/lines.rs b/crates/typst/src/layout/grid/lines.rs
index c976da2d..7ea021d7 100644
--- a/crates/typst/src/layout/grid/lines.rs
+++ b/crates/typst/src/layout/grid/lines.rs
@@ -597,7 +597,7 @@ pub(super) fn hline_stroke_at_column(
#[cfg(test)]
mod test {
- use super::super::layout::{Entry, RowPiece};
+ use super::super::layout::Entry;
use super::*;
use crate::foundations::Content;
use crate::layout::{Axes, Cell, Sides, Sizing};
diff --git a/crates/typst/src/model/outline.rs b/crates/typst/src/model/outline.rs
index 15ce3d55..a85d1cdf 100644
--- a/crates/typst/src/model/outline.rs
+++ b/crates/typst/src/model/outline.rs
@@ -73,7 +73,6 @@ pub struct OutlineElem {
/// The outline's heading will not be numbered by default, but you can
/// force it to be with a show-set rule:
/// `{show outline: set heading(numbering: "1.")}`
- /// ```
#[default(Some(Smart::Auto))]
pub title: Option<Smart<Content>>,
diff --git a/docs/Cargo.toml b/docs/Cargo.toml
index b2bfcd43..dbae0b77 100644
--- a/docs/Cargo.toml
+++ b/docs/Cargo.toml
@@ -6,13 +6,10 @@ authors = { workspace = true }
edition = { workspace = true }
publish = false
-[lib]
-doctest = false
-bench = false
-
[[bin]]
name = "typst-docs"
required-features = ["cli"]
+doc = false
[features]
default = ["cli"]
diff --git a/tests/typ/compiler/bench.typ b/tests/typ/compiler/bench.typ
deleted file mode 100644
index 7276776d..00000000
--- a/tests/typ/compiler/bench.typ
+++ /dev/null
@@ -1,47 +0,0 @@
-// Ref: false
-
-// Configuration with `page` and `font` functions.
-#set page(width: 450pt, margin: 1cm)
-
-// There are variables and they can take normal values like strings, ...
-#let city = "Berlin"
-
-// ... but also "content" values. While these contain markup,
-// they are also values and can be summed, stored in arrays etc.
-// There are also more standard control flow structures, like #if and #for.
-#let university = [*Technische Universität #city*]
-#let faculty = [*Fakultät II, Institut for Mathematik*]
-
-// The `box` function just places content into a rectangular container. When
-// the only argument to a function is a content block, the parentheses can be
-// omitted (i.e. `f[a]` is the same as `f([a])`).
-#box[
- // Backslash adds a forced line break.
- #university \
- #faculty \
- Sekretariat MA \
- Dr. Max Mustermann \
- Ola Nordmann, John Doe
-]
-#align(right, box[*WiSe 2019/2020* \ Woche 3])
-
-// Adds vertical spacing.
-#v(6mm)
-
-// If the last argument to a function is a content block, we can also place it
-// behind the parentheses.
-#align(center)[
- // Markdown-like syntax for headings.
- ==== 3. Übungsblatt Computerorientierte Mathematik II #v(4mm)
- *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #v(4mm)
- *Alle Antworten sind zu beweisen.*
-]
-
-*1. Aufgabe* #align(right)[(1 + 1 + 2 Punkte)]
-
-Ein _Binärbaum_ ist ein Wurzelbaum, in dem jeder Knoten ≤ 2 Kinder hat.
-Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel
-zu _v_, und die Höhe von _v_ ist die Länge eines längsten (absteigenden) Weges
-von _v_ zu einem Blatt. Die Höhe des Baumes ist die Höhe der Wurzel.
-
-#v(6mm)