aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/old_alias_after_replace.zc
blob: 7ca861638890107a6674025a6a9cc0e341a951e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
namespace;
include rt;

// expect: borrowed: used after it was given away
fn main() {
	let target = rt.new(1), replacement = rt.new(1);
	let borrowed = target + 0;
	rt.free(target); target = replacement;
	rt.put_n(target[0]);
	return borrowed[0];
}