diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6322e402f..399fd0ab8 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 65803a1dd..c2b23df06 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 b29275622..45a83d556 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 caef7eb4b..b6b496cb3 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 ac8c813df..26ec879cc 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 { } /// Parse a bare `pub static CATEGORY: Category;` item. +#[allow(dead_code)] pub struct BareStatic { pub attrs: Vec, pub vis: Visibility, diff --git a/crates/typst-macros/src/lib.rs b/crates/typst-macros/src/lib.rs index 35c48b4a3..58d963863 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 bfe222855..b6acc7d81 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, pub type_token: Token![type], diff --git a/crates/typst-pdf/Cargo.toml b/crates/typst-pdf/Cargo.toml index 709ed1088..99c52dc6a 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 49ec0d860..e8b1c30a1 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 2db9b5eda..cc58f785f 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 143e88ed7..df49a2b17 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 f92b6d9b9..001d405c4 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 fd82c2ccd..cfc4e32e4 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 c6cd6acb4..6e119591a 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 3b74f1fb1..b29e44732 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!( - /// ::error(&Value::None), + /// ::error(&Value::None), /// "expected integer, found none", /// ); /// ``` diff --git a/crates/typst/src/foundations/selector.rs b/crates/typst/src/foundations/selector.rs index 4dc8ab3b9..90663500e 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 dd09b6056..35460088c 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 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 c976da2d7..7ea021d79 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 15ce3d554..a85d1cdf5 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>, diff --git a/docs/Cargo.toml b/docs/Cargo.toml index b2bfcd431..dbae0b777 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 7276776d0..000000000 --- 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)