tame/tamer/src
Mike Gerwitz 2715f3e845 tamer: sym: Expose raw SymbolId for static symbols
This provides a child `raw` module that exposes a SymbolId representing the
inner value of each of the static newtypes.  This is needed in situations
where the type must match and the type of the static symbol is not
important.

In particular, when comparing against runtime-allocated symbols in `match`
expressions.

It is also worth noting that this commit managed to hit a bug in Rustc that
was fixed on 10/1/2021.  We use nightly, and it doesn't seem that this
occurred in stable, from bug reports.

  - https://github.com/rust-lang/rust/issues/89393
  - 5ab1245303
  - Original issue: https://github.com/rust-lang/rust/issues/72476

The error was:

  compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs:1191:22:
  Unexpected type for `Single` constructor: <u32 as sym::symbol::SymbolIndexSize>::NonZero

  thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1146:9

This occurred because we were trying to use `SymbolId` as the type, which
uses a projected type as its inner value: `SymbolId<Ix: SymbolIndexSize>(Ix::NonZero)`.
This was not a problem with the static newtypes because their inner type was
simply `SymbolId<Ix>`, which is not projected.

This is one of the risks of using nightly.

But, the point is: if you receive this error, upgrade your toolchain.
2021-10-18 10:53:53 -04:00
..
bin tamer: frontend: Begin basic XML parsing 2021-07-27 00:37:13 -04:00
frontend tamer: frontend: Begin basic XML parsing 2021-07-27 00:37:13 -04:00
ir tamer: Use `..` for tuple unimportant variant matches 2021-10-15 12:28:59 -04:00
ld tamer: Use `..` for tuple unimportant variant matches 2021-10-15 12:28:59 -04:00
obj tamer: {obj=>ld}::xmle 2021-10-11 23:52:59 -04:00
sym tamer: sym: Expose raw SymbolId for static symbols 2021-10-18 10:53:53 -04:00
test tamer: tameld: Skip fragment unescaping only to re-escape on write 2021-08-18 11:39:06 -04:00
tpwrap tamer: Introduce tpwrap module to contain quick_xml::Error adapter 2021-07-23 23:23:55 -04:00
convert.rs tamer: convert: Add missing method-level docs 2021-09-08 16:12:53 -04:00
fs.rs Copyright year update 2021 2021-07-22 15:00:15 -04:00
global.rs tamer: Remove Ix generalization throughout system 2021-09-23 14:52:54 -04:00
ld.rs tamer: ld (Linking Process): Minor doc update to reflect changes 2021-10-12 09:49:40 -04:00
lib.rs tamer: sym::prefill: Static symbol polymorphism 2021-10-02 00:58:14 -04:00
span.rs tamer: Replace all &'static str in errors with SymbolId 2021-10-11 15:39:53 -04:00