diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2024-12-03 16:13:00 +0000 |
|---|---|---|
| committer | Celina G. Val <celinval@amazon.com> | 2025-02-03 13:55:15 -0800 |
| commit | 6a6c6b891bb0350b3f16abd3e84ff12dbd1b4c5b (patch) | |
| tree | 8e16cd67997426132fcfa3a0877a8e7d829f124c /compiler/rustc_session/src/parse.rs | |
| parent | b279ff9dcfadcdb6976097d58044d151af81cf51 (diff) | |
| download | rust-6a6c6b891bb0350b3f16abd3e84ff12dbd1b4c5b.tar.gz rust-6a6c6b891bb0350b3f16abd3e84ff12dbd1b4c5b.zip | |
Separate contract feature gates for the internal machinery
The extended syntax for function signature that includes contract clauses should never be user exposed versus the interface we want to ship externally eventually.
Diffstat (limited to 'compiler/rustc_session/src/parse.rs')
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 81ae06602cd..abfd3efc611 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -207,6 +207,10 @@ pub struct ParseSess { pub config: Cfg, pub check_config: CheckCfg, pub edition: Edition, + /// Places where contract attributes were expanded into unstable AST forms. + /// This is used to allowlist those spans (so that we only check them against the feature + /// gate for the externally visible interface, and not internal implmentation machinery). + pub contract_attribute_spans: AppendOnlyVec<Span>, /// Places where raw identifiers were used. This is used to avoid complaining about idents /// clashing with keywords in new editions. pub raw_identifier_spans: AppendOnlyVec<Span>, @@ -255,6 +259,7 @@ impl ParseSess { config: Cfg::default(), check_config: CheckCfg::default(), edition: ExpnId::root().expn_data().edition, + contract_attribute_spans: Default::default(), raw_identifier_spans: Default::default(), bad_unicode_identifiers: Lock::new(Default::default()), source_map, |
