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

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