Skip to content

Commit 028424a

Browse files
committed
Merge branch 'master' into no_std
2 parents 047d334 + 1158370 commit 028424a

File tree

7 files changed

+1673
-556
lines changed

7 files changed

+1673
-556
lines changed

Diff for: .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

Diff for: 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

Diff for: 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

Diff for: 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(

Diff for: url/tests/expected_failures.txt

+33-17
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
</> against <file://h/C:/a/b>
2-
<file:\\\\//> against <about:blank>
3-
<file:\\\\\\\\> against <about:blank>
4-
<file:\\\\\\\\?fox> against <about:blank>
5-
<file:\\\\\\\\#guppy> against <about:blank>
6-
<file://spider///> against <about:blank>
7-
<file:\\\\localhost//> against <about:blank>
8-
<file://\\/localhost//cat> against <about:blank>
9-
<file://localhost//a//../..//> against <about:blank>
2+
<file:\\\\//>
3+
<file:\\\\\\\\>
4+
<file:\\\\\\\\?fox>
5+
<file:\\\\\\\\#guppy>
6+
<file://spider///>
7+
<file:\\\\localhost//>
8+
<file://\\/localhost//cat>
9+
<file://localhost//a//../..//>
1010
</////mouse> against <file:///elephant>
1111
<\\/localhost//pig> against <file://lion/>
1212
<//localhost//pig> against <file://lion/>
@@ -19,19 +19,35 @@
1919
<C|\n/> against <file://host/dir/file>
2020
<C|\\> against <file://host/dir/file>
2121
</c:/foo/bar> against <file://host/path>
22-
<file://example.net/C:/> against <about:blank>
23-
<file://1.2.3.4/C:/> against <about:blank>
24-
<file://[1::8]/C:/> against <about:blank>
22+
<file://example.net/C:/>
23+
<file://1.2.3.4/C:/>
24+
<file://[1::8]/C:/>
2525
<C|/> against <file://host/>
2626
</C:/> against <file://host/>
2727
<file:C:/> against <file://host/>
2828
<file:/C:/> against <file://host/>
29-
<file://localhost//a//../..//foo> against <about:blank>
30-
<file://localhost////foo> against <about:blank>
31-
<file:////foo> against <about:blank>
29+
<file://localhost//a//../..//foo>
30+
<file://localhost////foo>
31+
<file:////foo>
3232
<file:////one/two> against <file:///>
3333
<////one/two> against <file:///>
3434
<file:///.//> against <file:////>
35-
<file:.//p> against <about:blank>
36-
<file:/.//p> against <about:blank>
37-
<https://x/?#\u{0}y> against <about:blank>
35+
<file:.//p>
36+
<file:/.//p>
37+
<http://example.net/path> set hostname to <example.com:8080>
38+
<http://example.net:8080/path> set hostname to <example.com:>
39+
<non-spec:/.//p> set hostname to <h>
40+
<non-spec:/.//p> set hostname to <>
41+
<foo://somehost/some/path> set pathname to <>
42+
<foo:///some/path> set pathname to <>
43+
<http://example.net:8080/path> set port to <randomstring>
44+
<file:///var/log/system.log> set href to <http://0300.168.0xF0>
45+
<data:space ?query#fragment> set search to <>
46+
<sc:space ?query#fragment> set search to <>
47+
<file://monkey/> set pathname to <\\\\>
48+
<file:///unicorn> set pathname to <//\\/>
49+
<file:///unicorn> set pathname to <//monkey/..//>
50+
<non-spec:/> set pathname to </.//p>
51+
<non-spec:/> set pathname to </..//p>
52+
<non-spec:/> set pathname to <//p>
53+
<non-spec:/.//> set pathname to <p>

0 commit comments

Comments
 (0)