- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Implement RFC 3631: add rustdoc doc_cfg features #138907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| 
           Noted! And that will be a nice improvement, thanks! Just one thing left for the cfg expansion missing:   | 
    
          
 Do you mean like in #138515? :)  | 
    
| 
           You're my hero! Gonna need to handle this new attribute then. :)  | 
    
4a05a52    to
    3d2eef1      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| 
           ☔ The latest upstream changes (presumably #138923) made this pull request unmergeable. Please resolve the merge conflicts.  | 
    
d88598f    to
    db25eea      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| 
           ☔ The latest upstream changes (presumably #138927) made this pull request unmergeable. Please resolve the merge conflicts.  | 
    
b8cb424    to
    b581ce1      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
b581ce1    to
    1cb7fac      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
71369a1    to
    fbee8a9      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
doc_auto_cfg has been removed
```
error[E0557]: feature has been removed
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.12/src/lib.rs:185:29
    |
185 | #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))]
    |                             ^^^^^^^^^^^^ feature has been removed
    |
    = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information
    = note: merged into `doc_cfg`
```
as a workaround pin to a version predating the change
    doc_auto_cfg has been removed
```
error[E0557]: feature has been removed
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.12/src/lib.rs:185:29
    |
185 | #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))]
    |                             ^^^^^^^^^^^^ feature has been removed
    |
    = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information
    = note: merged into `doc_cfg`
```
as a workaround pin to a version predating the change
    doc_auto_cfg has been merged into doc_cfg: error[E0557]: feature has been removed --> src/lib.rs:2:40 | 2 | #![cfg_attr(all(doc, nightly), feature(doc_auto_cfg))] // expect nightly for doc | ^^^^^^^^^^^^ feature has been removed | = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information = note: merged into `doc_cfg` Signed-off-by: Hanna Czenczek <[email protected]>
doc_auto_cfg has been merged into doc_cfg: error[E0557]: feature has been removed --> src/lib.rs:2:40 | 2 | #![cfg_attr(all(doc, nightly), feature(doc_auto_cfg))] // expect nightly for doc | ^^^^^^^^^^^^ feature has been removed | = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information = note: merged into `doc_cfg` Signed-off-by: Hanna Czenczek <[email protected]> (cherry picked from commit 273e6a2) Signed-off-by: Hanna Czenczek <[email protected]>
#### Problem The docs builds are currently failing due to the changes in <rust-lang/rust#138907>. #### Summary of changes As recommended there, use `doc_cfg` instead of `doc_auto_cfg`.
#### Problem The docs builds are currently failing due to the changes in <rust-lang/rust#138907>. #### Summary of changes As recommended there, use `doc_cfg` instead of `doc_auto_cfg`.
- [ ] Added a `CHANGELOG.md` entry # Summary Replace the removed `doc_auto_cfg` feature with the `doc_cfg` feature. # Motivation Avoid compilation errors when building documentation. # Details `doc_auto_cfg` was merged into `doc_cfg` in rust-lang/rust#138907. When `docsrs` is enabled, the old `doc_auto_cfg` results in the following errors on the latest nightlies: ``` error[E0557]: feature has been removed --> src/lib.rs:56:29 | 56 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] | ^^^^^^^^^^^^ feature has been removed | = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information = note: merged into `doc_cfg` ``` ``` error[E0557]: feature has been removed --> rand_core/src/lib.rs:36:29 | 36 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] | ^^^^^^^^^^^^ feature has been removed | = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information = note: merged into `doc_cfg` ``` The new `doc_cfg` retains the automatic `cfg` generation that `doc_auto_cfg` used to provide.
* chore(deps): update various dependencies * chore(deps): update checkout and CodSpeedHQ actions * chore(ci): specify mode for `CodSpeedHQ` action * chore!: bump minimum Rust version, `1.82.0` -> `1.88.0` * fix(docs): rename `doc_auto_cfg` attribute See rust-lang/rust#138907 * fix(ci): require `read` permission for crates' token * chore(ci): remove duplicate test for docs * fix * fix(ci): only check if access token is set * fix(ci): better emulate docsrs by not building dependencies --------- Co-authored-by: Jérome Eertmans <[email protected]>
* feat(lock): add support for private packages * refactor(error): rename error variant * feat(core): support installing private package * feat(registry): authenticate all requests if logged in * feat: save correct lockfile entry for private projects * test(core): add install private package test * docs: doc_auto_cfg merged into doc_cfg Ref: rust-lang/rust#138907 * test: add integration test
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
the `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
The `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907
Implementation of rust-lang/rfcs#3631.
This implementation actually resulted in a lot of simplifications:
cfgcomputation is now done in one place:propagate_doc_cfg.rs. Because (trait)impls are not retrieved at the same time as the other items, we cannot perform this computation in the clean process, it needs to be after.cfginheritance, we can keep track of them in one place (inpropagate_doc_cfg.rs), meaning we don't need to copy an item's attributes to its children anymore. Only exception: impl items. For them we clone onlycfgattributes.propagate_doc_cfg.rsis also now much simpler, much less need to keep track of parents, since everything we need is handled by the newCfgInfotype.Cfg::simplify_withcould either be removed or at least used directly intopropagate_doc_cfg.rswhen we computecfgs. Considering how big the PR already is, I'll do it in a follow-up.I didn't remove the
doc_cfg*features in this PR because some dependencies used inrustc(likestdarch) are using it, so we need to have a nightly released with this PR before I can switch to the new feature.r? ghost