The purpose of canonicalize is for you to be able to verify or validate that two paths which may have a different string presentation, eventually lead to the same place in the filesystem (are equal). It does so by following each element in the path, resolving all symlinks.
There are use cases for handling non-existing paths. Mainly an edge case when we want to verifying a future file location is indeed gonna end up within another predefined path.
Python 3.6 has introduced such feature in their language: pathlib.Path.resolve(strict=False)
Inspired by their approach, I have created the soft-canonicalize crate that does exactly that: std::fs::canonicalize that works with non-existing file paths.
Unlike std::path::absolute(), soft-canonicalize does resolve symlinks.