Weighted Poincaré inequality and rigidity of complete manifolds