| 123456789101112131415161718192021222324 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
- // EXTRA-ARGS: --dump-sem-ir-ranges=only
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/ref.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/ref.carbon
- // --- fail_todo_ref_return.carbon
- fn F() -> ref i32;
- fn G() {
- // CHECK:STDERR: fail_todo_ref_return.carbon:[[@LINE+4]]:20: error: cannot bind durable reference to non-reference value of type `i32` [ConversionFailureNonRefToRef]
- // CHECK:STDERR: let ref x: i32 = F();
- // CHECK:STDERR: ^~~
- // CHECK:STDERR:
- let ref x: i32 = F();
- }
|