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

add a Backtrace::disabled function #74490

Merged
merged 3 commits into from
Jul 23, 2020
Merged

add a Backtrace::disabled function #74490

merged 3 commits into from
Jul 23, 2020

Conversation

yaahc
Copy link
Member

@yaahc yaahc commented Jul 18, 2020

Based upon @dtolnay's suggestion here: dtolnay/anyhow#97 (comment)

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 18, 2020
@yaahc
Copy link
Member Author

yaahc commented Jul 18, 2020

@mystor has raised an alternative approach based on consts

impl Backtrace {
    const DISABLED: Backtrace;
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f2c4c0046aa51bb12686ad375909e0e2

src/libstd/backtrace.rs Outdated Show resolved Hide resolved
@dtolnay
Copy link
Member

dtolnay commented Jul 22, 2020

const DISABLED is fine too; I don't have a preference between those.

Co-authored-by: David Tolnay <dtolnay@gmail.com>
@yaahc
Copy link
Member Author

yaahc commented Jul 23, 2020

I think making this const fn solves the issue that const DISABLED was trying to solve, and so I'd prefer to have it be a fn to be consistent with capture and force_capture.

@dtolnay
Copy link
Member

dtolnay commented Jul 23, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 23, 2020

📌 Commit 50347b8 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 23, 2020
…arth

Rollup of 8 pull requests

Successful merges:

 - rust-lang#74141 (libstd/libcore: fix various typos)
 - rust-lang#74490 (add a Backtrace::disabled function)
 - rust-lang#74548 (one more Path::with_extension example, to demonstrate behavior)
 - rust-lang#74587 (Prefer constant over function)
 - rust-lang#74606 (Remove Linux workarounds for missing CLOEXEC support)
 - rust-lang#74637 (Make str point to primitive page)
 - rust-lang#74654 (require type defaults to be after const generic parameters)
 - rust-lang#74659 (Improve codegen for unchecked float casts on wasm)

Failed merges:

r? @ghost
@bors bors merged commit f98c77c into rust-lang:master Jul 23, 2020
@yaahc yaahc mentioned this pull request Jul 27, 2022
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants