Disciplined convex programming error: Cannot perform the operation: {real affine} .* {log-affine}

cvx_begin
    variable x
    maximize -(1-x)*exp(-x) %目标函数

cvx_end	

%%%%%%%%%%%%%
The objective function is concave, why are there so many errors?
错误使用 .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {real affine} .* {log-affine}

出错 * (line 36)
z = feval( oper, x, y );

出错 maximize (line 14)
x = evalin( ‘caller’, sprintf( '%s ', varargin{:} ) );

出错 shiyan (line 46)
maximize -x*exp(-x) %目标函数

First of all, you must follow CVX’s rules.

Second of all, the objective is convex for x > 3.

For some range of x it can be done, set t=1-x and see the eq. (5.10) in https://docs.mosek.com/modeling-cookbook/expo.html#lambert-w-function for epigraph of te^t.

Thank you very much for your help