Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
30fc9bd
elf-raw-dylib: set type for functions
mati865 Feb 25, 2026
7371a7f
tests/ui/asm: add annotations for reference rules
DanielEScherzer Feb 20, 2026
6358dcc
test: add regression test for fuzzy_provenance_casts lint ICE
yuyahy Feb 28, 2026
bc4cead
stabilize new RangeToInclusive type
pitaj Feb 7, 2026
fa66fef
core: make atomic primitives type aliases of `Atomic<T>`
joboet Feb 23, 2026
4b86b1a
compiler: manually implement `DynSend` for atomic primitives
joboet Feb 23, 2026
95e571d
update references to `Atomic` in diagnostics
joboet Feb 25, 2026
4d09563
bless UI tests referencing atomic primitives
joboet Feb 23, 2026
57234d3
update debuginfo visualizers and tests
joboet Feb 24, 2026
dc548c9
reference more reliable items in rustdoc tests
joboet Feb 25, 2026
72a001b
Remove `DepKindVTable::is_anon`.
nnethercote Feb 26, 2026
cc1b878
Inline and remove `handle_cycle_error`.
nnethercote Feb 26, 2026
c0770ba
Make `from_cycle_error` consume the `CycleError`.
nnethercote Feb 26, 2026
7a4daa4
Avoid an early return in `try_execute_query`.
nnethercote Feb 26, 2026
fc395ed
Merge two assertion blocks in `execute_job_non_incr`.
nnethercote Feb 26, 2026
8129da8
Remove three single-use type synonyms.
nnethercote Feb 26, 2026
2aaced6
Replace two `abort_if_errors` calls.
nnethercote Feb 27, 2026
6f111d2
Remove a duplicated comment.
nnethercote Feb 27, 2026
5677f7c
Rename trait `Value` as `FromCycleError`.
nnethercote Feb 27, 2026
5bd28b8
Remove `FromCycleError` impl for `SymbolName`.
nnethercote Feb 27, 2026
37e407d
Rollup merge of #153015 - joboet:atomic_alias_generic, r=jhpratt
jhpratt Mar 2, 2026
3695d75
Rollup merge of #153169 - nnethercote:rm-is_anon-etc, r=petrochenkov
jhpratt Mar 2, 2026
e353aa0
Rollup merge of #152304 - pitaj:stabilize-new_range_api, r=tgross35
jhpratt Mar 2, 2026
f421377
Rollup merge of #153090 - mati865:elf-raw-dylib-fns, r=TaKO8Ki
jhpratt Mar 2, 2026
37e4906
Rollup merge of #153225 - DanielEScherzer:test-references-asm, r=ehuss
jhpratt Mar 2, 2026
bc8b480
Rollup merge of #153233 - yuyahy:ice-issue-137588-regression-test, r=…
jhpratt Mar 2, 2026
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
Prev Previous commit
Next Next commit
test: add regression test for fuzzy_provenance_casts lint ICE
  • Loading branch information
yuyahy committed Feb 28, 2026
commit 6358dcc2957f58be4ecdd0c1c0f2c0a1d20b7697
24 changes: 24 additions & 0 deletions tests/ui/lint/ice-fuzzy-provenance-casts-with-inner-attr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Regression test for #137588.
// The compiler used to ICE when emitting a `fuzzy_provenance_casts` lint
// diagnostic for code with an inner attribute spanning the entire file,
// causing `draw_code_line` to panic on an empty `file_lines` from a dummy span.

//@ edition:2024
//@ compile-flags: -Wfuzzy-provenance-casts

#![feature(strict_provenance_lints)]
//~^ ERROR too many leading `super` keywords [E0433]
//~| ERROR cannot find type `Ts` in this scope [E0425]
//~| ERROR `#[prelude_import]` is for use by rustc only [E0658]
//~| WARN strict provenance disallows casting integer `usize` to pointer `*const u32`
#![core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
//~^ ERROR use of unstable library feature `contracts` [E0658]
//~| ERROR inner macro attributes are unstable [E0658]
//~| ERROR cannot find type `Stars` in this scope [E0433]

pub(super) fn foo() -> *const Ts {
unsafe {
let p2 = 0x52 as *const u32;
}
}
//~^ ERROR `main` function not found in crate
93 changes: 93 additions & 0 deletions tests/ui/lint/ice-fuzzy-provenance-casts-with-inner-attr.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
error[E0658]: use of unstable library feature `contracts`
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:14:4
|
LL | #![core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #128044 <https://github.com/rust-lang/rust/issues/128044> for more information
= help: add `#![feature(contracts)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: inner macro attributes are unstable
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:14:4
|
LL | #![core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
= help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0433]: too many leading `super` keywords
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:9:1
|
LL | / #![feature(strict_provenance_lints)]
... |
LL | | }
| |_^ there are too many leading `super` keywords

error[E0425]: cannot find type `Ts` in this scope
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:9:1
|
LL | / #![feature(strict_provenance_lints)]
... |
LL | | }
| |_^ not found in this scope

error[E0658]: `#[prelude_import]` is for use by rustc only
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:9:1
|
LL | / #![feature(strict_provenance_lints)]
... |
LL | | }
| |_^
|
= help: add `#![feature(prelude_import)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `ice_fuzzy_provenance_casts_with_inner_attr`
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:23:2
|
LL | }
| ^ consider adding a `main` function to `$DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs`

error[E0433]: cannot find type `Stars` in this scope
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:14:50
|
LL | #![core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
| ^^^^^ use of undeclared type `Stars`

warning: strict provenance disallows casting integer `usize` to pointer `*const u32`
--> $DIR/ice-fuzzy-provenance-casts-with-inner-attr.rs:9:1
|
LL | / #![feature(strict_provenance_lints)]
... |
LL | | }
| |_^
|
= help: if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::with_exposed_provenance()` instead
= note: requested on the command line with `-W fuzzy-provenance-casts`
help: use `.with_addr()` to adjust a valid pointer in the same allocation, to this address
|
LL - #![feature(strict_provenance_lints)]
LL -
LL -
LL -
LL -
LL - #![core::contracts::ensures(|ret| ret.is_none_or(Stars::is_valid))]
LL -
LL -
LL -
LL -
LL - pub(super) fn foo() -> *const Ts {
LL - unsafe {
LL - let p2 = 0x52 as *const u32;
LL - }
LL - }
LL + (...).with_addr()
|

error: aborting due to 7 previous errors; 1 warning emitted

Some errors have detailed explanations: E0425, E0433, E0601, E0658.
For more information about an error, try `rustc --explain E0425`.
Loading