Remove SymbolStr.
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
This commit is contained in:
@@ -319,8 +319,8 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
|
||||
if let ExprKind::Path(qpath) = &callee.kind;
|
||||
let res = self.typeck_results.qpath_res(qpath, callee.hir_id);
|
||||
if let Some(def_id) = res.opt_def_id();
|
||||
let def_path: Vec<_> = self.lcx.get_def_path(def_id).into_iter().map(Symbol::as_str).collect();
|
||||
let def_path: Vec<&str> = def_path.iter().take(4).map(|s| &**s).collect();
|
||||
let def_path = self.lcx.get_def_path(def_id);
|
||||
let def_path: Vec<&str> = def_path.iter().take(4).map(|s| s.as_str()).collect();
|
||||
if let ["core", "num", int_impl, "max_value"] = *def_path;
|
||||
then {
|
||||
let value = match int_impl {
|
||||
|
||||
Reference in New Issue
Block a user