Commit Graph

23 Commits

Author SHA1 Message Date
Vadim Petrochenkov 90d11d6448 rustc_span: Optimize syntax context comparisons
Including comparisons with root context
2024-01-06 01:25:20 +03:00
Arthur Lafrance 5895102c4d debug Span::ctxt() call detection 2023-10-16 19:50:29 -07:00
Arthur Lafrance f77dea89e1 basic lint v2 implemented 2023-10-16 19:47:33 -07:00
Arthur Lafrance 8769e02d0b implement the basics of the lint static analysis 2023-10-16 19:47:33 -07:00
Michael Goulet b2d2184ede Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
Nicholas Nethercote 5790372736 Optimize Span::is_dummy.
It's quite hot, and worth having a version that works directly at the
`Span` level, rather than first converting to the `SpanData` level.
2023-09-08 16:54:02 +10:00
Nicholas Nethercote e525e4f10a Span tweaks.
`Span` has undergone some changes over the years (addition of an optional
parent, and possible inlining of the context in interned spans) but the
comments and identifiers used haven't kept up. As a result, I find it
harder to understand than I should.

This commit reworks the comments, renames some identifiers, and
restructures the code slightly, all to make things clearer. I now feel
like I understand this code again.
2023-09-08 16:53:57 +10:00
Camille GILLOT 99962a8418 Refactor SyntaxContext::ctxt logic. 2023-04-18 18:00:21 +00:00
Camille GILLOT e80afa6501 Intern span when length is MAX_LEN with parent. 2023-02-11 17:46:22 +00:00
Camille GILLOT 6d42636456 Encode span parent in the inlined representation. 2022-12-25 16:41:33 +00:00
Maybe Waffle f2b97a8bfe Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
Camille GILLOT 3e67bded92 Make names more explicit. 2022-08-17 19:20:28 +02:00
Camille GILLOT b2a17e9bd1 Keep ctxt in encoded span representation. 2022-08-17 19:18:33 +02:00
Mark Rousskov 76b13c9eea Enable rustc_pass_by_value for Span 2022-02-25 08:00:53 -05:00
Mark Rousskov 22c3a71de1 Switch bootstrap cfgs 2022-02-25 08:00:52 -05:00
lcnr 2684dfe583 try apply rustc_pass_by_value to Span 2022-01-27 11:29:41 +01:00
Camille GILLOT 940fa9251e Rename decode to data_untracked. 2021-09-10 20:18:22 +02:00
Camille GILLOT b19ae20aad Track span dependency using a callback. 2021-09-10 20:18:18 +02:00
Camille GILLOT 00485e0c0e Keep a parent LocalDefId in SpanData. 2021-09-10 20:17:33 +02:00
Guillaume Gomez a2654fb64c Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
Joshua Nelson b73ad09dfd Remove SpanInterner::get
- It's used exactly once, so it's trivial to replace
- It doesn't match the normal convention for containers: normally
`get()` returns and option and indexing panics. Instead `get()` panicked
  and there's no indexing operation available.
2021-05-03 17:32:06 -04:00
pierwill a8775d44e9 Edit rustc_span documentation
Various changes to the `rustc_span` docs, including the following:

- Additions to top-level docs
- Edits to the source_map module docs
- Edits to documentation for `Span` and `SpanData`
- Added intra-docs links
- Documentation for Levenshtein distances
- Fixed missing punctuation
2020-12-25 14:02:52 -08:00
mark 9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00