Skip to content

Commit

Permalink
fix change lifetime to origin
Browse files Browse the repository at this point in the history
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
  • Loading branch information
martinvuyk committed Dec 3, 2024
1 parent e9302b9 commit 2ce86b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions stdlib/src/memory/pointer.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ struct Pointer[
"""
self._value = _mlir_value

# FIXME
# FIXME(#3617)
# @always_inline("nodebug")
# fn __init__(
# inout self, *, ref [lifetime, address_space._value.value]to: type
# inout self, *, ref [origin, address_space._value.value]to: type
# ):
# """Create a pointer with the input value.

Expand Down
13 changes: 1 addition & 12 deletions stdlib/src/memory/unsafe_pointer.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,7 @@ struct UnsafePointer[

@always_inline
fn __init__(
inout self, *, ref [lifetime, address_space._value.value]to: type
):
"""Create a pointer with the input value.
Args:
to: The value to construct a pointer to.
"""
self = Self(__mlir_op.`lit.ref.to_pointer`(__get_mvalue_as_litref(to)))

@always_inline
fn __init__(
inout self, *, ref [lifetime, address_space._value.value]to: type
inout self, *, ref [origin, address_space._value.value]to: type
):
"""Create a pointer with the input value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def test_str():


def test_pointer_to():
# FIXME
...
# FIXME(#3617)
# var local = 1
# assert_not_equal(0, int(Pointer(to=local)))
# _ = local
...


def main():
Expand Down

0 comments on commit 2ce86b8

Please sign in to comment.