diff --git a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs index 534675f1dc042..7aa099433a76d 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs @@ -514,12 +514,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { span: *span, ty_err: match output_ty.kind() { ty::Closure(_, _) => FnMutReturnTypeErr::ReturnClosure { span: *span }, - ty::Generator(def, ..) - if matches!( - self.infcx.tcx.generator_kind(def), - Some(hir::GeneratorKind::Async(_)) - ) => - { + ty::Generator(def, ..) if self.infcx.tcx.generator_is_async(*def) => { FnMutReturnTypeErr::ReturnAsyncBlock { span: *span } } _ => FnMutReturnTypeErr::ReturnRef { span: *span }, diff --git a/compiler/rustc_data_structures/src/sorted_map.rs b/compiler/rustc_data_structures/src/sorted_map.rs index fe257e10205fa..d607a5c8314e1 100644 --- a/compiler/rustc_data_structures/src/sorted_map.rs +++ b/compiler/rustc_data_structures/src/sorted_map.rs @@ -10,8 +10,8 @@ mod index_map; pub use index_map::SortedIndexMultiMap; /// `SortedMap` is a data structure with similar characteristics as BTreeMap but -/// slightly different trade-offs: lookup, insertion, and removal are *O*(log(*n*)) -/// and elements can be iterated in order cheaply. +/// slightly different trade-offs: lookup is *O*(log(*n*)), insertion and removal +/// are *O*(*n*) but elements can be iterated in order cheaply. /// /// `SortedMap` can be faster than a `BTreeMap` for small sizes (<50) since it /// stores data in a more compact way. It also supports accessing contiguous diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index 43864ed45fae2..88ad4c67d93e4 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -322,10 +322,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { ty::Closure(..) => Some(MustUsePath::Closure(span)), ty::Generator(def_id, ..) => { // async fn should be treated as "implementor of `Future`" - let must_use = if matches!( - cx.tcx.generator_kind(def_id), - Some(hir::GeneratorKind::Async(..)) - ) { + let must_use = if cx.tcx.generator_is_async(def_id) { let def_id = cx.tcx.lang_items().future_trait().unwrap(); is_def_must_use(cx, def_id, span) .map(|inner| MustUsePath::Opaque(Box::new(inner))) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 297433d37c4f3..e802c71c64b8c 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1361,6 +1361,11 @@ impl<'tcx> TyCtxt<'tcx> { self.diagnostic_items(did.krate).name_to_id.get(&name) == Some(&did) } + /// Returns `true` if the node pointed to by `def_id` is a generator for an async construct. + pub fn generator_is_async(self, def_id: DefId) -> bool { + matches!(self.generator_kind(def_id), Some(hir::GeneratorKind::Async(_))) + } + pub fn stability(self) -> &'tcx stability::Index { self.stability_index(()) } diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 5b9513ebc0da4..df59a350ea7c9 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -282,7 +282,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { "you may want to use a bool value instead", format!("{}", item_typo), )) - // FIXME(vicnenzopalazzo): make the check smarter, + // FIXME(vincenzopalazzo): make the check smarter, // and maybe expand with levenshtein distance checks } else if item_str.as_str() == "printf" { Some(( diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index e96b9b64e7874..b364609d986ed 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -2544,10 +2544,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> { let obligation = Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred); - // We don't use `InferCtxt::predicate_may_hold` because that - // will re-run predicates that overflow locally, which ends up - // taking a really long time to compute. - self.evaluate_obligation(&obligation).map_or(false, |eval| eval.may_apply()) + self.predicate_may_hold(&obligation) }) } diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 992ea1755163f..09f30f976de91 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -1336,8 +1336,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { obligation.param_env, trait_pred_and_suggested_ty, ); - let suggested_ty_would_satisfy_obligation = - self.predicate_must_hold_modulo_regions(&new_obligation); + let suggested_ty_would_satisfy_obligation = self + .evaluate_obligation_no_overflow(&new_obligation) + .must_apply_modulo_regions(); if suggested_ty_would_satisfy_obligation { let sp = self .tcx @@ -1988,11 +1989,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { .as_local() .and_then(|def_id| hir.maybe_body_owned_by(def_id)) .map(|body_id| hir.body(body_id)); - let is_async = self - .tcx - .generator_kind(generator_did) - .map(|generator_kind| matches!(generator_kind, hir::GeneratorKind::Async(..))) - .unwrap_or(false); let mut visitor = AwaitsVisitor::default(); if let Some(body) = generator_body { visitor.visit_body(body); @@ -2069,6 +2065,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { debug!(?interior_or_upvar_span); if let Some(interior_or_upvar_span) = interior_or_upvar_span { + let is_async = self.tcx.generator_is_async(generator_did); let typeck_results = match generator_data { GeneratorData::Local(typeck_results) => Some(typeck_results), GeneratorData::Foreign(_) => None, @@ -2641,10 +2638,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { if is_future && obligated_types.last().map_or(false, |ty| match ty.kind() { ty::Generator(last_def_id, ..) => { - matches!( - tcx.generator_kind(last_def_id), - Some(GeneratorKind::Async(..)) - ) + tcx.generator_is_async(*last_def_id) } _ => false, }) diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 10854ede652b5..627ed4674b0e9 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -430,9 +430,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ) { let self_ty = obligation.self_ty().skip_binder(); if let ty::Generator(did, ..) = self_ty.kind() { - if let Some(rustc_hir::GeneratorKind::Async(_generator_kind)) = - self.tcx().generator_kind(did) - { + if self.tcx().generator_is_async(*did) { debug!(?self_ty, ?obligation, "assemble_future_candidates",); candidates.vec.push(FutureCandidate); diff --git a/src/ci/docker/scripts/fuchsia-test-runner.py b/src/ci/docker/scripts/fuchsia-test-runner.py old mode 100644 new mode 100755 diff --git a/src/doc/rustc/src/platform-support/fuchsia.md b/src/doc/rustc/src/platform-support/fuchsia.md index 5de29b35e6b2c..fbf999f97151b 100644 --- a/src/doc/rustc/src/platform-support/fuchsia.md +++ b/src/doc/rustc/src/platform-support/fuchsia.md @@ -189,17 +189,45 @@ Fuchsia as well. A recent version (14+) of clang should be sufficient to compile Rust for Fuchsia. x86-64 and AArch64 Fuchsia targets can be enabled using the following -configuration. - -In `config.toml`, add: +configuration in `config.toml`: ```toml [build] target = ["", "aarch64-fuchsia", "x86_64-fuchsia"] + +[rust] +lld = true + +[target.x86_64-fuchsia] +cc = "clang" +cxx = "clang++" + +[target.aarch64-fuchsia] +cc = "clang" +cxx = "clang++" +``` + +Though not strictly required, you may also want to use `clang` for your host +target as well: + +```toml +[target.] +cc = "clang" +cxx = "clang++" +``` + +By default, the Rust compiler installs itself to `/usr/local` on most UNIX +systems. You may want to install it to another location (e.g. a local `install` +directory) by setting a custom prefix in `config.toml`: + +```toml +[install] +# Make sure to use the absolute path to your install directory +prefix = "/install" ``` -Additionally, the following environment variables must be configured (for -example, using a script like `config-env.sh`): +Next, the following environment variables must be configured. For example, using +a script we name `config-env.sh`: ```sh # Configure this environment variable to be the path to the downloaded SDK @@ -215,8 +243,11 @@ export LDFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arc export CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/x64/sysroot -Lnative=${SDK_PATH}/arch/x64/sysroot/lib -Lnative=${SDK_PATH}/arch/x64/lib" ``` -These can be run together in a shell environment by executing -`(source config-env.sh && ./x.py install)`. +Finally, the Rust compiler can be built and installed: + +```sh +(source config-env.sh && ./x.py install) +``` Once `rustc` is installed, we can create a new working directory to work from, `hello_fuchsia` along with `hello_fuchsia/src`: @@ -641,31 +672,38 @@ available on the [Fuchsia devsite]. ### Running the compiler test suite -Pre-requisites for running the Rust test suite on Fuchsia are: -1. Checkout of Rust source. -1. Setup of `config-env.sh` and `config.toml` from "[Targeting Fuchsia with a compiler built from source](#targeting-fuchsia-with-a-compiler-built-from-source)". -1. Download of the Fuchsia SDK. Minimum supported SDK version is [9.20220726.1.1](https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core/linux-amd64/+/version:9.20220726.1.1) +The commands in this section assume that they are being run from inside your +local Rust source checkout: + +```sh +cd ${RUST_SRC_PATH} +``` + +To run the Rust test suite on an emulated Fuchsia device, you must install the +Rust compiler locally. See "[Targeting Fuchsia with a compiler built from source](#targeting-fuchsia-with-a-compiler-built-from-source)" +for the steps to build locally. -Interfacing with the Fuchsia emulator is handled by our test runner script located -at `${RUST_SRC_PATH}/src/ci/docker/scripts/fuchsia-test-runner.py`. +You'll also need to download a copy of the Fuchsia SDK. The current minimum +supported SDK version is [9.20220726.1.1](https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core/linux-amd64/+/version:9.20220726.1.1). -We start by activating our Fuchsia test environment. From a terminal: +Fuchsia's test runner interacts with the Fuchsia emulator and is located at +`src/ci/docker/scripts/fuchsia-test-runner.py`. We can use it to start our +test environment with: -**Issue command from ${RUST_SRC_PATH}** ```sh src/ci/docker/scripts/fuchsia-test-runner.py start - --rust . + --rust ${RUST_SRC_PATH}/install --sdk ${SDK_PATH} --target-arch {x64,arm64} ``` -Next, for ease of commands, we copy `config-env.sh` and `config.toml` into our Rust source -code path, `${RUST_SRC_PATH}`. +Where `${RUST_SRC_PATH}/install` is the `prefix` set in `config.toml` and +`${SDK_PATH}` is the path to the downloaded and unzipped SDK. -From there, we utilize `x.py` to run our tests, using the test runner script to -run the tests on our emulator. To run the full `src/test/ui` test suite: +Once our environment is started, we can run our tests using `x.py` as usual. The +test runner script will run the compiled tests on an emulated Fuchsia device. To +run the full `src/test/ui` test suite: -**Run from ${RUST_SRC_PATH}** ```sh ( \ source config-env.sh && \ @@ -695,9 +733,8 @@ run the tests on our emulator. To run the full `src/test/ui` test suite: *Note: The test suite cannot be run in parallel at the moment, so `x.py` must be run with `--jobs 1` to ensure only one test runs at a time.* -When finished, stop the test environment: +When finished, the test runner can be used to stop the test environment: -**Issue command from ${RUST_SRC_PATH}** ```sh src/ci/docker/scripts/fuchsia-test-runner.py stop ``` diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index ef28e2a855a04..08f8096b07bd6 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -847,10 +847,10 @@ fn assoc_method( render_attributes_in_code(w, meth); (0, "", Ending::Newline) }; - w.reserve(header_len + "{".len() + "".len()); + w.reserve(header_len + "{".len() + "".len()); write!( w, - "{indent}{vis}{constness}{asyncness}{unsafety}{defaultness}{abi}fn {name}\ + "{indent}{vis}{constness}{asyncness}{unsafety}{defaultness}{abi}fn {name}\ {generics}{decl}{notable_traits}{where_clause}", indent = indent_str, vis = vis, diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 98a5b761dedf5..cf5592da43205 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -242,7 +242,6 @@ h1 a, } .content span.fn, .content a.fn, -.content .fnname, .content span.method, .content a.method, .content span.tymethod, .content a.tymethod { color: var(--function-link-color); @@ -1512,6 +1511,7 @@ details.rustdoc-toggle > summary.hideme > span { } details.rustdoc-toggle > summary::before { + background-image: url("toggle-plus-1092eb4930d581b0.svg"); content: ""; cursor: pointer; width: 16px; @@ -1599,14 +1599,6 @@ details.rustdoc-toggle[open] > summary.hideme > span { details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle[open] > summary.hideme::before { background-image: url("toggle-minus-31bbd6e4c77f5c96.svg"); -} - -details.rustdoc-toggle > summary::before { - background-image: url("toggle-plus-1092eb4930d581b0.svg"); -} - -details.rustdoc-toggle[open] > summary::before, -details.rustdoc-toggle[open] > summary.hideme::before { width: 16px; height: 16px; background-repeat: no-repeat; diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 7230df36c075b..623f46b109666 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -302,13 +302,15 @@ function loadCss(cssUrl) { const params = searchState.getQueryStringParams(); if (params.search !== undefined) { - const search = searchState.outputElement(); - search.innerHTML = "

" + - searchState.loadingText + "

"; - searchState.showResults(search); + searchState.setLoadingSearch(); loadSearch(); } }, + setLoadingSearch: () => { + const search = searchState.outputElement(); + search.innerHTML = "

" + searchState.loadingText + "

"; + searchState.showResults(search); + }, }; function getPageId() { diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 4999bb3599487..23ae4e97082e3 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -1766,13 +1766,13 @@ function initSearch(rawSearchIndex) { * @param {boolean} [forced] */ function search(e, forced) { - const params = searchState.getQueryStringParams(); - const query = parseQuery(searchState.input.value.trim()); - if (e) { e.preventDefault(); } + const query = parseQuery(searchState.input.value.trim()); + let filterCrates = getFilterCrates(); + if (!forced && query.userQuery === currentResults) { if (query.userQuery.length > 0) { putBackSearch(); @@ -1780,7 +1780,9 @@ function initSearch(rawSearchIndex) { return; } - let filterCrates = getFilterCrates(); + searchState.setLoadingSearch(); + + const params = searchState.getQueryStringParams(); // In case we have no information about the saved crate and there is a URL query parameter, // we override it with the URL query parameter. diff --git a/src/test/rustdoc-gui/item-decl-colors.goml b/src/test/rustdoc-gui/item-decl-colors.goml index 9a46f256056f9..2e07f19b13d64 100644 --- a/src/test/rustdoc-gui/item-decl-colors.goml +++ b/src/test/rustdoc-gui/item-decl-colors.goml @@ -30,7 +30,7 @@ define-function: ( ("assert-css", (".item-decl .primitive", {"color": |primitive_color|}, ALL)), ("goto", "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"), ("assert-css", (".item-decl .constant", {"color": |constant_color|}, ALL)), - ("assert-css", (".item-decl .fnname", {"color": |fn_color|}, ALL)), + ("assert-css", (".item-decl .fn", {"color": |fn_color|}, ALL)), ("assert-css", (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)), ], ) diff --git a/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml index 7e24af47ee817..7d4bd27d42d4d 100644 --- a/src/test/rustdoc-gui/notable-trait.goml +++ b/src/test/rustdoc-gui/notable-trait.goml @@ -226,7 +226,7 @@ assert: "#method\.create_an_iterator_from_read .notable-traits:focus" // Now we check that the focus isn't given back to the wrong item when opening // another popover. store-window-property: (scroll, "scrollY") -click: "#method\.create_an_iterator_from_read .fnname" +click: "#method\.create_an_iterator_from_read .fn" // We ensure that the scroll position changed. assert-window-property-false: {"scrollY": |scroll|} // Store the new position. @@ -240,7 +240,7 @@ assert-window-property-false: {"scrollY": |scroll|} // Same but with Escape handling. store-window-property: (scroll, "scrollY") -click: "#method\.create_an_iterator_from_read .fnname" +click: "#method\.create_an_iterator_from_read .fn" // We ensure that the scroll position changed. assert-window-property-false: {"scrollY": |scroll|} // Store the new position. diff --git a/src/test/rustdoc-gui/where-whitespace.goml b/src/test/rustdoc-gui/where-whitespace.goml index 776c8ec721e21..41596a9bcccf2 100644 --- a/src/test/rustdoc-gui/where-whitespace.goml +++ b/src/test/rustdoc-gui/where-whitespace.goml @@ -5,13 +5,13 @@ show-text: true // line than "pub trait Whitespace"). compare-elements-position-false: (".item-decl code", ".where.fmt-newline", ("y")) // And that the code following it isn't on the same line either. -compare-elements-position-false: (".item-decl .fnname", ".where.fmt-newline", ("y")) +compare-elements-position-false: (".item-decl .fn", ".where.fmt-newline", ("y")) goto: "file://" + |DOC_PATH| + "/lib2/struct.WhereWhitespace.html" // We make the screen a bit wider to ensure that the trait impl is on one line. size: (915, 915) -compare-elements-position-false: ("#method\.new .fnname", "#method\.new .where.fmt-newline", ("y")) +compare-elements-position-false: ("#method\.new .fn", "#method\.new .where.fmt-newline", ("y")) // We ensure that both the trait name and the struct name are on the same line in // "impl Whitespace<&K> for WhereWhitespace". compare-elements-position: ( diff --git a/src/test/rustdoc-json/enums/auxiliary/color.rs b/src/test/rustdoc-json/enums/auxiliary/color.rs new file mode 100644 index 0000000000000..7188f79383259 --- /dev/null +++ b/src/test/rustdoc-json/enums/auxiliary/color.rs @@ -0,0 +1,5 @@ +pub enum Color { + Red, + Green, + Blue, +} diff --git a/src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs b/src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs new file mode 100644 index 0000000000000..470b195a29247 --- /dev/null +++ b/src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs @@ -0,0 +1,11 @@ +// aux-build: color.rs + +//! The purpose of this test it to have a link to [a foreign variant](Red). + +extern crate color; +use color::Color::Red; + +// @set red = "$.index[*][?(@.inner.is_crate == true)].links.Red" + +// @!has "$.index[*][?(@.name == 'Red')]" +// @!has "$.index[*][?(@.name == 'Color')]" diff --git a/src/test/rustdoc-json/enums/use_variant_foreign.rs b/src/test/rustdoc-json/enums/use_variant_foreign.rs new file mode 100644 index 0000000000000..11bb6ce1f3a0c --- /dev/null +++ b/src/test/rustdoc-json/enums/use_variant_foreign.rs @@ -0,0 +1,9 @@ +// aux-build: color.rs + +extern crate color; + +// @is "$.index[*][?(@.inner.name == 'Red')].kind" '"import"' +pub use color::Color::Red; + +// @!has "$.index[*][?(@.name == 'Red')]" +// @!has "$.index[*][?(@.name == 'Color')]" diff --git a/src/test/rustdoc/anchors.no_method_anchor.html b/src/test/rustdoc/anchors.no_method_anchor.html index 521fdcb7877a7..b9ec8bf4c09a0 100644 --- a/src/test/rustdoc/anchors.no_method_anchor.html +++ b/src/test/rustdoc/anchors.no_method_anchor.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/test/rustdoc/anchors.no_trait_method_anchor.html b/src/test/rustdoc/anchors.no_trait_method_anchor.html index d7bd525ff0f53..4308ddad41206 100644 --- a/src/test/rustdoc/anchors.no_trait_method_anchor.html +++ b/src/test/rustdoc/anchors.no_trait_method_anchor.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/test/rustdoc/anchors.no_tymethod_anchor.html b/src/test/rustdoc/anchors.no_tymethod_anchor.html index e668e5e4db15c..91eed8a374292 100644 --- a/src/test/rustdoc/anchors.no_tymethod_anchor.html +++ b/src/test/rustdoc/anchors.no_tymethod_anchor.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/test/rustdoc/decl-trailing-whitespace.declaration.html b/src/test/rustdoc/decl-trailing-whitespace.declaration.html index e60caaeff383c..02b51b3446195 100644 --- a/src/test/rustdoc/decl-trailing-whitespace.declaration.html +++ b/src/test/rustdoc/decl-trailing-whitespace.declaration.html @@ -1,7 +1,7 @@ pub trait Write { - fn poll_write(
        self: Option<String>,
        cx: &mut Option<String>,
        buf: &mut [usize]
    ) -> Option<Result<usize, Error>>; - fn poll_flush(
        self: Option<String>,
        cx: &mut Option<String>
    ) -> Option<Result<(), Error>>; - fn poll_close(
        self: Option<String>,
        cx: &mut Option<String>
    ) -> Option<Result<(), Error>>; + fn poll_write(
        self: Option<String>,
        cx: &mut Option<String>,
        buf: &mut [usize]
    ) -> Option<Result<usize, Error>>; + fn poll_flush(
        self: Option<String>,
        cx: &mut Option<String>
    ) -> Option<Result<(), Error>>; + fn poll_close(
        self: Option<String>,
        cx: &mut Option<String>
    ) -> Option<Result<(), Error>>; - fn poll_write_vectored(
        self: Option<String>,
        cx: &mut Option<String>,
        bufs: &[usize]
    ) -> Option<Result<usize, Error>> { ... } -}
+ fn poll_write_vectored(
        self: Option<String>,
        cx: &mut Option<String>,
        bufs: &[usize]
    ) -> Option<Result<usize, Error>> { ... } +} \ No newline at end of file diff --git a/src/test/rustdoc/extern-default-method.no_href_on_anchor.html b/src/test/rustdoc/extern-default-method.no_href_on_anchor.html index dab0a64952955..ef14836ccb8c6 100644 --- a/src/test/rustdoc/extern-default-method.no_href_on_anchor.html +++ b/src/test/rustdoc/extern-default-method.no_href_on_anchor.html @@ -1 +1 @@ -provided(&self) \ No newline at end of file +provided(&self) \ No newline at end of file diff --git a/src/test/rustdoc/extern-default-method.rs b/src/test/rustdoc/extern-default-method.rs index 8139f5b2619b3..fc28b230a5f7e 100644 --- a/src/test/rustdoc/extern-default-method.rs +++ b/src/test/rustdoc/extern-default-method.rs @@ -11,13 +11,13 @@ extern crate rustdoc_extern_default_method as ext; // However, the method in the trait impl should *not* have a link (an `href` attribute) to // its corresponding item in the trait declaration since it would otherwise be broken. // -// In older versions of rustdoc, the impl item (`a[@class="fnname"]`) used to link to +// In older versions of rustdoc, the impl item (`a[@class="fn"]`) used to link to // `#method.provided` – i.e. "to itself". Put in quotes since that was actually incorrect in // general: If the type `Struct` also had an inherent method called `provided`, the impl item // would link to that one even though those two methods are distinct items! // @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1 -// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="fnname"]' 1 -// @snapshot no_href_on_anchor - '//*[@id="method.provided"]//a[@class="fnname"]' +// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="fn"]' 1 +// @snapshot no_href_on_anchor - '//*[@id="method.provided"]//a[@class="fn"]' // @has extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="anchor"]/@href' #method.provided pub use ext::Struct; diff --git a/src/test/rustdoc/foreigntype.rs b/src/test/rustdoc/foreigntype.rs index 891cdd5fed76c..29f9c2926e9ec 100644 --- a/src/test/rustdoc/foreigntype.rs +++ b/src/test/rustdoc/foreigntype.rs @@ -6,7 +6,7 @@ extern "C" { } impl ExtType { - // @has - '//a[@class="fnname"]' 'do_something' + // @has - '//a[@class="fn"]' 'do_something' pub fn do_something(&self) {} } diff --git a/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html b/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html index 6955a961499ba..f3c1c045202b0 100644 --- a/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html +++ b/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html @@ -1 +1 @@ -

fn touch(&self)

\ No newline at end of file +

fn touch(&self)

\ No newline at end of file diff --git a/src/test/rustdoc/trait-impl-items-links-and-anchors.rs b/src/test/rustdoc/trait-impl-items-links-and-anchors.rs index fba594c38273c..a125fa036790b 100644 --- a/src/test/rustdoc/trait-impl-items-links-and-anchors.rs +++ b/src/test/rustdoc/trait-impl-items-links-and-anchors.rs @@ -13,10 +13,10 @@ impl MyTrait for String { // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1 const VALUE: u32 = 5; - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function + // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function fn trait_function(&self) {} - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="fnname"]/@href' #method.defaulted_override + // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="fn"]/@href' #method.defaulted_override // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1 fn defaulted_override(&self) {} } @@ -28,10 +28,10 @@ impl MyTrait for Vec { // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2 const VALUE: u32 = 5; - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function + // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1 fn trait_function(&self) {} - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="fnname"]/@href' #method.defaulted_override + // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="fn"]/@href' #method.defaulted_override // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2 fn defaulted_override(&self) {} } @@ -45,13 +45,13 @@ impl MyTrait for MyStruct { // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE const VALUE: u32 = 20; - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="fnname"]/@href' trait.MyTrait.html#tymethod.trait_function + // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' trait.MyTrait.html#tymethod.trait_function // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function fn trait_function(&self) {} - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted_override + // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted_override // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override fn defaulted_override(&self) {} - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted + // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted } diff --git a/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html b/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html index 24ab77703d107..d5d6c556d8001 100644 --- a/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html +++ b/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html @@ -1,8 +1,8 @@
pub trait TraitWhere {
     type Item<'a>
    where
        Self: 'a
; - fn func(self)
    where
        Self: Sized
, + fn func(self)
    where
        Self: Sized
, { ... } - fn lines(self) -> Lines<Self>
    where
        Self: Sized
, + fn lines(self) -> Lines<Self>
    where
        Self: Sized
, { ... } }
\ No newline at end of file diff --git a/src/test/rustdoc/whitespace-after-where-clause.trait.html b/src/test/rustdoc/whitespace-after-where-clause.trait.html index 16b5582370353..50cfe362328b6 100644 --- a/src/test/rustdoc/whitespace-after-where-clause.trait.html +++ b/src/test/rustdoc/whitespace-after-where-clause.trait.html @@ -1,6 +1,6 @@
pub trait ToOwned<T>where
    T: Clone,
{ type Owned; - fn to_owned(&self) -> Self::Owned; - fn whatever(&self) -> T; + fn to_owned(&self) -> Self::Owned; + fn whatever(&self) -> T; }
\ No newline at end of file diff --git a/src/test/rustdoc/whitespace-after-where-clause.trait2.html b/src/test/rustdoc/whitespace-after-where-clause.trait2.html index eeca6e1f50081..21eb89b75011b 100644 --- a/src/test/rustdoc/whitespace-after-where-clause.trait2.html +++ b/src/test/rustdoc/whitespace-after-where-clause.trait2.html @@ -1,6 +1,6 @@
pub trait ToOwned2<T: Clone> {
     type Owned;
 
-    fn to_owned(&self) -> Self::Owned;
-    fn whatever(&self) -> T;
+    fn to_owned(&self) -> Self::Owned;
+    fn whatever(&self) -> T;
 }
\ No newline at end of file diff --git a/src/test/ui/suggestions/seggest_print_over_printf.rs b/src/test/ui/suggestions/suggest_print_over_printf.rs similarity index 69% rename from src/test/ui/suggestions/seggest_print_over_printf.rs rename to src/test/ui/suggestions/suggest_print_over_printf.rs index 25566cd7f2aeb..124ddec50cbbe 100644 --- a/src/test/ui/suggestions/seggest_print_over_printf.rs +++ b/src/test/ui/suggestions/suggest_print_over_printf.rs @@ -1,5 +1,4 @@ -// Suggest to a user to use the print macros -// instead to use the printf. +// Suggest print macro when user erroneously uses printf fn main() { let x = 4; diff --git a/src/test/ui/suggestions/seggest_print_over_printf.stderr b/src/test/ui/suggestions/suggest_print_over_printf.stderr similarity index 88% rename from src/test/ui/suggestions/seggest_print_over_printf.stderr rename to src/test/ui/suggestions/suggest_print_over_printf.stderr index 7b1ce047a9274..1214bec16ce03 100644 --- a/src/test/ui/suggestions/seggest_print_over_printf.stderr +++ b/src/test/ui/suggestions/suggest_print_over_printf.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function `printf` in this scope - --> $DIR/seggest_print_over_printf.rs:6:5 + --> $DIR/suggest_print_over_printf.rs:5:5 | LL | printf("%d", x); | ^^^^^^ not found in this scope diff --git a/src/test/ui/traits/predicate_can_apply-hang.rs b/src/test/ui/traits/predicate_can_apply-hang.rs deleted file mode 100644 index 5f01645da5242..0000000000000 --- a/src/test/ui/traits/predicate_can_apply-hang.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn f(x: Vec<[[[B; 1]; 1]; 1]>) -> impl PartialEq { - //~^ ERROR can't compare `Vec<[[[B; 1]; 1]; 1]>` with `B` - x -} - -fn main() {} diff --git a/src/test/ui/traits/predicate_can_apply-hang.stderr b/src/test/ui/traits/predicate_can_apply-hang.stderr deleted file mode 100644 index 49fe63b412ac9..0000000000000 --- a/src/test/ui/traits/predicate_can_apply-hang.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: can't compare `Vec<[[[B; 1]; 1]; 1]>` with `B` - --> $DIR/predicate_can_apply-hang.rs:1:38 - | -LL | fn f(x: Vec<[[[B; 1]; 1]; 1]>) -> impl PartialEq { - | ^^^^^^^^^^^^^^^^^ no implementation for `Vec<[[[B; 1]; 1]; 1]> == B` -LL | -LL | x - | - return type was inferred to be `Vec<[[[B; 1]; 1]; 1]>` here - | - = help: the trait `PartialEq` is not implemented for `Vec<[[[B; 1]; 1]; 1]>` - = help: the following other types implement trait `PartialEq`: - as PartialEq>> - as PartialEq<&[U; N]>> - as PartialEq<&[U]>> - as PartialEq<&mut [U]>> - as PartialEq<[U; N]>> - as PartialEq<[U]>> - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/typeck/hang-in-overflow.rs b/src/test/ui/typeck/hang-in-overflow.rs deleted file mode 100644 index a8330c9b65c31..0000000000000 --- a/src/test/ui/typeck/hang-in-overflow.rs +++ /dev/null @@ -1,19 +0,0 @@ -// normalize-stderr-test "the requirement `.*`" -> "the requirement `...`" -// normalize-stderr-test "required for `.*` to implement `.*`" -> "required for `...` to implement `...`" -// normalize-stderr-test: ".*the full type name has been written to.*\n" -> "" - -// Currently this fatally aborts instead of hanging. -// Make sure at least that this doesn't turn into a hang. - -fn f() { - foo::<_>(); - //~^ ERROR overflow evaluating the requirement -} - -fn foo() -where - Vec<[[[B; 1]; 1]; 1]>: PartialEq, -{ -} - -fn main() {} diff --git a/src/test/ui/typeck/hang-in-overflow.stderr b/src/test/ui/typeck/hang-in-overflow.stderr deleted file mode 100644 index 7a7b85b19b4ee..0000000000000 --- a/src/test/ui/typeck/hang-in-overflow.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0275]: overflow evaluating the requirement `...` - --> $DIR/hang-in-overflow.rs:9:5 - | -LL | foo::<_>(); - | ^^^^^^^^ - | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hang_in_overflow`) - = note: required for `...` to implement `...` - = note: 127 redundant requirements hidden - = note: required for `...` to implement `...` -note: required by a bound in `foo` - --> $DIR/hang-in-overflow.rs:15:28 - | -LL | fn foo() - | --- required by a bound in this -LL | where -LL | Vec<[[[B; 1]; 1]; 1]>: PartialEq, - | ^^^^^^^^^^^^ required by this bound in `foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0275`. diff --git a/triagebot.toml b/triagebot.toml index e43287700ba42..bc0b88b2babd2 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -412,6 +412,9 @@ cc = ["@rust-lang/clippy"] message = "The Miri subtree was changed" cc = ["@rust-lang/miri"] +[mentions."src/tools/rust-analyzer"] +cc = ["@rust-lang/wg-rls-2"] + [mentions."src/tools/rustfmt"] cc = ["@rust-lang/rustfmt"]