Commit 46a2259
committed
Skip analysis of extern_spec target only when trusted or ignored
Stopping the extern_spec_fn target from re-registering its own key (by
removing it from the refine set) also dropped its `refine_fn_def`, which
is where a trusted/ignored target is added to `skip_analysis`. Inserting
every local target into `skip_analysis` instead sent the extern spec down
the NoAnalyze branch of `refine_fn_def` for all targets, so a non-trusted
target's body was never checked against the spec: a `#[context]` trait
method's `ensures` (e.g. tests/ui/fail/trait_assoc_type_spec.rs) became a
trusted assumption and the program verified even though the body cannot
establish it.
Only insert the target into `skip_analysis` when it is itself trusted or
ignored (e.g. a `#[thrust::trusted]` `rand` whose `unimplemented!()` body
must not be analyzed). Non-trusted targets stay out of `skip_analysis`, so
the extern spec is registered in Analyze mode and their bodies are checked
against the spec.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VowL2RdawM4Xch4tsdbSf31 parent dda3a76 commit 46a2259
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
74 | 93 | | |
75 | 94 | | |
76 | 95 | | |
| |||
0 commit comments