Skip to content

Commit beb2cde

Browse files
authored
Stabilize debugger_visualizer feature (#855)
* Stabilize debugger_visualizer feature * Run debugger_visualizer on more rustc versions
1 parent 86730f1 commit beb2cde

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ jobs:
4242
# Run tests enabling the serde feature
4343
- name: Run tests with the serde feature
4444
run: cargo test --features "url/serde,url/expose_internals"
45-
# The #[debugger_visualizer] attribute is currently gated behind an unstable feature flag.
46-
# In order to test the visualizers for the url crate, they have to be tested on a nightly build.
45+
# The #[debugger_visualizer] attribute is currently gated behind a feature flag until #[debugger_visualizer]
46+
# is available in all rustc versions past our MSRV. As such, we only run the tests on newer rustc versions.
4747
- name: Run debugger_visualizer tests
4848
if: |
4949
matrix.os == 'windows-latest' &&
50-
matrix.rust == 'nightly'
50+
matrix.rust != '1.56.0'
5151
run: cargo test --test debugger_visualizer --features "url/debugger_visualizer,url_debug_tests/debugger_visualizer" -- --test-threads=1
5252
- name: Test `no_std` support
5353
run: cargo test --no-default-features --features=alloc

debug_metadata/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ types, descibe how to display those types. (For writing a pretty printer, see: h
2222

2323
### Embedding Visualizers
2424

25-
Through the use of the currently unstable `#[debugger_visualizer]` attribute, the `url`
26-
crate can embed debugger visualizers into the crate metadata.
25+
Through the use of the `#[debugger_visualizer]` attribute, the `url` crate can embed
26+
debugger visualizers into the crate metadata.
2727

2828
Currently the two types of visualizers supported are Natvis and Pretty printers.
2929

url/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ serde = { version = "1.0", optional = true, features = ["derive"] }
2929

3030
[features]
3131
default = []
32-
# UNSTABLE FEATURES (requires Rust nightly)
33-
# Enable to use the #[debugger_visualizer] attribute.
32+
# Enable to use the #[debugger_visualizer] attribute. This feature requires Rust >= 1.71.
3433
debugger_visualizer = []
3534
# Expose internal offsets of the URL.
3635
expose_internals = []

url/src/lib.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,24 @@ See [serde documentation](https://serde.rs) for more information.
119119
url = { version = "2", features = ["serde"] }
120120
```
121121
122+
# Feature: `debugger_visualizer`
123+
124+
If you enable the `debugger_visualizer` feature, the `url` crate will include
125+
a [natvis file](https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects)
126+
for [Visual Studio](https://www.visualstudio.com/) that allows you to view
127+
[`Url`](struct.Url.html) objects in the debugger.
128+
129+
This feature requires Rust 1.71 or later.
130+
131+
```toml
132+
url = { version = "2", features = ["debugger_visualizer"] }
133+
```
134+
122135
*/
123136

124137
#![doc(html_root_url = "https://docs.rs/url/2.4.0")]
125138
#![cfg_attr(
126139
feature = "debugger_visualizer",
127-
feature(debugger_visualizer),
128140
debugger_visualizer(natvis_file = "../../debug_metadata/url.natvis")
129141
)]
130142

0 commit comments

Comments
 (0)