about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-28 07:04:21 +0000
committerbors <bors@rust-lang.org>2022-08-28 07:04:21 +0000
commitd5ef528bebbe0d8e350e547316fdc7d7476614d2 (patch)
tree604e8bd71a239ada8976ac4c54bd54e883bf0970 /src
parent91f128baf7704a477ab7c499143a160fb069b3ad (diff)
parent039c9b267a191170601fff8551a4d25992bbac77 (diff)
downloadrust-d5ef528bebbe0d8e350e547316fdc7d7476614d2.tar.gz
rust-d5ef528bebbe0d8e350e547316fdc7d7476614d2.zip
Auto merge of #100863 - ehuss:sunset-rls, r=Mark-Simulacrum
Sunset RLS

This removes RLS per the plan outlined in https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html. This replaces the `rls` executable with a small program which will display an alert telling the user that RLS is no longer available.

An overview of the changes here:
* Removes the rls submodule and replaces it with a small stub program.
* `rls` is removed from `./x.py install`. I do not think users running `install` will need the stub.
* `rls` is removed from `./x.py test`, it doesn't have any tests.

Other things of note:
* I kept `DIST_REQUIRE_ALL_TOOLS` even though it is no longer needed, with the thought that it could be useful in the feature. However, I could remove it if desired.
* I kept `extra_deps` in `tool_extended` (which allows tools to depend on other things), even though it is no longer needed. This can also be removed if desired.
* ~~This keeps RLS in the macOS `pkg` installer and the Windows `msi` installer. I kinda lean towards removing it from those, but I'm not sure?~~ RLS has been removed from pkg and msi.
* This does not remove the analysis component. It is not clear if we should keep this or not. RLS was the primary user, but I think there are a few users that have made tools around it.
* There will be several followup steps after this PR:
    * Updating the toolstate repo to remove RLS.
    * Updating documentation, such as rustc-dev-guide, to remove references to RLS.

The alert looks like this in VSCode:

<img width="989" alt="image" src="https://user-images.githubusercontent.com/43198/185817530-930c5842-24b5-4162-a213-016a25810955.png">

In Sublime it looks similar.

I would appreciate if others could help test with other editors such as vim or Emacs.
Diffstat (limited to 'src')
-rw-r--r--src/README.md2
-rw-r--r--src/bootstrap/builder.rs2
-rw-r--r--src/bootstrap/check.rs2
-rw-r--r--src/bootstrap/dist.rs41
-rw-r--r--src/bootstrap/install.rs9
-rw-r--r--src/bootstrap/lib.rs3
-rw-r--r--src/bootstrap/tarball.rs8
-rw-r--r--src/bootstrap/test.rs51
-rw-r--r--src/bootstrap/tool.rs9
-rw-r--r--src/bootstrap/toolstate.rs1
-rwxr-xr-xsrc/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh1
-rw-r--r--src/ci/github-actions/ci.yml3
-rw-r--r--src/etc/installer/msi/rust.wxs14
-rw-r--r--src/etc/installer/pkg/Distribution.xml17
-rwxr-xr-xsrc/tools/publish_toolstate.py3
m---------src/tools/rls0
-rw-r--r--src/tools/rls/Cargo.toml13
-rw-r--r--src/tools/rls/README.md6
-rw-r--r--src/tools/rls/src/main.rs101
-rw-r--r--src/tools/rustc-workspace-hack/Cargo.toml11
-rw-r--r--src/tools/rustc-workspace-hack/README.md12
-rw-r--r--src/tools/rustfmt/Processes.md4
-rw-r--r--src/tools/rustfmt/README.md2
-rw-r--r--src/tools/rustfmt/atom.md4
-rw-r--r--src/tools/tidy/src/deps.rs3
25 files changed, 142 insertions, 180 deletions
diff --git a/src/README.md b/src/README.md
index 9752bc3f66d..3d2e6acd576 100644
--- a/src/README.md
+++ b/src/README.md
@@ -2,7 +2,7 @@ This directory contains the source code of the rust project, including:
 
 - The test suite
 - The bootstrapping build system
-- Various submodules for tools, like rustdoc, rls, etc.
+- Various submodules for tools, like cargo, miri, etc.
 
 For more information on how various parts of the compiler work, see the [rustc dev guide].
 
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index c4710e8faec..1e764811ea7 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -650,7 +650,6 @@ impl<'a> Builder<'a> {
                 test::ReplacePlaceholderTest,
                 test::Cargotest,
                 test::Cargo,
-                test::Rls,
                 test::RustAnalyzer,
                 test::ErrorIndex,
                 test::Distcheck,
@@ -737,7 +736,6 @@ impl<'a> Builder<'a> {
                 install::Docs,
                 install::Std,
                 install::Cargo,
-                install::Rls,
                 install::RustAnalyzer,
                 install::Rustfmt,
                 install::RustDemangler,
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 4e1e8ef9dea..5c085bedf0e 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -457,7 +457,7 @@ tool_check_step!(Rustdoc, "src/tools/rustdoc", "src/librustdoc", SourceType::InT
 // rejected.
 tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);
 tool_check_step!(Miri, "src/tools/miri", SourceType::Submodule);
-tool_check_step!(Rls, "src/tools/rls", SourceType::Submodule);
+tool_check_step!(Rls, "src/tools/rls", SourceType::InTree);
 tool_check_step!(Rustfmt, "src/tools/rustfmt", SourceType::InTree);
 
 tool_check_step!(Bootstrap, "src/bootstrap", SourceType::InTree, false);
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 6bf57a89e89..c01afa1fd3b 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -1018,10 +1018,7 @@ impl Step for Rls {
 
         let rls = builder
             .ensure(tool::Rls { compiler, target, extra_features: Vec::new() })
-            .or_else(|| {
-                missing_tool("RLS", builder.build.config.missing_tools);
-                None
-            })?;
+            .expect("rls expected to build");
 
         let mut tarball = Tarball::new(builder, "rls", &target.triple);
         tarball.set_overlay(OverlayKind::RLS);
@@ -1412,7 +1409,7 @@ impl Step for Extended {
 
         let xform = |p: &Path| {
             let mut contents = t!(fs::read_to_string(p));
-            for tool in &["rust-demangler", "rls", "rust-analyzer", "miri", "rustfmt"] {
+            for tool in &["rust-demangler", "rust-analyzer", "miri", "rustfmt"] {
                 if !built_tools.contains(tool) {
                     contents = filter(&contents, tool);
                 }
@@ -1452,7 +1449,7 @@ impl Step for Extended {
             prepare("rust-std");
             prepare("rust-analysis");
             prepare("clippy");
-            for tool in &["rust-docs", "rust-demangler", "rls", "rust-analyzer", "miri"] {
+            for tool in &["rust-docs", "rust-demangler", "rust-analyzer", "miri"] {
                 if built_tools.contains(tool) {
                     prepare(tool);
                 }
@@ -1488,8 +1485,6 @@ impl Step for Extended {
                 builder.create_dir(&exe.join(name));
                 let dir = if name == "rust-std" || name == "rust-analysis" {
                     format!("{}-{}", name, target.triple)
-                } else if name == "rls" {
-                    "rls-preview".to_string()
                 } else if name == "rust-analyzer" {
                     "rust-analyzer-preview".to_string()
                 } else if name == "clippy" {
@@ -1513,7 +1508,7 @@ impl Step for Extended {
             prepare("rust-docs");
             prepare("rust-std");
             prepare("clippy");
-            for tool in &["rust-demangler", "rls", "rust-analyzer", "miri"] {
+            for tool in &["rust-demangler", "rust-analyzer", "miri"] {
                 if built_tools.contains(tool) {
                     prepare(tool);
                 }
@@ -1597,25 +1592,6 @@ impl Step for Extended {
                     .arg("-out")
                     .arg(exe.join("StdGroup.wxs")),
             );
-            if built_tools.contains("rls") {
-                builder.run(
-                    Command::new(&heat)
-                        .current_dir(&exe)
-                        .arg("dir")
-                        .arg("rls")
-                        .args(&heat_flags)
-                        .arg("-cg")
-                        .arg("RlsGroup")
-                        .arg("-dr")
-                        .arg("Rls")
-                        .arg("-var")
-                        .arg("var.RlsDir")
-                        .arg("-out")
-                        .arg(exe.join("RlsGroup.wxs"))
-                        .arg("-t")
-                        .arg(etc.join("msi/remove-duplicates.xsl")),
-                );
-            }
             if built_tools.contains("rust-analyzer") {
                 builder.run(
                     Command::new(&heat)
@@ -1747,9 +1723,6 @@ impl Step for Extended {
                 if built_tools.contains("rust-demangler") {
                     cmd.arg("-dRustDemanglerDir=rust-demangler");
                 }
-                if built_tools.contains("rls") {
-                    cmd.arg("-dRlsDir=rls");
-                }
                 if built_tools.contains("rust-analyzer") {
                     cmd.arg("-dRustAnalyzerDir=rust-analyzer");
                 }
@@ -1772,9 +1745,6 @@ impl Step for Extended {
             if built_tools.contains("rust-demangler") {
                 candle("RustDemanglerGroup.wxs".as_ref());
             }
-            if built_tools.contains("rls") {
-                candle("RlsGroup.wxs".as_ref());
-            }
             if built_tools.contains("rust-analyzer") {
                 candle("RustAnalyzerGroup.wxs".as_ref());
             }
@@ -1812,9 +1782,6 @@ impl Step for Extended {
                 .arg("ClippyGroup.wixobj")
                 .current_dir(&exe);
 
-            if built_tools.contains("rls") {
-                cmd.arg("RlsGroup.wixobj");
-            }
             if built_tools.contains("rust-analyzer") {
                 cmd.arg("RustAnalyzerGroup.wixobj");
             }
diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs
index 6e49f39ffb6..d34aa15c515 100644
--- a/src/bootstrap/install.rs
+++ b/src/bootstrap/install.rs
@@ -182,15 +182,6 @@ install!((self, builder, _config),
             .expect("missing cargo");
         install_sh(builder, "cargo", self.compiler.stage, Some(self.target), &tarball);
     };
-    Rls, alias = "rls", Self::should_build(_config), only_hosts: true, {
-        if let Some(tarball) = builder.ensure(dist::Rls { compiler: self.compiler, target: self.target }) {
-            install_sh(builder, "rls", self.compiler.stage, Some(self.target), &tarball);
-        } else {
-            builder.info(
-                &format!("skipping Install RLS stage{} ({})", self.compiler.stage, self.target),
-            );
-        }
-    };
     RustAnalyzer, alias = "rust-analyzer", Self::should_build(_config), only_hosts: true, {
         if let Some(tarball) =
             builder.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target })
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index dcfa92d1004..30ea1c20b31 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -273,7 +273,6 @@ pub struct Build {
     bootstrap_out: PathBuf,
     rust_info: channel::GitInfo,
     cargo_info: channel::GitInfo,
-    rls_info: channel::GitInfo,
     rust_analyzer_info: channel::GitInfo,
     clippy_info: channel::GitInfo,
     miri_info: channel::GitInfo,
@@ -407,7 +406,6 @@ impl Build {
         let ignore_git = config.ignore_git;
         let rust_info = channel::GitInfo::new(ignore_git, &src);
         let cargo_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/cargo"));
-        let rls_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/rls"));
         let rust_analyzer_info =
             channel::GitInfo::new(ignore_git, &src.join("src/tools/rust-analyzer"));
         let clippy_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/clippy"));
@@ -485,7 +483,6 @@ impl Build {
 
             rust_info,
             cargo_info,
-            rls_info,
             rust_analyzer_info,
             clippy_info,
             miri_info,
diff --git a/src/bootstrap/tarball.rs b/src/bootstrap/tarball.rs
index 7b0c029c191..e30067a5cbe 100644
--- a/src/bootstrap/tarball.rs
+++ b/src/bootstrap/tarball.rs
@@ -50,11 +50,7 @@ impl OverlayKind {
             OverlayKind::RustDemangler => {
                 &["src/tools/rust-demangler/README.md", "LICENSE-APACHE", "LICENSE-MIT"]
             }
-            OverlayKind::RLS => &[
-                "src/tools/rls/README.md",
-                "src/tools/rls/LICENSE-APACHE",
-                "src/tools/rls/LICENSE-MIT",
-            ],
+            OverlayKind::RLS => &["src/tools/rls/README.md", "LICENSE-APACHE", "LICENSE-MIT"],
             OverlayKind::RustAnalyzer => &[
                 "src/tools/rust-analyzer/README.md",
                 "src/tools/rust-analyzer/LICENSE-APACHE",
@@ -78,7 +74,7 @@ impl OverlayKind {
             OverlayKind::Rustfmt => {
                 builder.rustfmt_info.version(builder, &builder.release_num("rustfmt"))
             }
-            OverlayKind::RLS => builder.rls_info.version(builder, &builder.release_num("rls")),
+            OverlayKind::RLS => builder.release(&builder.release_num("rls")),
             OverlayKind::RustAnalyzer => builder
                 .rust_analyzer_info
                 .version(builder, &builder.release_num("rust-analyzer/crates/rust-analyzer")),
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 9cbdb3aca32..f1c2a21de59 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -300,57 +300,6 @@ impl Step for Cargo {
 }
 
 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub struct Rls {
-    stage: u32,
-    host: TargetSelection,
-}
-
-impl Step for Rls {
-    type Output = ();
-    const ONLY_HOSTS: bool = true;
-
-    fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-        run.path("src/tools/rls")
-    }
-
-    fn make_run(run: RunConfig<'_>) {
-        run.builder.ensure(Rls { stage: run.builder.top_stage, host: run.target });
-    }
-
-    /// Runs `cargo test` for the rls.
-    fn run(self, builder: &Builder<'_>) {
-        let stage = self.stage;
-        let host = self.host;
-        let compiler = builder.compiler(stage, host);
-
-        let build_result =
-            builder.ensure(tool::Rls { compiler, target: self.host, extra_features: Vec::new() });
-        if build_result.is_none() {
-            eprintln!("failed to test rls: could not build");
-            return;
-        }
-
-        let mut cargo = tool::prepare_tool_cargo(
-            builder,
-            compiler,
-            Mode::ToolRustc,
-            host,
-            "test",
-            "src/tools/rls",
-            SourceType::Submodule,
-            &[],
-        );
-
-        cargo.add_rustc_lib_path(builder, compiler);
-        cargo.arg("--").args(builder.config.cmd.test_args());
-
-        if try_run(builder, &mut cargo.into()) {
-            builder.save_toolstate("rls", ToolState::TestPass);
-        }
-    }
-}
-
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
 pub struct RustAnalyzer {
     stage: u32,
     host: TargetSelection,
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index 5bb40014eb9..c3b04a9bbce 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -857,14 +857,7 @@ tool_extended!((self, builder),
     Clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {};
     Miri, "src/tools/miri", "miri", stable=false, {};
     CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {};
-    Rls, "src/tools/rls", "rls", stable=true, {
-        builder.ensure(Clippy {
-            compiler: self.compiler,
-            target: self.target,
-            extra_features: Vec::new(),
-        });
-        self.extra_features.push("clippy".to_owned());
-    };
+    Rls, "src/tools/rls", "rls", stable=true, {};
     // FIXME: tool_std is not quite right, we shouldn't allow nightly features.
     // But `builder.cargo` doesn't know how to handle ToolBootstrap in stages other than 0,
     // and this is close enough for now.
diff --git a/src/bootstrap/toolstate.rs b/src/bootstrap/toolstate.rs
index 2cfeae7dc78..f3a6759ab84 100644
--- a/src/bootstrap/toolstate.rs
+++ b/src/bootstrap/toolstate.rs
@@ -69,7 +69,6 @@ static STABLE_TOOLS: &[(&str, &str)] = &[
     ("reference", "src/doc/reference"),
     ("rust-by-example", "src/doc/rust-by-example"),
     ("edition-guide", "src/doc/edition-guide"),
-    ("rls", "src/tools/rls"),
 ];
 
 // These tools are permitted to not build on the beta/stable channels.
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh
index 412efe5c448..0fb8f41a7ec 100755
--- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh
@@ -14,7 +14,6 @@ python3 "$X_PY" test --stage 2 --no-fail-fast \
     src/doc/rust-by-example \
     src/doc/embedded-book \
     src/doc/edition-guide \
-    src/tools/rls \
     src/tools/miri \
 
 set -e
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index a6bdd9f3186..6e4b0b0c2c3 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -676,8 +676,7 @@ jobs:
                 --enable-full-tools
                 --enable-profiler
               SCRIPT: python x.py dist
-              # RLS does not build for aarch64-pc-windows-msvc. See rust-lang/rls#1693
-              DIST_REQUIRE_ALL_TOOLS: 0
+              DIST_REQUIRE_ALL_TOOLS: 1
               # Hack around this SDK version, because it doesn't work with clang.
               # See https://github.com/rust-lang/rust/issues/88796
               WINDOWS_SDK_20348_HACK: 1
diff --git a/src/etc/installer/msi/rust.wxs b/src/etc/installer/msi/rust.wxs
index a182bc4067a..0aa0784e544 100644
--- a/src/etc/installer/msi/rust.wxs
+++ b/src/etc/installer/msi/rust.wxs
@@ -170,10 +170,6 @@
                     <Directory Id="Docs" Name="." />
                     <Directory Id="Cargo" Name="." />
                     <Directory Id="Std" Name="." />
-                    <!-- tool-rls-start -->
-                    <Directory Id="Rls" Name="." />
-                    <Directory Id="Analysis" Name="." />
-                    <!-- tool-rls-end -->
                 </Directory>
             </Directory>
 
@@ -277,16 +273,6 @@
                  <ComponentRef Id="PathEnvPerMachine" />
                  <ComponentRef Id="PathEnvPerUser" />
         </Feature>
-        <!-- tool-rls-start -->
-        <Feature Id="RLS"
-                 Title="RLS, the Rust Language Server"
-                 Display="7"
-                 Level="2"
-                 AllowAdvertise="no">
-                 <ComponentGroupRef Id="RlsGroup" />
-                 <ComponentGroupRef Id="AnalysisGroup" />
-        </Feature>
-        <!-- tool-rls-end -->
 
         <UIRef Id="RustUI" />
     </Product>
diff --git a/src/etc/installer/pkg/Distribution.xml b/src/etc/installer/pkg/Distribution.xml
index 077ee175116..64f6bab9bb5 100644
--- a/src/etc/installer/pkg/Distribution.xml
+++ b/src/etc/installer/pkg/Distribution.xml
@@ -16,9 +16,6 @@
       <line choice="rust-std"/>
       <line choice="cargo"/>
       <line choice="rust-docs"/>
-      <!-- tool-rls-start -->
-      <line choice="rls"/>
-      <!-- tool-rls-end -->
       </line>
       <line choice="uninstall" />
     </choices-outline>
@@ -64,24 +61,10 @@
         >
         <pkg-ref id="org.rust-lang.rust-docs"/>
     </choice>
-    <!-- tool-rls-start -->
-    <choice id="rls" visible="true"
-        title="RLS" description="RLS, the Rust Language Server"
-        selected="(!choices.uninstall.selected &amp;&amp; choices['rls'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
-        start_selected="false"
-        >
-        <pkg-ref id="org.rust-lang.rls"/>
-        <pkg-ref id="org.rust-lang.rust-analysis"/>
-    </choice>
-    <!-- tool-rls-end -->
     <pkg-ref id="org.rust-lang.rustc" version="0" onConclusion="none">rustc.pkg</pkg-ref>
     <pkg-ref id="org.rust-lang.cargo" version="0" onConclusion="none">cargo.pkg</pkg-ref>
     <pkg-ref id="org.rust-lang.rust-docs" version="0" onConclusion="none">rust-docs.pkg</pkg-ref>
     <pkg-ref id="org.rust-lang.rust-std" version="0" onConclusion="none">rust-std.pkg</pkg-ref>
-    <!-- tool-rls-start -->
-    <pkg-ref id="org.rust-lang.rls" version="0" onConclusion="none">rls.pkg</pkg-ref>
-    <!-- tool-rls-end -->
-    <pkg-ref id="org.rust-lang.rust-analysis" version="0" onConclusion="none">rust-analysis.pkg</pkg-ref>
     <pkg-ref id="org.rust-lang.uninstall" version="0" onConclusion="none">uninstall.pkg</pkg-ref>
     <background file="rust-logo.png" mime-type="image/png"
                 alignment="bottomleft"/>
diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py
index 1c57b731aaa..c0cef8f7b0a 100755
--- a/src/tools/publish_toolstate.py
+++ b/src/tools/publish_toolstate.py
@@ -31,7 +31,6 @@ except ImportError:
 # read privileges on it). CI will fail otherwise.
 MAINTAINERS = {
     'miri': {'oli-obk', 'RalfJung'},
-    'rls': {'Xanewok'},
     'book': {'carols10cents'},
     'nomicon': {'frewsxcv', 'Gankra', 'JohnTitor'},
     'reference': {'Havvy', 'matthewjasper', 'ehuss'},
@@ -43,7 +42,6 @@ MAINTAINERS = {
 
 LABELS = {
     'miri': ['A-miri', 'C-bug'],
-    'rls': ['A-rls', 'C-bug'],
     'book': ['C-bug'],
     'nomicon': ['C-bug'],
     'reference': ['C-bug'],
@@ -55,7 +53,6 @@ LABELS = {
 
 REPOS = {
     'miri': 'https://github.com/rust-lang/miri',
-    'rls': 'https://github.com/rust-lang/rls',
     'book': 'https://github.com/rust-lang/book',
     'nomicon': 'https://github.com/rust-lang/nomicon',
     'reference': 'https://github.com/rust-lang/reference',
diff --git a/src/tools/rls b/src/tools/rls
deleted file mode 160000
-Subproject 4d8b0a19986a4daab37287a5b5fe2da0775d187
diff --git a/src/tools/rls/Cargo.toml b/src/tools/rls/Cargo.toml
new file mode 100644
index 00000000000..92b50bf4cec
--- /dev/null
+++ b/src/tools/rls/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+name = "rls"
+version = "2.0.0"
+edition = "2021"
+license = "Apache-2.0/MIT"
+
+[dependencies]
+serde = { version = "1.0.143", features = ["derive"] }
+serde_json = "1.0.83"
+# A noop dependency that changes in the Rust repository, it's a bit of a hack.
+# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
+# for more information.
+rustc-workspace-hack = "1.0.0"
diff --git a/src/tools/rls/README.md b/src/tools/rls/README.md
new file mode 100644
index 00000000000..43c331c413f
--- /dev/null
+++ b/src/tools/rls/README.md
@@ -0,0 +1,6 @@
+# RLS Stub
+
+RLS has been replaced with [rust-analyzer](https://rust-analyzer.github.io/).
+
+This directory contains a stub which replaces RLS with a simple LSP server
+which only displays an alert to the user that RLS is no longer available.
diff --git a/src/tools/rls/src/main.rs b/src/tools/rls/src/main.rs
new file mode 100644
index 00000000000..f96f1325d96
--- /dev/null
+++ b/src/tools/rls/src/main.rs
@@ -0,0 +1,101 @@
+//! RLS stub.
+//!
+//! This is a small stub that replaces RLS to alert the user that RLS is no
+//! longer available.
+
+use serde::Deserialize;
+use std::error::Error;
+use std::io::BufRead;
+use std::io::Write;
+
+const ALERT_MSG: &str = "\
+RLS is no longer available as of Rust 1.65.
+Consider migrating to rust-analyzer instead.
+See https://rust-analyzer.github.io/ for installation instructions.
+";
+
+fn main() {
+    if let Err(e) = run() {
+        eprintln!("error: {e}");
+        std::process::exit(1);
+    }
+}
+
+#[derive(Deserialize)]
+struct Message {
+    method: Option<String>,
+}
+
+fn run() -> Result<(), Box<dyn Error>> {
+    let mut stdin = std::io::stdin().lock();
+    let mut stdout = std::io::stdout().lock();
+
+    let init = read_message(&mut stdin)?;
+    if init.method.as_deref() != Some("initialize") {
+        return Err(format!("expected initialize, got {:?}", init.method).into());
+    }
+    // No response, the LSP specification says that `showMessageRequest` may
+    // be posted before during this phase.
+
+    // message_type 1 is "Error"
+    let alert = serde_json::json!({
+        "jsonrpc": "2.0",
+        "id": 1,
+        "method": "window/showMessageRequest",
+        "params": {
+            "message_type": "1",
+            "message": ALERT_MSG
+        }
+    });
+    write_message_raw(&mut stdout, serde_json::to_string(&alert).unwrap())?;
+
+    loop {
+        let message = read_message(&mut stdin)?;
+        if message.method.as_deref() == Some("shutdown") {
+            std::process::exit(0);
+        }
+    }
+}
+
+fn read_message_raw<R: BufRead>(reader: &mut R) -> Result<String, Box<dyn Error>> {
+    let mut content_length: usize = 0;
+
+    // Read headers.
+    loop {
+        let mut line = String::new();
+        reader.read_line(&mut line)?;
+        if line.is_empty() {
+            return Err("remote disconnected".into());
+        }
+        if line == "\r\n" {
+            break;
+        }
+        if line.to_lowercase().starts_with("content-length:") {
+            let value = &line[15..].trim();
+            content_length = usize::from_str_radix(value, 10)?;
+        }
+    }
+    if content_length == 0 {
+        return Err("no content-length".into());
+    }
+
+    let mut buffer = vec![0; content_length];
+    reader.read_exact(&mut buffer)?;
+    let content = String::from_utf8(buffer)?;
+
+    Ok(content)
+}
+
+fn read_message<R: BufRead>(reader: &mut R) -> Result<Message, Box<dyn Error>> {
+    let m = read_message_raw(reader)?;
+    match serde_json::from_str(&m) {
+        Ok(m) => Ok(m),
+        Err(e) => Err(format!("failed to parse message {m}\n{e}").into()),
+    }
+}
+
+fn write_message_raw<W: Write>(mut writer: W, output: String) -> Result<(), Box<dyn Error>> {
+    write!(writer, "Content-Length: {}\r\n\r\n{}", output.len(), output)?;
+    writer.flush()?;
+    Ok(())
+}
diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml
index b1d8b86496a..3c982b26127 100644
--- a/src/tools/rustc-workspace-hack/Cargo.toml
+++ b/src/tools/rustc-workspace-hack/Cargo.toml
@@ -24,6 +24,7 @@ features = [
   "errhandlingapi",
   "evntrace",
   "fibersapi",
+  "handleapi",
   "in6addr",
   "inaddr",
   "ioapiset",
@@ -72,11 +73,8 @@ features = [
 
 [dependencies]
 bstr = { version = "0.2.17", features = ["default"] }
-byteorder = { version = "1", features = ['default', 'std'] }
 clap = { version = "3.1.1", features = ["derive", "clap_derive"]}
 curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
-crossbeam-utils = { version = "0.8.0", features = ["nightly"] }
-libc = { version = "0.2.79", features = ["align"] }
 # Ensure default features of libz-sys, which are disabled in some scenarios.
 libz-sys = { version = "1.1.2" }
 # The only user of memchr's deprecated `use_std` feature is `combine`, so this can be
@@ -84,13 +82,8 @@ libz-sys = { version = "1.1.2" }
 memchr = { version = "2.5", features = ["std", "use_std"] }
 # Ensure default features of regex, which are disabled in some scenarios.
 regex = { version = "1.5.6" }
-proc-macro2 = { version = "1", features = ["default"] }
-quote = { version = "1", features = ["default"] }
-rand_core_0_5 = { package = "rand_core", version = "0.5.1", features = ["getrandom", "alloc", "std"] }
-serde = { version = "1.0.82", features = ['derive'] }
 serde_json = { version = "1.0.31", features = ["raw_value", "unbounded_depth"] }
-smallvec = { version = "1.8.1", features = ['union', 'may_dangle'] }
-syn = { version = "1", features = ['fold', 'full', 'extra-traits', 'visit', 'visit-mut'] }
+syn = { version = "1", features = ['full', 'visit'] }
 url = { version = "2.0", features = ['serde'] }
 
 [target.'cfg(not(windows))'.dependencies]
diff --git a/src/tools/rustc-workspace-hack/README.md b/src/tools/rustc-workspace-hack/README.md
index 4a5286fae9c..3c61470358b 100644
--- a/src/tools/rustc-workspace-hack/README.md
+++ b/src/tools/rustc-workspace-hack/README.md
@@ -2,18 +2,18 @@
 
 This crate is a bit of a hack to make workspaces in rustc work a bit better.
 The rationale for this existence is a bit subtle, but the general idea is that
-we want commands like `./x.py build src/tools/{rls,clippy,cargo}` to share as
+we want commands like `./x.py build src/tools/{clippy,cargo}` to share as
 many dependencies as possible.
 
 Each invocation is a different invocation of Cargo, however. Each time Cargo
 runs a build it will re-resolve the dependency graph, notably selecting
 different features sometimes for each build.
 
-For example, let's say there's a very deep dependency like `num-traits` in each
-of these builds. For Cargo the `num-traits`'s `default` feature is turned off.
-In RLS, however, the `default` feature is turned. This means that building Cargo
-and then the RLS will actually build Cargo twice (as a transitive dependency
-changed). This is bad!
+For example, let's say there's a very deep dependency like `winapi` in each of
+these builds. For Cargo, `winapi` has 33 features enabled. In Clippy, however,
+`winapi` has 22 features enabled. This means that building Cargo and then the
+Clippy will actually build winapi twice, which in turn will build duplicates
+of everything that depends on `winapi`. This is bad!
 
 The goal of this crate is to solve this problem and ensure that the resolved
 dependency graph for all of these tools is the same in the various subsets of
diff --git a/src/tools/rustfmt/Processes.md b/src/tools/rustfmt/Processes.md
index 9d86d52b122..f763b5714ce 100644
--- a/src/tools/rustfmt/Processes.md
+++ b/src/tools/rustfmt/Processes.md
@@ -51,7 +51,3 @@ git tag -s v1.2.3 -m "Release 1.2.3"
 `cargo publish`
 
 ## 5. Create a PR to rust-lang/rust to update the rustfmt submodule
-
-Note that if you are updating `rustc-ap-*` crates, then you need to update **every** submodules in the rust-lang/rust repository that depend on the crates to use the same version of those.
-
-As of 2019/05, there are two such crates: `rls` and `racer` (`racer` depends on `rustc-ap-syntax` and `rls` depends on `racer`, and `rls` is one of submodules of the rust-lang/rust repository).
diff --git a/src/tools/rustfmt/README.md b/src/tools/rustfmt/README.md
index b3a968f0c04..0f9652aecf9 100644
--- a/src/tools/rustfmt/README.md
+++ b/src/tools/rustfmt/README.md
@@ -135,7 +135,7 @@ completed without error (whether or not changes were made).
 * [Emacs](https://github.com/rust-lang/rust-mode)
 * [Sublime Text 3](https://packagecontrol.io/packages/RustFmt)
 * [Atom](atom.md)
-* Visual Studio Code using [vscode-rust](https://github.com/editor-rs/vscode-rust), [vsc-rustfmt](https://github.com/Connorcpu/vsc-rustfmt) or [rls_vscode](https://github.com/jonathandturner/rls_vscode) through RLS.
+* [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
 * [IntelliJ or CLion](intellij.md)
 
 
diff --git a/src/tools/rustfmt/atom.md b/src/tools/rustfmt/atom.md
index f77ac149072..c7e3a991a5f 100644
--- a/src/tools/rustfmt/atom.md
+++ b/src/tools/rustfmt/atom.md
@@ -1,8 +1,8 @@
 # Running Rustfmt from Atom
 
-## RLS
+## rust-analyzer
 
-Rustfmt is included with the Rust Language Server, itself provided by [ide-rust](https://atom.io/packages/ide-rust).
+Rustfmt can be utilized from [rust-analyzer](https://rust-analyzer.github.io/) which is provided by [ide-rust](https://atom.io/packages/ide-rust).
 
 `apm install ide-rust`
 
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index 7f8d6ad1288..5770bb7bc33 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -31,8 +31,7 @@ const EXCEPTIONS: &[(&str, &str)] = &[
     ("mdbook", "MPL-2.0"),            // mdbook
     ("openssl", "Apache-2.0"),        // cargo, mdbook
     ("colored", "MPL-2.0"),           // rustfmt
-    ("ordslice", "Apache-2.0"),       // rls
-    ("ryu", "Apache-2.0 OR BSL-1.0"), // rls/cargo/... (because of serde)
+    ("ryu", "Apache-2.0 OR BSL-1.0"), // cargo/... (because of serde)
     ("bytesize", "Apache-2.0"),       // cargo
     ("im-rc", "MPL-2.0+"),            // cargo
     ("sized-chunks", "MPL-2.0+"),     // cargo via im-rc