Skip to content
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
13 changes: 11 additions & 2 deletions .github/workflows/rust-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ permissions:
contents: read

jobs:
make:
rust-warnings:
env:
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}

Expand All @@ -46,6 +46,15 @@ jobs:
run: |
set -eu
cargo check --quiet --all-features --message-format=json \
| jq -r 'select(.message.level == "warning" or .message.level == "error") | .message.rendered' \
| jq -r 'select(.message.level | IN("warning", "error")) | .message.rendered' \
| tee messages.txt
(exit "${PIPESTATUS[0]}") && ! grep --quiet '[^[:space:]]' messages.txt

- name: "📜 `rustdoc` warnings"
shell: bash
run: |
set -eu
cargo doc --document-private-items --all --no-deps --message-format=json \
| jq -r 'select(.message.level | IN("warning", "error")) | .message.rendered' \
| tee messages.txt
(exit "${PIPESTATUS[0]}") && ! grep --quiet '[^[:space:]]' messages.txt
4 changes: 2 additions & 2 deletions ext/erb/escape/escape.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ optimized_escape_html(VALUE str)
const unsigned char c = *cstr++;
uint8_t len = html_escape_table[c].len;
if (len) {
uint16_t segment_len = cstr - segment_start - 1;
size_t segment_len = cstr - segment_start - 1;
if (!buf) {
buf = ALLOCV_N(char, vbuf, escaped_length(str));
dest = buf;
Expand All @@ -64,7 +64,7 @@ optimized_escape_html(VALUE str)
}
}
if (buf) {
uint16_t segment_len = cstr - segment_start;
size_t segment_len = cstr - segment_start;
if (segment_len) {
memcpy(dest, segment_start, segment_len);
dest += segment_len;
Expand Down
3 changes: 3 additions & 0 deletions test/erb/test_erb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def test_html_escape

assert_equal("", ERB::Util.html_escape(nil))
assert_equal("123", ERB::Util.html_escape(123))

assert_equal(65536+5, ERB::Util.html_escape("x"*65536 + "&").size)
assert_equal(65536+5, ERB::Util.html_escape("&" + "x"*65536).size)
end

def test_html_escape_to_s
Expand Down
1 change: 1 addition & 0 deletions yjit/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,7 @@ pub extern "C" fn rb_yjit_record_exit_stack(exit_pc: *const VALUE)
// rb_vm_insn_addr2opcode won't work in cargo test --all-features
// because it's a C function. Without insn call, this function is useless
// so wrap the whole thing in a not test check.
let _ = exit_pc;
#[cfg(not(test))]
{
// Get the opcode from the encoded insn handler at this PC
Expand Down
2 changes: 1 addition & 1 deletion yjit/src/virtualmem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct VirtualMemory<A: Allocator> {
/// Mutable parts of [`VirtualMemory`].
pub struct VirtualMemoryMut<A: Allocator> {
/// Number of bytes that have we have allocated physical memory for starting at
/// [Self::region_start].
/// [VirtualMemory::region_start].
mapped_region_bytes: usize,

/// Keep track of the address of the last written to page.
Expand Down
2 changes: 1 addition & 1 deletion zjit/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ fn gen_new_array(
new_array
}

/// Compile array access (array[index])
/// Compile array access (`array[index]`)
fn gen_aref_fixnum(
asm: &mut Assembler,
array: Opnd,
Expand Down
2 changes: 1 addition & 1 deletion zjit/src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fn ranges_overlap<T>(left: &Range<T>, right: &Range<T>) -> bool where T: Partial
left.start < right.end && right.start < left.end
}

/// Callback for marking GC objects inside [Invariants].
/// Callback for marking GC objects inside [crate::invariants::Invariants].
#[unsafe(no_mangle)]
pub extern "C" fn rb_zjit_root_mark() {
gc_mark_raw_samples();
Expand Down