[Chapel Merge] Deprecate c_string to string assignment

Branch: refs/heads/master
Revision: 27962e5
Author: e-kayrakli
Log Message:

Merge pull request #16792 from e-kayrakli/depr-cstring-to-string-asgnmt

Deprecate c_string to string assignment

As part of reducing c_string’s role in the language (#14215), this PR deprecates
assigning them to Chapel strings. Users should use createStringWith* functions
instead.

Resolves https://github.com/chapel-lang/chapel/issues/15775
Resolves https://github.com/chapel-lang/chapel/issues/16702

c_string is just a byte buffer that is not guaranteed to be in UTF-8. This
arises many questions about how/when they should be validated if they are
assigned to a Chapel string. As we already are planning to remove c_string
gradually, it is more reasonable to deprecate this operation instead of trying
to solve the issues around it.

This deprecates both:

  • proc string.init=(cs:c_string)
  • proc =(x:string, y:c_string)

Also adds a deprecation test, and removes a relevant test.

[Reviewed by @mppf]

Test:

  • [x] standard
  • [x] gasnet

Modified Files:
A test/deprecated/cStrAssignment-initeq.good
A test/deprecated/cStrAssignment-proceq.good
A test/deprecated/cStrAssignment.chpl
A test/deprecated/cStrAssignment.execopts
A test/deprecated/cStrAssignment.good
R test/types/string/validation/reinitFromCString.chpl
R test/types/string/validation/reinitFromCString.good
M modules/internal/String.chpl
M test/extern/bradc/extern_string_test-remote.chpl

Compare: https://github.com/chapel-lang/chapel/compare/797d44e50af3...27962e5c3cfa