Skip to content
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

Investigate use of cfg(accessible) #1

Open
roblabla opened this issue Oct 8, 2019 · 7 comments
Open

Investigate use of cfg(accessible) #1

roblabla opened this issue Oct 8, 2019 · 7 comments
Labels
upstream Blocked by an upstream bug

Comments

@roblabla
Copy link
Contributor

roblabla commented Oct 8, 2019

Instead of version_check, we might be able to use cfg(accessible) from rust-lang/rfcs#2523. I see two upsides to this:

  1. We might be able to do away with the build script entirely on platforms that support cfg(accessible) (need to investigate if we can conditionally remove the build script).
  2. We could better support nightly users that might be using nightly-only error types.
@roblabla roblabla changed the title Investigate use of https://github.com/rust-lang/rfcs/pull/2523 Investigate use of cfg(accessible) Oct 8, 2019
@leo60228
Copy link
Contributor

leo60228 commented Oct 8, 2019

@leo60228
Copy link
Contributor

leo60228 commented Oct 8, 2019

You can also have currently-invalid cfgs in the conditional cfg. Are there any cfgs that are currently unstable?

@roblabla
Copy link
Contributor Author

roblabla commented Oct 8, 2019

cfg(rustdoc) is nightly-only.

@leo60228
Copy link
Contributor

leo60228 commented Oct 8, 2019

@roblabla That compiles on release mode but not debug, so I think that path will work. In case the playground somehow breaks:

#[cfg_attr(debug_assertions, cfg(rustdoc))]
#[cfg(debug_assertions)]
fn func() {
    println!("{}", "hi");
}

@leo60228
Copy link
Contributor

leo60228 commented Oct 8, 2019

...wait, all is short-circuiting, so that hack isn"t even necessary.

@leo60228
Copy link
Contributor

Assuming that Rust 1.xx.0 adds cfg(accessible), we should use cfg(all(rust_1_xx_0, accessible(core::error::WhateverError))). I don"t think this is actionable until cfg(accessible) is stabilized.

@roblabla roblabla added the upstream Blocked by an upstream bug label Oct 10, 2019
@roblabla
Copy link
Contributor Author

Let"s keep this open while waiting for cfg(accessible). Issues should only be closed once they"ve been completed (either as "won"t ever happen" or "this is implemented in master").

@roblabla roblabla reopened this Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Blocked by an upstream bug
Projects
None yet
Development

No branches or pull requests

2 participants