Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 4069e63

Browse files
committed
test: fix doctests, a few small failing tests
1 parent 30fb153 commit 4069e63

File tree

21 files changed

+52
-17
lines changed

21 files changed

+52
-17
lines changed

.github/workflows/x86_64-unknown-linux-gnu-compiler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
wget https://apt.llvm.org/llvm.sh
3333
chmod +x llvm.sh
3434
sudo ./llvm.sh "${LLVM_VERSION}"
35-
apt-get install -y "llvm-${LLVM_VERSION}" "libllvm${LLVM_VERSION}" "llvm-${LLVM_VERSION}-dev" "libmlir-${LLVM_VERSION}-dev"
35+
sudo apt-get install -y "llvm-${LLVM_VERSION}" "libllvm${LLVM_VERSION}" "llvm-${LLVM_VERSION}-dev" "libmlir-${LLVM_VERSION}-dev"
3636
if ! "${LLVM_PREFIX}/bin/llvm-config" --prefix; then
3737
echo "$("${LLVM_PREFIX}/bin/llvm-config" --prefix)"
3838
exit 1

compiler/syntax_kernel/src/ir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl fmt::Debug for Expr {
126126
Self::Break(expr) => write!(f, "{:#?}", expr),
127127
Self::Return(expr) => write!(f, "{:#?}", expr),
128128
Self::Values(expr) => write!(f, "{:#?}", expr),
129-
Self::Local(name) => write!(f, "{}", &name.item),
129+
Self::Local(name) => write!(f, "Local({})", &name.item),
130130
Self::Remote(expr) => write!(f, "{:#?}", expr),
131131
}
132132
}

library/rt/src/backtrace/symbolication.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,15 @@ pub const MAX_FILENAME_LEN: usize = 120;
221221
///
222222
/// Each frame looks like:
223223
///
224-
/// ```ignore
224+
/// ```erlang,ignore
225225
/// {module, function, arity, [{file, "path/to/file"}, {line, 1}]}
226226
/// ```
227227
///
228228
/// However, the first frame may optionally contain the arguments, used for certain
229229
/// classes of errors like function_clause errors. In this case, one frame will look
230230
/// like so:
231231
///
232-
/// ```ignore
232+
/// ```erlang,ignore
233233
/// {module, function, [..args], [{file, "path/to/file"}, {line, 1}]}
234234
/// ```
235235
///
@@ -238,7 +238,7 @@ pub const MAX_FILENAME_LEN: usize = 120;
238238
/// To calculate the total heap needed to allocate all of the terms, we define a heap
239239
/// layout something like the following:
240240
///
241-
/// ```ignore
241+
/// ```text,ignore
242242
/// struct Frames {
243243
/// list: [Cons<Frame>; NUM_FRAMES], // the cons cells for each frame, references `data`
244244
/// data: [Frame; NUM_FRAMES], // the data for each frame

library/rt/src/function/apply/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use crate::term::{Atom, OpaqueTerm};
2323

2424
use super::{ErlangResult, FunctionSymbol, ModuleFunctionArity};
2525

26+
#[cfg(all(feature = "std", any(unix, windows)))]
2627
const BIFS: &'static [&'static str] = &[
2728
"erlang:++/2",
2829
"erlang:--/2",

library/rt/src/process/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,8 @@ impl<'a> ProcessLock<'a> {
13411341
let mature_available = self.guard.heap.mature().heap_available();
13421342
if has_mature && mature_size > mature_available {
13431343
log::trace!(target: "gc", "insufficient space on target mature heap (only {} available), full sweep required", mature_available);
1344-
return Err(GcError::FullsweepRequired);
1344+
// Switch to a full collection
1345+
return self.gc_full(needed, roots);
13451346
}
13461347

13471348
let prev_old_top = self.guard.heap.mature().heap_top();

library/rt/src/process/monitor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ pub struct LocalMonitorInfo {
400400
///
401401
/// When a monitor message is sent to a process, it looks like so:
402402
///
403+
/// ```erlang
403404
/// {'DOWN', MonitorRef, Type, From, Payload}
405+
/// ```
404406
///
405407
/// Where `'DOWN'` is the tag for the message. When a custom tag is used, it replaces
406408
/// that default tag with whatever term was given. This is typically used to enable a

library/rt/src/process/stack.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ pub struct StackOverflowError;
114114
///
115115
/// Call frames are laid out as follows, where the address on the left is relative to the frame pointer (fp):
116116
///
117+
/// ```text,ignore
117118
/// N+1 | NONE <- sp
118119
/// N | ARGN
119120
/// . |
120121
/// 2 | ARG0
121122
/// 1 | RETURN_ADDRESS
122123
/// 0 | RETURN_VALUE <- fp
124+
/// ```
123125
///
124126
/// The first call frame in the call stack has a null return address, which is what signals that control
125127
/// has reached the bottom of the call stack, and that the currently executing process should exit normally.

library/rt/src/services/error_logger.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ enum Args<'a, T> {
206206

207207
/// Sends a message of the following format to the `error_logger` process:
208208
///
209+
/// ```erlang
209210
/// {log, Level, Format, Args, #{gl => Gl, pid => Pid, time => Time, error_logger => #{Tag => Level, emulator => true}}}
211+
/// ```
210212
///
211213
/// Where:
212214
///

library/rt/src/services/timers/wheel.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ impl TimerWheel {
289289
///
290290
/// This function returns true if a cycle was completed in the process of advancing the wheel.
291291
#[cfg(test)]
292+
#[allow(unused)]
292293
pub fn skip(&mut self) -> bool {
293294
match self.skippable() {
294295
// If this wheel is empty, we treat it as if we've completed a full cycle
@@ -814,6 +815,7 @@ impl HierarchicalTimerWheel {
814815
///
815816
/// If the wheel is empty, this function will leave the wheel time reset to the beginning of a new cycle.
816817
#[cfg(test)]
818+
#[allow(unused)]
817819
pub fn skip(&mut self) {
818820
if !self.wheels[Self::SOON].skip() {
819821
return;

library/rt/src/term/binary/matching.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::term::{BinaryData, Boxable, Header, LayoutBuilder, OpaqueTerm, Tag, T
1515
/// and produced by binary matching intrinsics, it is equivalent to a multi-value
1616
/// return with 3 values, and is used like so in generated code:
1717
///
18-
/// ```ignore
18+
/// ```text,ignore
1919
/// let (is_err, term_or_err, match_ctx) = bs_match(...);
2020
/// if is_err {
2121
/// let error = cast term_or_err as *mut Exception

0 commit comments

Comments
 (0)