Skip to content

rt: migrate compile-fail tests to trybuild. - #715

Open
Dirbaio wants to merge 1 commit into
rust-embedded:mainfrom
Dirbaio:trybuild
Open

Dirbaio wants to merge 1 commit into
rust-embedded:mainfrom
Dirbaio:trybuild

Conversation

@Dirbaio

@Dirbaio Dirbaio commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

compiletest-rs is broken in Rust 1.100 because the build dir layout changed. This switches to

This removes 5 ignored tests. They were trying to test that we error if #[exception] and #[entry] fns are not reachable from the crate root because prehistoric Rust wouldn't pass them to the linker. I've checked this was the case up to rust 1.30 and not the case in 1.31+ anymore, presumably fixed in rust-lang/rust#54451 . So, these tests are no longer needed.

LLMs were used in the making of this PR

@Dirbaio

Dirbaio commented Nov 22, 2026 •

Copy link
Copy Markdown
Member Author

Note: trybuild requires rust 1.88 which is higher than our MSRV (1.85). I think that's OK eince it's only supposed to run in CI, pointing it out just in case. Running the trybuild tests on an older rust likely breaks anyway because the error messages change.

TRYBUILD=overwrite cargo test --package cortex-m-rt --test compile_fail --features device
```

and review the result before committing. The expected output is tied to the current stable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we pin the version we test with? So "selected" or "pinned" rather than "current"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSRV is pinned, latest stable is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants