Skip to content

Commit 38efb2e

Browse files
committed
Auto merge of #42348 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests - Successful merges: #42136, #42275, #42286, #42297, #42302, #42306, #42314, #42324, #42347 - Failed merges:
2 parents e0cc22b + 9bd6dc7 commit 38efb2e

File tree

75 files changed

+660
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+660
-523
lines changed

src/bootstrap/dist.rs

+46
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
914914
t!(fs::create_dir_all(pkg.join("cargo")));
915915
t!(fs::create_dir_all(pkg.join("rust-docs")));
916916
t!(fs::create_dir_all(pkg.join("rust-std")));
917+
t!(fs::create_dir_all(pkg.join("rls")));
918+
t!(fs::create_dir_all(pkg.join("rust-analysis")));
917919

918920
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target)),
919921
&pkg.join("rustc"));
@@ -923,11 +925,17 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
923925
&pkg.join("rust-docs"));
924926
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target)),
925927
&pkg.join("rust-std"));
928+
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target)),
929+
&pkg.join("rls"));
930+
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target)),
931+
&pkg.join("rust-analysis"));
926932

927933
install(&etc.join("pkg/postinstall"), &pkg.join("rustc"), 0o755);
928934
install(&etc.join("pkg/postinstall"), &pkg.join("cargo"), 0o755);
929935
install(&etc.join("pkg/postinstall"), &pkg.join("rust-docs"), 0o755);
930936
install(&etc.join("pkg/postinstall"), &pkg.join("rust-std"), 0o755);
937+
install(&etc.join("pkg/postinstall"), &pkg.join("rls"), 0o755);
938+
install(&etc.join("pkg/postinstall"), &pkg.join("rust-analysis"), 0o755);
931939

932940
let pkgbuild = |component: &str| {
933941
let mut cmd = Command::new("pkgbuild");
@@ -941,6 +949,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
941949
pkgbuild("cargo");
942950
pkgbuild("rust-docs");
943951
pkgbuild("rust-std");
952+
pkgbuild("rls");
953+
pkgbuild("rust-analysis");
944954

945955
// create an 'uninstall' package
946956
install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755);
@@ -964,6 +974,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
964974
let _ = fs::remove_dir_all(&exe);
965975
t!(fs::create_dir_all(exe.join("rustc")));
966976
t!(fs::create_dir_all(exe.join("cargo")));
977+
t!(fs::create_dir_all(exe.join("rls")));
978+
t!(fs::create_dir_all(exe.join("rust-analysis")));
967979
t!(fs::create_dir_all(exe.join("rust-docs")));
968980
t!(fs::create_dir_all(exe.join("rust-std")));
969981
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target))
@@ -978,11 +990,19 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
978990
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target))
979991
.join(format!("rust-std-{}", target)),
980992
&exe.join("rust-std"));
993+
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target))
994+
.join("rls"),
995+
&exe.join("rls"));
996+
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target))
997+
.join(format!("rust-analysis-{}", target)),
998+
&exe.join("rust-analysis"));
981999

9821000
t!(fs::remove_file(exe.join("rustc/manifest.in")));
9831001
t!(fs::remove_file(exe.join("cargo/manifest.in")));
9841002
t!(fs::remove_file(exe.join("rust-docs/manifest.in")));
9851003
t!(fs::remove_file(exe.join("rust-std/manifest.in")));
1004+
t!(fs::remove_file(exe.join("rls/manifest.in")));
1005+
t!(fs::remove_file(exe.join("rust-analysis/manifest.in")));
9861006

9871007
if target.contains("windows-gnu") {
9881008
t!(fs::create_dir_all(exe.join("rust-mingw")));
@@ -1056,6 +1076,26 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
10561076
.arg("-dr").arg("Std")
10571077
.arg("-var").arg("var.StdDir")
10581078
.arg("-out").arg(exe.join("StdGroup.wxs")));
1079+
build.run(Command::new(&heat)
1080+
.current_dir(&exe)
1081+
.arg("dir")
1082+
.arg("rls")
1083+
.args(&heat_flags)
1084+
.arg("-cg").arg("RlsGroup")
1085+
.arg("-dr").arg("Rls")
1086+
.arg("-var").arg("var.RlsDir")
1087+
.arg("-out").arg(exe.join("RlsGroup.wxs"))
1088+
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
1089+
build.run(Command::new(&heat)
1090+
.current_dir(&exe)
1091+
.arg("dir")
1092+
.arg("rust-analysis")
1093+
.args(&heat_flags)
1094+
.arg("-cg").arg("AnalysisGroup")
1095+
.arg("-dr").arg("Analysis")
1096+
.arg("-var").arg("var.AnalysisDir")
1097+
.arg("-out").arg(exe.join("AnalysisGroup.wxs"))
1098+
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
10591099
if target.contains("windows-gnu") {
10601100
build.run(Command::new(&heat)
10611101
.current_dir(&exe)
@@ -1079,6 +1119,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
10791119
.arg("-dDocsDir=rust-docs")
10801120
.arg("-dCargoDir=cargo")
10811121
.arg("-dStdDir=rust-std")
1122+
.arg("-dRlsDir=rls")
1123+
.arg("-dAnalysisDir=rust-analysis")
10821124
.arg("-arch").arg(&arch)
10831125
.arg("-out").arg(&output)
10841126
.arg(&input);
@@ -1096,6 +1138,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
10961138
candle("DocsGroup.wxs".as_ref());
10971139
candle("CargoGroup.wxs".as_ref());
10981140
candle("StdGroup.wxs".as_ref());
1141+
candle("RlsGroup.wxs".as_ref());
1142+
candle("AnalysisGroup.wxs".as_ref());
10991143

11001144
if target.contains("windows-gnu") {
11011145
candle("GccGroup.wxs".as_ref());
@@ -1118,6 +1162,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
11181162
.arg("DocsGroup.wixobj")
11191163
.arg("CargoGroup.wixobj")
11201164
.arg("StdGroup.wixobj")
1165+
.arg("RlsGroup.wixobj")
1166+
.arg("AnalysisGroup.wixobj")
11211167
.current_dir(&exe);
11221168

11231169
if target.contains("windows-gnu") {

src/doc/unstable-book/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
- [toowned_clone_into](library-features/toowned-clone-into.md)
209209
- [trusted_len](library-features/trusted-len.md)
210210
- [try_from](library-features/try-from.md)
211+
- [try_trait](library-features/try-trait.md)
211212
- [unicode](library-features/unicode.md)
212213
- [unique](library-features/unique.md)
213214
- [unsize](library-features/unsize.md)

src/doc/unstable-book/src/library-features/question-mark-carrier.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ The tracking issue for this feature is: [#31436]
55
[#31436]: https://github.com/rust-lang/rust/issues/31436
66

77
------------------------
8+
9+
This feature has been superseded by [`try_trait`][try_trait].
10+
11+
It exists only in stage0 for bootstrapping.
12+
13+
[try_trait]: library-features/try-trait.html
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# `try_trait`
2+
3+
The tracking issue for this feature is: [#42327]
4+
5+
[#42327]: https://github.com/rust-lang/rust/issues/42327
6+
7+
------------------------
8+
9+
This introduces a new trait `Try` for extending the `?` operator to types
10+
other than `Result` (a part of [RFC 1859]). The trait provides the canonical
11+
way to _view_ a type in terms of a success/failure dichotomy. This will
12+
allow `?` to supplant the `try_opt!` macro on `Option` and the `try_ready!`
13+
macro on `Poll`, among other things.
14+
15+
[RFC 1859]: https://github.com/rust-lang/rfcs/pull/1859
16+
17+
Here's an example implementation of the trait:
18+
19+
```rust,ignore
20+
/// A distinct type to represent the `None` value of an `Option`.
21+
///
22+
/// This enables using the `?` operator on `Option`; it's rarely useful alone.
23+
#[derive(Debug)]
24+
#[unstable(feature = "try_trait", issue = "42327")]
25+
pub struct None { _priv: () }
26+
27+
#[unstable(feature = "try_trait", issue = "42327")]
28+
impl<T> ops::Try for Option<T> {
29+
type Ok = T;
30+
type Error = None;
31+
32+
fn into_result(self) -> Result<T, None> {
33+
self.ok_or(None { _priv: () })
34+
}
35+
36+
fn from_ok(v: T) -> Self {
37+
Some(v)
38+
}
39+
40+
fn from_error(_: None) -> Self {
41+
None
42+
}
43+
}
44+
```
45+
46+
Note the `Error` associated type here is a new marker. The `?` operator
47+
allows interconversion between different `Try` implementers only when
48+
the error type can be converted `Into` the error type of the enclosing
49+
function (or catch block). Having a distinct error type (as opposed to
50+
just `()`, or similar) restricts this to where it's semantically meaningful.

src/etc/installer/exe/rust.iss

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Name: gcc; Description: "Linker and platform libraries"; Types: full
4646
Name: docs; Description: "HTML documentation"; Types: full
4747
Name: cargo; Description: "Cargo, the Rust package manager"; Types: full
4848
Name: std; Description: "The Rust Standard Library"; Types: full
49+
Name: rls; Description: "RLS, the Rust Language Server"
4950

5051
[Files]
5152
Source: "rustc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust
@@ -55,6 +56,8 @@ Source: "rust-mingw/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
5556
Source: "rust-docs/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: docs
5657
Source: "cargo/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: cargo
5758
Source: "rust-std/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: std
59+
Source: "rls/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls
60+
Source: "rust-analysis/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls
5861

5962
[Code]
6063
const

src/etc/installer/msi/rust.wxs

+10
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@
170170
<Directory Id="Docs" Name="." />
171171
<Directory Id="Cargo" Name="." />
172172
<Directory Id="Std" Name="." />
173+
<Directory Id="Rls" Name="." />
174+
<Directory Id="Analysis" Name="." />
173175
</Directory>
174176
</Directory>
175177

@@ -273,6 +275,14 @@
273275
<ComponentRef Id="PathEnvPerMachine" />
274276
<ComponentRef Id="PathEnvPerUser" />
275277
</Feature>
278+
<Feature Id="RLS"
279+
Title="RLS, the Rust Language Server"
280+
Display="7"
281+
Level="2"
282+
AllowAdvertise="no">
283+
<ComponentGroupRef Id="RlsGroup" />
284+
<ComponentGroupRef Id="AnalysisGroup" />
285+
</Feature>
276286

277287
<UIRef Id="RustUI" />
278288
</Product>

src/etc/installer/pkg/Distribution.xml

+40-29
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,70 @@
1212
</volume-check>
1313
<choices-outline>
1414
<line choice="install">
15-
<line choice="rustc"/>
16-
<line choice="rust-std"/>
17-
<line choice="cargo"/>
18-
<line choice="rust-docs"/>
15+
<line choice="rustc"/>
16+
<line choice="rust-std"/>
17+
<line choice="cargo"/>
18+
<line choice="rust-docs"/>
19+
<line choice="rls"/>
1920
</line>
2021
<line choice="uninstall" />
2122
</choices-outline>
2223
<!--
23-
These 'selected' scripts ensure that install and uninstall can never be selected at
24-
the same time. Exectly how they work is pretty mysterious, tied to the unspecified algorithm
25-
the installer uses to traverse the options after one is toggled.
24+
These 'selected' scripts ensure that install and uninstall can never be selected at
25+
the same time. Exectly how they work is pretty mysterious, tied to the unspecified algorithm
26+
the installer uses to traverse the options after one is toggled.
2627
-->
2728
<choice id="install" visible="true"
28-
title="Install Rust" description="Install the Rust compiler, package manager and documentation."
29-
customLocation="/usr/local"
30-
selected="!choices.uninstall.selected"
31-
/>
29+
title="Install Rust" description="Install the Rust compiler, package manager and documentation."
30+
customLocation="/usr/local"
31+
selected="!choices.uninstall.selected"
32+
/>
3233
<choice id="uninstall" visible="true"
33-
title="Uninstall Rust" description="Select this option to uninstall an existing Rust installation."
34-
customLocation="/usr/local"
35-
selected="!(choices.install.selected || choices.rustc.selected || choices.cargo.selected || choices['rust-docs'].selected)"
36-
start_selected="false"
37-
>
38-
<pkg-ref id="org.rust-lang.uninstall" />
34+
title="Uninstall Rust" description="Select this option to uninstall an existing Rust installation."
35+
customLocation="/usr/local"
36+
selected="!(choices.install.selected || choices.rustc.selected || choices.cargo.selected || choices['rust-docs'].selected)"
37+
start_selected="false"
38+
>
39+
<pkg-ref id="org.rust-lang.uninstall"/>
3940
</choice>
4041
<choice id="rustc" visible="true"
41-
title="Compiler" description="rustc, the Rust compiler, and rustdoc, the API documentation tool."
42-
selected="(!choices.uninstall.selected &amp;&amp; choices.rustc.selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
43-
>
42+
title="Compiler" description="rustc, the Rust compiler, and rustdoc, the API documentation tool."
43+
selected="(!choices.uninstall.selected &amp;&amp; choices.rustc.selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
44+
>
4445
<pkg-ref id="org.rust-lang.rustc"/>
4546
</choice>
4647
<choice id="cargo" visible="true"
47-
title="Cargo" description="cargo, the Rust package manager."
48-
selected="(!choices.uninstall.selected &amp;&amp; choices.cargo.selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
49-
>
48+
title="Cargo" description="cargo, the Rust package manager."
49+
selected="(!choices.uninstall.selected &amp;&amp; choices.cargo.selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
50+
>
5051
<pkg-ref id="org.rust-lang.cargo"/>
5152
</choice>
5253
<choice id="rust-std" visible="true"
53-
title="Standard Library" description="The Rust standard library."
54-
selected="(!choices.uninstall.selected &amp;&amp; choices['rust-std'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
55-
>
54+
title="Standard Library" description="The Rust standard library."
55+
selected="(!choices.uninstall.selected &amp;&amp; choices['rust-std'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
56+
>
5657
<pkg-ref id="org.rust-lang.rust-std"/>
5758
</choice>
5859
<choice id="rust-docs" visible="true"
59-
title="Documentation" description="HTML documentation."
60-
selected="(!choices.uninstall.selected &amp;&amp; choices['rust-docs'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
61-
>
60+
title="Documentation" description="HTML documentation."
61+
selected="(!choices.uninstall.selected &amp;&amp; choices['rust-docs'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
62+
>
6263
<pkg-ref id="org.rust-lang.rust-docs"/>
6364
</choice>
65+
<choice id="rls" visible="true"
66+
title="RLS" description="RLS, the Rust Language Server"
67+
selected="(!choices.uninstall.selected &amp;&amp; choices['rls'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
68+
start_selected="false"
69+
>
70+
<pkg-ref id="org.rust-lang.rls"/>
71+
<pkg-ref id="org.rust-lang.rust-analysis"/>
72+
</choice>
6473
<pkg-ref id="org.rust-lang.rustc" version="0" onConclusion="none">rustc.pkg</pkg-ref>
6574
<pkg-ref id="org.rust-lang.cargo" version="0" onConclusion="none">cargo.pkg</pkg-ref>
6675
<pkg-ref id="org.rust-lang.rust-docs" version="0" onConclusion="none">rust-docs.pkg</pkg-ref>
6776
<pkg-ref id="org.rust-lang.rust-std" version="0" onConclusion="none">rust-std.pkg</pkg-ref>
77+
<pkg-ref id="org.rust-lang.rls" version="0" onConclusion="none">rls.pkg</pkg-ref>
78+
<pkg-ref id="org.rust-lang.rust-analysis" version="0" onConclusion="none">rust-analysis.pkg</pkg-ref>
6879
<pkg-ref id="org.rust-lang.uninstall" version="0" onConclusion="none">uninstall.pkg</pkg-ref>
6980
<background file="rust-logo.png" mime-type="image/png"
7081
alignment="bottomleft"/>

0 commit comments

Comments
 (0)