Skip to content

Commit

Permalink
Set example to no_run since it has UB
Browse files Browse the repository at this point in the history
We can't guarantee the behavior when running this example, so it is not safe to run during tests.
  • Loading branch information
ehuss authored May 19, 2023
1 parent b918344 commit 87f5694
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/unbounded-lifetimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ boundaries.
Given a function, any output lifetimes that don't derive from inputs are
unbounded. For instance:

```rust
<!-- no_run: This example exhibits undefined behavior. -->
```rust,no_run
fn get_str<'a>(s: *const String) -> &'a str {
unsafe { &*s }
}
Expand Down

0 comments on commit 87f5694

Please sign in to comment.