- A closure or async block bound to `_` inside parentheses
(`let _ = (|| { … });`) is dropped unrun; `(|| { … })()` still runs.
- A length check after an `.all(…)` assertion guards it only when no code
between them changes the local's item count (`xs.push(1)` included).
- A strict bound (`xs.len() > 1`, `1 < xs.len()`) gives one item more
than its count, so `.windows(2)` after `> 1` is guarded.
- An index into the outer collection no longer guards `.all(…)` over an
item read through `.iter_mut()`, `.windows(…)`, `.chunks(…)` or
`.chunks_exact(…)`.
- A grouped argument (`std::mem::take((xs))`) is found as a call that can
change a `&mut` local; `(xs).len()` stays a read.
- A nested `fn` with a non-ASCII name is skipped by the polling scan.
- A non-ASCII container local is followed to its initializer when deciding
whether a conversion can test a user value.
- A `cfg` attribute covers a function whose return type holds `;`
(`-> Result<(), [u8; 2]>`), so `never-run` reports it.
- The test repository directory comes from `tempfile`, created for the
test alone.
* Docs: add a script for editable numbered grids
* Docs: bound the numbered-grid example and validate label numbers
---------
Co-authored-by: FredApps <[email protected]>
The check did not read lint attributes inside cfg_attr at all, and it
does not evaluate cfg conditions. Two roots passed although the
condition all() is always true:
- #![cfg_attr(all(), forbid(unsafe_code))] with doc-test deny: the
library forbids unsafe code, so its doc tests need forbid.
- #![doc(test(attr(deny(unsafe_code), cfg_attr(all(), allow(unsafe_code)))))]:
the allow lowers the deny.
A cfg_attr now counts only in the direction that is never too lenient:
a forbid inside one asks the doc tests for forbid, and an allow, warn
or expect inside one lowers the doc tests' level. A deny or forbid
inside cfg_attr in the doc-test list still does not count.
The comment and literal scanner also skips raw C strings (cr"..."), so
text such as #![forbid(unsafe_code)] inside one is not read as an
attribute. Tests cover each case.
dock::tests::idle_frames_replay_the_color_panel failed now and then with
"idle frames replay the Color panel" (left: 1, right: 0). The app starts
the scan of the installed fonts on a background thread, and frames do
not wait for it. When the scan ends, the fonts' generation changes, and
a panel body's inputs hold that generation through layout_inputs. On a
loaded machine the scan can end after the helper's two settle frames,
so the first idle frame runs the body once.
The panel() helper now calls FontDb::global().family_list() after
making the app, which waits for that scan (or runs it), as the font
menu, properties and native menu tests already do. Every test in the
module goes through panel(), so all of them get the fix.
The check accepted a library root when deny(unsafe_code) or
forbid(unsafe_code) appeared anywhere inside #![doc(test(...))]. Two
roots passed although their doc tests still allow unsafe code:
- #![doc(test(attr(cfg_attr(any(), forbid(unsafe_code)))))]: the lint
sits inside a cfg_attr whose condition is false, so rustdoc adds no
lint to the doc tests.
- #![doc(test(attr(deny(unsafe_code), allow(unsafe_code))))]: rustdoc
adds both attributes in order, and the later allow overrides the deny.
The check now reads only the lint attributes that are direct members of
attr(...), in order, and keeps the last level for unsafe_code. A later
allow, warn or expect lowers deny, and nothing lowers forbid. Tests
cover each case.
With Auto-Collapse Iconic Panels on, the Gradient panel's stop chip in an
icon column's flyout opened the stop popover, and the flyout closed in the
same frames. The popover is a layer of the window's dialog host, outside the
flyout's layers, so the focus moving into it and presses in it counted as
leaving the flyout.
The dock now notes the dialogs that open while a flyout is open. While one
of them is still open, the flyout is shown without auto-collapse; once they
close, a click away from the flyout closes it again.
review_596866_owned_up_then_new_down_in_one_frame_keeps_the_next_click_single
checked the release and press edges in the step's last frame. The press's
Down comes in a second pass of the same frame only when another part of the
UI asks for a rerun; otherwise it comes in the next frame, whose first pass
has no events. Keying the Image Trace sliders on the selection moves the
status bar's rerun to an earlier step, so the Down came in a second frame
and the precondition failed while every behavior assertion still held.
The edges are now read with frame_event, which looks at the first pass of
each frame in the step.
The check read every #![...] attribute in a library root, including
ones inside a module's braces. A root with
mod tests { #![doc(test(attr(deny(unsafe_code))))] } and no crate-level
attribute passed, although an attribute inside a module does not apply
to the crate's other doc tests. A #![forbid(unsafe_code)] inside a
module was also read as the library forbidding unsafe code.
Attributes inside braces are now skipped, with a test for each case.
inert() passed the whole operand before a call to without_turbofish, so an
assertion with many Box::new elements copied every earlier element again at
each call. It now tracks where the current path starts and normalizes only
that path. A test covers a builder path that follows other elements.
CI's test-lint step failed with only-weak at xtask/src/doc_tests.rs:250:
every assertion in comments_other_lints_and_allow_do_not_count checked
only that problem() returned Some. Such a test still passes when the
check reports the wrong problem, for example when a commented-out
#![forbid(unsafe_code)] is counted and the forbid message is returned
instead of the deny message.
The tests now compare problem() with the exact message for each case,
and two cases cover a commented-out forbid on either side. The other
tests in the file that checked only is_some, is_none or a substring
compare the full result too.
The canvas tests that look for a mark at a point read circles,
rectangles and lines from the frame. The selection's anchor marks now
paint as one mesh, so painted_points has AnchorMarks paint the shapes
the mesh is made of for its frame.
A double click on a stop's marker in the Gradient panel's slider opens
the stop popover on its second press. The slider also treated that press
as a drag once the pointer moved past the drag threshold before the
release, which a hand on a trackpad often does. The stop moved a few
percent, an undo step was recorded, and the popover closed in the next
frame because its stop had changed under it.
The panel now drops the slider's edits from the press that opened the
popover, including the commit that arrives after the button is up. The
next press drags the stop as before. craft-libs#5131 fixes the slider
itself; this code goes away with the pin bump that brings it in.
- A quoted NAME=value counts as a workflow variable only in a command
that reads it as an assignment (export, env, declare, local, readonly,
typeset) or in a pipeline that writes to $GITHUB_ENV, so a grep pattern
sets nothing.
- The command around a printed assignment is found with quotes taken
into account, so a ; or | inside a printf format does not hide the
printf, and only that command's own pipeline or group can write it to
$GITHUB_ENV.
- A # starts a shell comment only at the start of a word, and a YAML
comment only at the start of the line or after whitespace, so
note=one#two keeps the rest of the line.
- let _ = async || ... is dropped unrun like a plain closure.
- A size check through the local's iterator (xs.iter().count()) is a
direct guard, so a later xs.clear() invalidates it.
- A direct length guard covers windows(k), chunks_exact(k) and the full
chunks of as_chunks::<k>() only when the compared count is at least k.
- A grouped && or || operand of an exit-status assertion is classified
operand by operand.
- A nested fn with an array return type (-> [u8; 1]) is found, both for
polling loops and for unrun functions in a test.
- A method on an element indexed out of a local (xs[0].len()) is
classified by the element, so a user type's method is not a fixture
read.
The bar showed only the neutral border of its floating surface. It now
draws an outline in the accent border color over that border, on the
same pixel-rounded rect, with the floating surface's corners and the
bar's opacity.
This is a temporary workaround until craft-libs#4892, which adds
TaskBar::edge(BarEdge::Accent), is in the craft-libs pin. The pin bump
deletes accent_outline and sets that edge on the bar instead.
When Space (or Cmd+Space, Alt+Space) was let go while the canvas did not
run, for example with a dialog or another tab in front, the shortcut
board dropped the queued release and the momentary Hand or Zoom stayed
in effect. Every tool chosen afterwards then acted as the Hand until
Space was pressed and released again (#10709).
The canvas now notes the keys that were down when a momentary hold
started, and at its next pass ends the hold once none of them is down.
A hold started with no key down, as automation does, lasts until its
release.
This is a temporary workaround for storytold/craft-libs#5056, which
ends the hold inside the tool host. The helpers and the
momentary_keys field go once the craft-libs pin includes it; the
tests stay.