Skip to content

Commit 2c46329

Browse files
lucacasonatodomenukk
authored andcommitted
Stabilize debugger_visualizer feature (#855)
* Stabilize debugger_visualizer feature * Run debugger_visualizer on more rustc versions
1 parent 047d334 commit 2c46329

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ jobs:
4949
# Run tests enabling the serde feature
5050
- name: Run tests with the serde feature
5151
run: cargo test --features "url/serde,url/expose_internals"
52-
# The #[debugger_visualizer] attribute is currently gated behind an unstable feature flag.
53-
# In order to test the visualizers for the url crate, they have to be tested on a nightly build.
52+
# The #[debugger_visualizer] attribute is currently gated behind a feature flag until #[debugger_visualizer]
53+
# is available in all rustc versions past our MSRV. As such, we only run the tests on newer rustc versions.
5454
- name: Run debugger_visualizer tests
5555
if: |
5656
matrix.os == 'windows-latest' &&
57-
matrix.rust == 'nightly'
57+
matrix.rust != '1.56.0'
5858
run: cargo test --test debugger_visualizer --features "url/debugger_visualizer,url_debug_tests/debugger_visualizer" -- --test-threads=1
5959
- name: Test `no_std` support
6060
run: cargo test --no-default-features --features=alloc,no_std_net

debug_metadata/README.md

+2-2
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ no-std-net = { version = "0.6.0", default-features = false, optional = true }
3232
default = ["std"]
3333
std = ["idna/std", "percent-encoding/std", "form_urlencoded/std", "alloc"]
3434
alloc = []
35-
# UNSTABLE FEATURES (requires Rust nightly)
36-
# Enable to use the #[debugger_visualizer] attribute.
35+
# Enable to use the #[debugger_visualizer] attribute. This feature requires Rust >= 1.71.
3736
debugger_visualizer = []
3837
# Expose internal offsets of the URL.
3938
expose_internals = []
4039
# For no_std: Allow the use of no_std_net instead of nightly
4140
no_std_net = ["no-std-net"]
41+
# UNSTABLE FEATURES (requires Rust nightly)
4242
# For no_std: Use errors_in_core and net_in_core
4343
unstable = ["idna/unstable"]
4444

url/src/lib.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,25 @@ 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
#![no_std]
125138
#![doc(html_root_url = "https://docs.rs/url/2.4.0")]
126139
#![cfg_attr(
127140
feature = "debugger_visualizer",
128-
feature(debugger_visualizer),
129141
debugger_visualizer(natvis_file = "../../debug_metadata/url.natvis")
130142
)]
131143
#![cfg_attr(

0 commit comments

Comments
 (0)