| 1 |
// Copyright (C) 2020-2024 Free Software Foundation, Inc. |
| 2 |
|
| 3 |
// This file is part of GCC. |
| 4 |
|
| 5 |
// GCC is free software; you can redistribute it and/or modify it under |
| 6 |
// the terms of the GNU General Public License as published by the Free |
| 7 |
// Software Foundation; either version 3, or (at your option) any later |
| 8 |
// version. |
| 9 |
|
| 10 |
// GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 11 |
// WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 13 |
// for more details. |
| 14 |
|
| 15 |
// You should have received a copy of the GNU General Public License |
| 16 |
// along with GCC; see the file COPYING3. If not see |
| 17 |
// <http://www.gnu.org/licenses/>. |
| 18 |
|
| 19 |
#include "rust-ast-resolve-path.h" |
| 20 |
#include "rust-ast-resolve-type.h" |
| 21 |
#include "rust-hir-map.h" |
| 22 |
#include "rust-path.h" |
| 23 |
|
| 24 |
namespace Rust { |
| 25 |
namespace Resolver { |
| 26 |
|
| 27 |
ResolvePath::ResolvePath () : ResolverBase () {} |
| 28 |
|
| 29 |
NodeId |
| 30 |
ResolvePath::go (AST::PathInExpression &expr) |
| 31 |
{ |
| 32 |
ResolvePath resolver; |
| 33 |
return resolver.resolve_path (expr); |
| 34 |
} |
| 35 |
|
| 36 |
NodeId |
| 37 |
ResolvePath::go (AST::QualifiedPathInExpression &expr) |
| 38 |
{ |
| 39 |
ResolvePath resolver; |
| 40 |
return resolver.resolve_path (expr); |
| 41 |
} |
| 42 |
|
| 43 |
NodeId |
| 44 |
ResolvePath::go (AST::SimplePath &expr) |
| 45 |
{ |
| 46 |
ResolvePath resolver; |
| 47 |
return resolver.resolve_path (expr); |
| 48 |
} |
| 49 |
|
| 50 |
NodeId |
| 51 |
ResolvePath::resolve_path (AST::PathInExpression &expr) |
| 52 |
{ |
| 53 |
if (expr.is_lang_item ()) |
| 54 |
return Analysis::Mappings::get ().get_lang_item_node ( |
| 55 |
expr.get_lang_item ()); |
| 56 |
|
| 57 |
NodeId resolved_node_id = UNKNOWN_NODEID; |
| 58 |
NodeId module_scope_id = resolver->peek_current_module_scope (); |
| 59 |
NodeId previous_resolved_node_id = module_scope_id; |
| 60 |
for (size_t i = 0; i < expr.get_segments ().size (); i++) |
| 61 |
{ |
| 62 |
auto &segment = expr.get_segments ().at (i); |
| 63 |
const AST::PathIdentSegment &ident_seg = segment.get_ident_segment (); |
| 64 |
bool is_first_segment = i == 0; |
| 65 |
resolved_node_id = UNKNOWN_NODEID; |
| 66 |
|
| 67 |
bool in_middle_of_path = i > 0; |
| 68 |
if (in_middle_of_path && segment.is_lower_self_seg ()) |
| 69 |
{ |
| 70 |
rust_error_at (segment.get_locus (), ErrorCode::E0433, |
| 71 |
"leading path segment %qs can only be used at the " |
| 72 |
"beginning of a path", |
| 73 |
segment.as_string ().c_str ()); |
| 74 |
return UNKNOWN_NODEID; |
| 75 |
} |
| 76 |
|
| 77 |
NodeId crate_scope_id = resolver->peek_crate_module_scope (); |
| 78 |
if (segment.is_crate_path_seg ()) |
| 79 |
{ |
| 80 |
// what is the current crate scope node id? |
| 81 |
module_scope_id = crate_scope_id; |
| 82 |
previous_resolved_node_id = module_scope_id; |
| 83 |
|
| 84 |
NodeId existing = UNKNOWN_NODEID; |
| 85 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 86 |
&existing); |
| 87 |
|
| 88 |
if (ok) |
| 89 |
rust_assert (existing == module_scope_id); |
| 90 |
else |
| 91 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 92 |
module_scope_id); |
| 93 |
continue; |
| 94 |
} |
| 95 |
else if (segment.is_super_path_seg ()) |
| 96 |
{ |
| 97 |
if (module_scope_id == crate_scope_id) |
| 98 |
{ |
| 99 |
rust_error_at (segment.get_locus (), |
| 100 |
"cannot use %<super%> at the crate scope"); |
| 101 |
return UNKNOWN_NODEID; |
| 102 |
} |
| 103 |
|
| 104 |
module_scope_id = resolver->peek_parent_module_scope (); |
| 105 |
previous_resolved_node_id = module_scope_id; |
| 106 |
|
| 107 |
NodeId existing = UNKNOWN_NODEID; |
| 108 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 109 |
&existing); |
| 110 |
|
| 111 |
if (ok) |
| 112 |
rust_assert (existing == module_scope_id); |
| 113 |
else |
| 114 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 115 |
module_scope_id); |
| 116 |
continue; |
| 117 |
} |
| 118 |
|
| 119 |
// resolve any generic args |
| 120 |
if (segment.has_generic_args ()) |
| 121 |
ResolveGenericArgs::go (segment.get_generic_args ()); |
| 122 |
|
| 123 |
// logic is awkward here there are a few cases |
| 124 |
// |
| 125 |
// T::Default |
| 126 |
// mod::foo::impl_item |
| 127 |
// super::super::module::item |
| 128 |
// self |
| 129 |
// self::foo |
| 130 |
// self::foo::baz |
| 131 |
// |
| 132 |
// T::Default we can only resolve the T and cant do anything about Default |
| 133 |
// its dependant on associated types |
| 134 |
// |
| 135 |
// mod::foo::impl_item |
| 136 |
// we can resolve mod::foo but nothing about impl_item but we need to |
| 137 |
// _always resolve generic arguments |
| 138 |
// |
| 139 |
// self is a simple single lookup |
| 140 |
// |
| 141 |
// we have module_scope_id for the next module_scope to lookup |
| 142 |
// resolved_node_id is the thing we have resolve this segment to |
| 143 |
// |
| 144 |
// new algo? |
| 145 |
// we can only use module resolution when the previous segment is either |
| 146 |
// unknown or equal to this module_scope_id |
| 147 |
// |
| 148 |
// can only use old resolution when previous segment is unkown |
| 149 |
|
| 150 |
if (is_first_segment) |
| 151 |
{ |
| 152 |
// name scope first |
| 153 |
NodeId resolved_node = UNKNOWN_NODEID; |
| 154 |
const CanonicalPath path |
| 155 |
= CanonicalPath::new_seg (segment.get_node_id (), |
| 156 |
ident_seg.as_string ()); |
| 157 |
if (resolver->get_name_scope ().lookup (path, &resolved_node)) |
| 158 |
{ |
| 159 |
NodeId existing = UNKNOWN_NODEID; |
| 160 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 161 |
&existing); |
| 162 |
|
| 163 |
if (ok) |
| 164 |
rust_assert (existing == resolved_node); |
| 165 |
else |
| 166 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 167 |
resolved_node); |
| 168 |
resolved_node_id = resolved_node; |
| 169 |
} |
| 170 |
// check the type scope |
| 171 |
else if (resolver->get_type_scope ().lookup (path, &resolved_node)) |
| 172 |
{ |
| 173 |
NodeId existing = UNKNOWN_NODEID; |
| 174 |
bool ok = resolver->lookup_resolved_type (segment.get_node_id (), |
| 175 |
&existing); |
| 176 |
|
| 177 |
if (ok) |
| 178 |
rust_assert (existing == resolved_node); |
| 179 |
else |
| 180 |
resolver->insert_resolved_type (segment.get_node_id (), |
| 181 |
resolved_node); |
| 182 |
resolved_node_id = resolved_node; |
| 183 |
} |
| 184 |
else if (segment.is_lower_self_seg ()) |
| 185 |
{ |
| 186 |
module_scope_id = crate_scope_id; |
| 187 |
previous_resolved_node_id = module_scope_id; |
| 188 |
|
| 189 |
NodeId existing = UNKNOWN_NODEID; |
| 190 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 191 |
&existing); |
| 192 |
|
| 193 |
if (ok) |
| 194 |
rust_assert (existing == module_scope_id); |
| 195 |
else |
| 196 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 197 |
module_scope_id); |
| 198 |
continue; |
| 199 |
} |
| 200 |
else |
| 201 |
{ |
| 202 |
// no error handling here since we might be able to resolve via |
| 203 |
// the module hierarchy and handle errors at the end |
| 204 |
} |
| 205 |
} |
| 206 |
|
| 207 |
if (resolved_node_id == UNKNOWN_NODEID |
| 208 |
&& previous_resolved_node_id == module_scope_id) |
| 209 |
{ |
| 210 |
tl::optional<CanonicalPath &> resolved_child |
| 211 |
= mappings.lookup_module_child (module_scope_id, |
| 212 |
ident_seg.as_string ()); |
| 213 |
if (resolved_child.has_value ()) |
| 214 |
{ |
| 215 |
NodeId resolved_node = resolved_child->get_node_id (); |
| 216 |
if (resolver->get_name_scope ().decl_was_declared_here ( |
| 217 |
resolved_node)) |
| 218 |
{ |
| 219 |
resolved_node_id = resolved_node; |
| 220 |
|
| 221 |
NodeId existing = UNKNOWN_NODEID; |
| 222 |
bool ok |
| 223 |
= resolver->lookup_resolved_name (segment.get_node_id (), |
| 224 |
&existing); |
| 225 |
|
| 226 |
if (ok) |
| 227 |
rust_assert (existing == resolved_node); |
| 228 |
else |
| 229 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 230 |
resolved_node); |
| 231 |
} |
| 232 |
else if (resolver->get_type_scope ().decl_was_declared_here ( |
| 233 |
resolved_node)) |
| 234 |
{ |
| 235 |
resolved_node_id = resolved_node; |
| 236 |
|
| 237 |
NodeId existing = UNKNOWN_NODEID; |
| 238 |
bool ok |
| 239 |
= resolver->lookup_resolved_type (segment.get_node_id (), |
| 240 |
&existing); |
| 241 |
|
| 242 |
if (ok) |
| 243 |
rust_assert (existing == resolved_node); |
| 244 |
else |
| 245 |
resolver->insert_resolved_type (segment.get_node_id (), |
| 246 |
resolved_node); |
| 247 |
} |
| 248 |
else |
| 249 |
{ |
| 250 |
rust_error_at (segment.get_locus (), |
| 251 |
"Cannot find path %<%s%> in this scope", |
| 252 |
segment.as_string ().c_str ()); |
| 253 |
return UNKNOWN_NODEID; |
| 254 |
} |
| 255 |
} |
| 256 |
} |
| 257 |
|
| 258 |
bool did_resolve_segment = resolved_node_id != UNKNOWN_NODEID; |
| 259 |
if (did_resolve_segment) |
| 260 |
{ |
| 261 |
if (mappings.node_is_module (resolved_node_id) |
| 262 |
|| mappings.node_is_crate (resolved_node_id)) |
| 263 |
{ |
| 264 |
module_scope_id = resolved_node_id; |
| 265 |
} |
| 266 |
previous_resolved_node_id = resolved_node_id; |
| 267 |
} |
| 268 |
else if (is_first_segment) |
| 269 |
{ |
| 270 |
rust_error_at (segment.get_locus (), ErrorCode::E0433, |
| 271 |
"Cannot find path %<%s%> in this scope", |
| 272 |
segment.as_string ().c_str ()); |
| 273 |
return UNKNOWN_NODEID; |
| 274 |
} |
| 275 |
} |
| 276 |
|
| 277 |
resolved_node = resolved_node_id; |
| 278 |
if (resolved_node_id != UNKNOWN_NODEID) |
| 279 |
{ |
| 280 |
// name scope first |
| 281 |
if (resolver->get_name_scope ().decl_was_declared_here (resolved_node_id)) |
| 282 |
{ |
| 283 |
NodeId existing = UNKNOWN_NODEID; |
| 284 |
bool ok |
| 285 |
= resolver->lookup_resolved_name (expr.get_node_id (), &existing); |
| 286 |
|
| 287 |
if (ok) |
| 288 |
rust_assert (existing == resolved_node_id); |
| 289 |
else |
| 290 |
resolver->insert_resolved_name (expr.get_node_id (), |
| 291 |
resolved_node_id); |
| 292 |
} |
| 293 |
// check the type scope |
| 294 |
else if (resolver->get_type_scope ().decl_was_declared_here ( |
| 295 |
resolved_node_id)) |
| 296 |
{ |
| 297 |
NodeId existing = UNKNOWN_NODEID; |
| 298 |
bool ok |
| 299 |
= resolver->lookup_resolved_type (expr.get_node_id (), &existing); |
| 300 |
|
| 301 |
if (ok) |
| 302 |
rust_assert (existing == resolved_node_id); |
| 303 |
else |
| 304 |
resolver->insert_resolved_type (expr.get_node_id (), |
| 305 |
resolved_node_id); |
| 306 |
} |
| 307 |
else |
| 308 |
{ |
| 309 |
rust_unreachable (); |
| 310 |
} |
| 311 |
} |
| 312 |
return resolved_node_id; |
| 313 |
} |
| 314 |
|
| 315 |
NodeId |
| 316 |
ResolvePath::resolve_path (AST::QualifiedPathInExpression &expr) |
| 317 |
{ |
| 318 |
auto &root_segment = expr.get_qualified_path_type (); |
| 319 |
ResolveType::go (root_segment.get_type ()); |
| 320 |
if (root_segment.has_as_clause ()) |
| 321 |
ResolveType::go (root_segment.get_as_type_path ()); |
| 322 |
|
| 323 |
for (auto &segment : expr.get_segments ()) |
| 324 |
{ |
| 325 |
// we cant actually do anything with the segment itself since this is all |
| 326 |
// the job of the type system to figure it out but we can resolve any |
| 327 |
// generic arguments used |
| 328 |
if (segment.has_generic_args ()) |
| 329 |
ResolveGenericArgs::go (segment.get_generic_args ()); |
| 330 |
} |
| 331 |
|
| 332 |
// cannot fully resolve a qualified path as it is dependant on associated |
| 333 |
// items |
| 334 |
return UNKNOWN_NODEID; |
| 335 |
} |
| 336 |
|
| 337 |
NodeId |
| 338 |
ResolvePath::resolve_path (AST::SimplePath &expr) |
| 339 |
{ |
| 340 |
NodeId crate_scope_id = resolver->peek_crate_module_scope (); |
| 341 |
NodeId module_scope_id = resolver->peek_current_module_scope (); |
| 342 |
|
| 343 |
NodeId previous_resolved_node_id = UNKNOWN_NODEID; |
| 344 |
NodeId resolved_node_id = UNKNOWN_NODEID; |
| 345 |
for (size_t i = 0; i < expr.get_segments ().size (); i++) |
| 346 |
{ |
| 347 |
AST::SimplePathSegment &segment = expr.get_segments ().at (i); |
| 348 |
bool is_first_segment = i == 0; |
| 349 |
bool is_final_segment = i >= (expr.get_segments ().size () - 1); |
| 350 |
resolved_node_id = UNKNOWN_NODEID; |
| 351 |
|
| 352 |
if (segment.is_crate_path_seg ()) |
| 353 |
{ |
| 354 |
// what is the current crate scope node id? |
| 355 |
module_scope_id = crate_scope_id; |
| 356 |
previous_resolved_node_id = module_scope_id; |
| 357 |
|
| 358 |
NodeId existing = UNKNOWN_NODEID; |
| 359 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 360 |
&existing); |
| 361 |
|
| 362 |
if (ok) |
| 363 |
rust_assert (existing == module_scope_id); |
| 364 |
else |
| 365 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 366 |
module_scope_id); |
| 367 |
resolved_node_id = module_scope_id; |
| 368 |
|
| 369 |
continue; |
| 370 |
} |
| 371 |
else if (segment.is_super_path_seg ()) |
| 372 |
{ |
| 373 |
if (!is_first_segment) |
| 374 |
{ |
| 375 |
rust_error_at (segment.get_locus (), |
| 376 |
"%<super%> can only be used in start position"); |
| 377 |
return UNKNOWN_NODEID; |
| 378 |
} |
| 379 |
if (module_scope_id == crate_scope_id) |
| 380 |
{ |
| 381 |
rust_error_at (segment.get_locus (), |
| 382 |
"cannot use %<super%> at the crate scope"); |
| 383 |
return UNKNOWN_NODEID; |
| 384 |
} |
| 385 |
|
| 386 |
module_scope_id = resolver->peek_parent_module_scope (); |
| 387 |
previous_resolved_node_id = module_scope_id; |
| 388 |
|
| 389 |
NodeId existing = UNKNOWN_NODEID; |
| 390 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 391 |
&existing); |
| 392 |
|
| 393 |
if (ok) |
| 394 |
rust_assert (existing == module_scope_id); |
| 395 |
else |
| 396 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 397 |
module_scope_id); |
| 398 |
resolved_node_id = module_scope_id; |
| 399 |
|
| 400 |
continue; |
| 401 |
} |
| 402 |
|
| 403 |
tl::optional<CanonicalPath &> resolved_child |
| 404 |
= mappings.lookup_module_child (module_scope_id, |
| 405 |
segment.get_segment_name ()); |
| 406 |
if (resolved_child.has_value ()) |
| 407 |
{ |
| 408 |
NodeId resolved_node = resolved_child->get_node_id (); |
| 409 |
if (resolver->get_name_scope ().decl_was_declared_here ( |
| 410 |
resolved_node)) |
| 411 |
{ |
| 412 |
resolved_node_id = resolved_node; |
| 413 |
|
| 414 |
NodeId existing = UNKNOWN_NODEID; |
| 415 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 416 |
&existing); |
| 417 |
|
| 418 |
if (ok) |
| 419 |
rust_assert (existing == resolved_node); |
| 420 |
else |
| 421 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 422 |
resolved_node); |
| 423 |
} |
| 424 |
else if (resolver->get_type_scope ().decl_was_declared_here ( |
| 425 |
resolved_node)) |
| 426 |
{ |
| 427 |
resolved_node_id = resolved_node; |
| 428 |
|
| 429 |
NodeId existing = UNKNOWN_NODEID; |
| 430 |
bool ok = resolver->lookup_resolved_type (segment.get_node_id (), |
| 431 |
&existing); |
| 432 |
|
| 433 |
if (ok) |
| 434 |
rust_assert (existing == resolved_node); |
| 435 |
else |
| 436 |
resolver->insert_resolved_type (segment.get_node_id (), |
| 437 |
resolved_node); |
| 438 |
} |
| 439 |
else |
| 440 |
{ |
| 441 |
rust_error_at (segment.get_locus (), |
| 442 |
"Cannot find path %<%s%> in this scope", |
| 443 |
segment.as_string ().c_str ()); |
| 444 |
return UNKNOWN_NODEID; |
| 445 |
} |
| 446 |
} |
| 447 |
|
| 448 |
if (resolved_node_id == UNKNOWN_NODEID && is_first_segment) |
| 449 |
{ |
| 450 |
// name scope first |
| 451 |
NodeId resolved_node = UNKNOWN_NODEID; |
| 452 |
const CanonicalPath path |
| 453 |
= CanonicalPath::new_seg (segment.get_node_id (), |
| 454 |
segment.get_segment_name ()); |
| 455 |
if (resolver->get_name_scope ().lookup (path, &resolved_node)) |
| 456 |
{ |
| 457 |
resolved_node_id = resolved_node; |
| 458 |
|
| 459 |
NodeId existing = UNKNOWN_NODEID; |
| 460 |
bool ok = resolver->lookup_resolved_name (segment.get_node_id (), |
| 461 |
&existing); |
| 462 |
|
| 463 |
if (ok) |
| 464 |
rust_assert (existing == resolved_node); |
| 465 |
else |
| 466 |
resolver->insert_resolved_name (segment.get_node_id (), |
| 467 |
resolved_node); |
| 468 |
} |
| 469 |
// check the type scope |
| 470 |
else if (resolver->get_type_scope ().lookup (path, &resolved_node)) |
| 471 |
{ |
| 472 |
resolved_node_id = resolved_node; |
| 473 |
|
| 474 |
NodeId existing = UNKNOWN_NODEID; |
| 475 |
bool ok = resolver->lookup_resolved_type (segment.get_node_id (), |
| 476 |
&existing); |
| 477 |
|
| 478 |
if (ok) |
| 479 |
rust_assert (existing == resolved_node); |
| 480 |
else |
| 481 |
resolver->insert_resolved_type (segment.get_node_id (), |
| 482 |
resolved_node); |
| 483 |
} |
| 484 |
} |
| 485 |
|
| 486 |
// if we still have not resolved and this is the final segment and the |
| 487 |
// final segment is self its likely the case: pub use |
| 488 |
// |
| 489 |
// result::Result::{self, Err, Ok}; |
| 490 |
// |
| 491 |
// Then the resolved_node_id is just the previous one so long as it is a |
| 492 |
// resolved node id |
| 493 |
// rust_debug_loc (segment.get_locus (), |
| 494 |
// "trying to resolve seg: [%s] first [%s] last [%s]", |
| 495 |
// segment.get_segment_name ().c_str (), |
| 496 |
// is_first_segment ? "true" : "false", |
| 497 |
// is_final_segment ? "true" : "false"); |
| 498 |
if (resolved_node_id == UNKNOWN_NODEID && !is_first_segment |
| 499 |
&& is_final_segment && segment.is_lower_self_seg ()) |
| 500 |
resolved_node_id = previous_resolved_node_id; |
| 501 |
|
| 502 |
// final check |
| 503 |
if (resolved_node_id == UNKNOWN_NODEID) |
| 504 |
{ |
| 505 |
rust_error_at (segment.get_locus (), |
| 506 |
"cannot find simple path segment %<%s%> in this scope", |
| 507 |
segment.as_string ().c_str ()); |
| 508 |
return UNKNOWN_NODEID; |
| 509 |
} |
| 510 |
|
| 511 |
if (mappings.node_is_module (resolved_node_id)) |
| 512 |
{ |
| 513 |
module_scope_id = resolved_node_id; |
| 514 |
} |
| 515 |
|
| 516 |
previous_resolved_node_id = resolved_node_id; |
| 517 |
} |
| 518 |
|
| 519 |
resolved_node = resolved_node_id; |
| 520 |
if (resolved_node_id != UNKNOWN_NODEID) |
| 521 |
{ |
| 522 |
// name scope first |
| 523 |
if (resolver->get_name_scope ().decl_was_declared_here (resolved_node_id)) |
| 524 |
{ |
| 525 |
NodeId existing = UNKNOWN_NODEID; |
| 526 |
bool ok |
| 527 |
= resolver->lookup_resolved_name (expr.get_node_id (), &existing); |
| 528 |
|
| 529 |
if (ok) |
| 530 |
rust_assert (existing == resolved_node_id); |
| 531 |
else |
| 532 |
resolver->insert_resolved_name (expr.get_node_id (), |
| 533 |
resolved_node_id); |
| 534 |
} |
| 535 |
// check the type scope |
| 536 |
else if (resolver->get_type_scope ().decl_was_declared_here ( |
| 537 |
resolved_node_id)) |
| 538 |
{ |
| 539 |
NodeId existing = UNKNOWN_NODEID; |
| 540 |
bool ok |
| 541 |
= resolver->lookup_resolved_type (expr.get_node_id (), &existing); |
| 542 |
|
| 543 |
if (ok) |
| 544 |
rust_assert (existing == resolved_node_id); |
| 545 |
else |
| 546 |
resolver->insert_resolved_type (expr.get_node_id (), |
| 547 |
resolved_node_id); |
| 548 |
} |
| 549 |
else |
| 550 |
{ |
| 551 |
rust_unreachable (); |
| 552 |
} |
| 553 |
} |
| 554 |
return resolved_node_id; |
| 555 |
} |
| 556 |
|
| 557 |
} // namespace Resolver |
| 558 |
} // namespace Rust |