diff --git a/Cargo.lock b/Cargo.lock index af23324cbef..74a316ed5f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -765,9 +765,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" dependencies = [ "crossbeam-epoch", "crossbeam-utils 0.7.2", @@ -2368,9 +2368,9 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-src" -version = "111.15.0+1.1.1k" +version = "111.16.0+1.1.1l" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a5f6ae2ac04393b217ea9f700cd04fa9bf3d93fae2872069f3d15d908af70a" +checksum = "7ab2173f69416cf3ec12debb5823d244127d23a9b127d5a5189aa97c5fa2859f" dependencies = [ "cc", ] @@ -4968,9 +4968,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.35" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d779dc6aeff029314570f666ec83f19df7280bb36ef338442cfa8c604021b80" +checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c" dependencies = [ "filetime", "libc", diff --git a/RELEASES.md b/RELEASES.md index dd299ca936a..2124195bcb2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -70,7 +70,8 @@ Cargo - [The package definition in `cargo metadata` now includes the `"default_run"` field from the manifest.][cargo/9550] - [Added `cargo d` as an alias for `cargo doc`.][cargo/9680] -- [Added `{lib}` as formatting option for `cargo tree` to print the "lib_name" of packages.][cargo/9663] +- [Added `{lib}` as formatting option for `cargo tree` to print the `"lib_name"` + of packages.][cargo/9663] Rustdoc ------- @@ -116,9 +117,11 @@ Compatibility Notes [79965]: https://github.com/rust-lang/rust/pull/79965 [87370]: https://github.com/rust-lang/rust/pull/87370 [87298]: https://github.com/rust-lang/rust/pull/87298 +[cargo/9663]: https://github.com/rust-lang/cargo/pull/9663 [cargo/9675]: https://github.com/rust-lang/cargo/pull/9675 [cargo/9550]: https://github.com/rust-lang/cargo/pull/9550 [cargo/9680]: https://github.com/rust-lang/cargo/pull/9680 +[cargo/9663]: https://github.com/rust-lang/cargo/pull/9663 [`array::map`]: https://doc.rust-lang.org/stable/std/primitive.array.html#method.map [`Bound::cloned`]: https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.cloned [`Drain::as_str`]: https://doc.rust-lang.org/stable/std/string/struct.Drain.html#method.as_str diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs index 7be3f541487..4e079ed865a 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs @@ -5,11 +5,14 @@ use rustc_middle::mir::{Mutability, Place, PlaceRef, ProjectionElem}; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::{ hir::place::PlaceBase, - mir::{self, ClearCrossCrate, Local, LocalDecl, LocalInfo, LocalKind, Location}, + mir::{ + self, BindingForm, ClearCrossCrate, ImplicitSelfKind, Local, LocalDecl, LocalInfo, + LocalKind, Location, + }, }; use rustc_span::source_map::DesugaringKind; use rustc_span::symbol::{kw, Symbol}; -use rustc_span::Span; +use rustc_span::{BytePos, Span}; use crate::borrow_check::diagnostics::BorrowedContentSource; use crate::borrow_check::MirBorrowckCtxt; @@ -241,13 +244,74 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { .map(|l| mut_borrow_of_mutable_ref(l, self.local_names[local])) .unwrap_or(false) => { + let decl = &self.body.local_decls[local]; err.span_label(span, format!("cannot {ACT}", ACT = act)); - err.span_suggestion( - span, - "try removing `&mut` here", - String::new(), - Applicability::MaybeIncorrect, - ); + if let Some(mir::Statement { + source_info, + kind: + mir::StatementKind::Assign(box ( + _, + mir::Rvalue::Ref( + _, + mir::BorrowKind::Mut { allow_two_phase_borrow: false }, + _, + ), + )), + .. + }) = &self.body[location.block].statements.get(location.statement_index) + { + match decl.local_info { + Some(box LocalInfo::User(ClearCrossCrate::Set(BindingForm::Var( + mir::VarBindingForm { + binding_mode: ty::BindingMode::BindByValue(Mutability::Not), + opt_ty_info: Some(sp), + opt_match_place: _, + pat_span: _, + }, + )))) => { + err.span_note(sp, "the binding is already a mutable borrow"); + } + _ => { + err.span_note( + decl.source_info.span, + "the binding is already a mutable borrow", + ); + } + } + if let Ok(snippet) = + self.infcx.tcx.sess.source_map().span_to_snippet(source_info.span) + { + if snippet.starts_with("&mut ") { + // We don't have access to the HIR to get accurate spans, but we can + // give a best effort structured suggestion. + err.span_suggestion_verbose( + source_info.span.with_hi(source_info.span.lo() + BytePos(5)), + "try removing `&mut` here", + String::new(), + Applicability::MachineApplicable, + ); + } else { + // This can occur with things like `(&mut self).foo()`. + err.span_help(source_info.span, "try removing `&mut` here"); + } + } else { + err.span_help(source_info.span, "try removing `&mut` here"); + } + } else if decl.mutability == Mutability::Not + && !matches!( + decl.local_info, + Some(box LocalInfo::User(ClearCrossCrate::Set(BindingForm::ImplicitSelf( + ImplicitSelfKind::MutRef + )))) + ) + { + err.span_suggestion_verbose( + decl.source_info.span.shrink_to_lo(), + "consider making the binding mutable", + "mut ".to_string(), + Applicability::MachineApplicable, + ); + } } // We want to suggest users use `let mut` for local (user diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 9d923599db7..b3601ecf1d3 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -215,7 +215,6 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { "let ".to_string(), Applicability::MaybeIncorrect, ); - self.r.session.if_let_suggestions.borrow_mut().insert(*span); } _ => {} } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 20e94e32be6..18b93395587 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -209,9 +209,6 @@ pub struct Session { /// Set of enabled features for the current target. pub target_features: FxHashSet, - - /// `Span`s for `if` conditions that we have suggested turning into `if let`. - pub if_let_suggestions: Lock>, } pub struct PerfStats { @@ -1328,7 +1325,6 @@ pub fn build_session( miri_unleashed_features: Lock::new(Default::default()), asm_arch, target_features: FxHashSet::default(), - if_let_suggestions: Default::default(), }; validate_commandline_args_with_session_available(&sess); diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 551309f4a8c..220c9f7e2ec 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -246,10 +246,18 @@ fn compute_symbol_name( tcx.symbol_mangling_version(mangling_version_crate) }; - match mangling_version { + let symbol = match mangling_version { SymbolManglingVersion::Legacy => legacy::mangle(tcx, instance, instantiating_crate), SymbolManglingVersion::V0 => v0::mangle(tcx, instance, instantiating_crate), - } + }; + + debug_assert!( + rustc_demangle::try_demangle(&symbol).is_ok(), + "compute_symbol_name: `{}` cannot be demangled", + symbol + ); + + symbol } fn is_generic(substs: SubstsRef<'_>) -> bool { diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs index ab927b79442..51c646e500c 100644 --- a/compiler/rustc_typeck/src/check/expr.rs +++ b/compiler/rustc_typeck/src/check/expr.rs @@ -919,9 +919,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ); } - if self.sess().if_let_suggestions.borrow().get(&expr.span).is_some() { - // We already emitted an `if let` suggestion due to an identifier not found. - err.delay_as_bug(); + // If the assignment expression itself is ill-formed, don't + // bother emitting another error + if lhs_ty.references_error() || rhs_ty.references_error() { + err.delay_as_bug() } else { err.emit(); } diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/unix/stack_overflow.rs index 81f47a779d3..e8747e39bcb 100644 --- a/library/std/src/sys/unix/stack_overflow.rs +++ b/library/std/src/sys/unix/stack_overflow.rs @@ -161,24 +161,10 @@ mod imp { stackp.add(page_size()) } - #[cfg(any( - target_os = "linux", - target_os = "macos", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "illumos" - ))] unsafe fn get_stack() -> libc::stack_t { libc::stack_t { ss_sp: get_stackp(), ss_flags: 0, ss_size: SIGSTKSZ } } - #[cfg(target_os = "dragonfly")] - unsafe fn get_stack() -> libc::stack_t { - libc::stack_t { ss_sp: get_stackp() as *mut i8, ss_flags: 0, ss_size: SIGSTKSZ } - } - pub unsafe fn make_handler() -> Handler { if !NEED_ALTSTACK.load(Ordering::Relaxed) { return Handler::null(); diff --git a/src/librustdoc/html/length_limit.rs b/src/librustdoc/html/length_limit.rs new file mode 100644 index 00000000000..bbdc91c8d2e --- /dev/null +++ b/src/librustdoc/html/length_limit.rs @@ -0,0 +1,119 @@ +//! See [`HtmlWithLimit`]. + +use std::fmt::Write; +use std::ops::ControlFlow; + +use crate::html::escape::Escape; + +/// A buffer that allows generating HTML with a length limit. +/// +/// This buffer ensures that: +/// +/// * all tags are closed, +/// * tags are closed in the reverse order of when they were opened (i.e., the correct HTML order), +/// * no tags are left empty (e.g., ``) due to the length limit being reached, +/// * all text is escaped. +#[derive(Debug)] +pub(super) struct HtmlWithLimit { + buf: String, + len: usize, + limit: usize, + /// A list of tags that have been requested to be opened via [`Self::open_tag()`] + /// but have not actually been pushed to `buf` yet. This ensures that tags are not + /// left empty (e.g., ``) due to the length limit being reached. + queued_tags: Vec<&'static str>, + /// A list of all tags that have been opened but not yet closed. + unclosed_tags: Vec<&'static str>, +} + +impl HtmlWithLimit { + /// Create a new buffer, with a limit of `length_limit`. + pub(super) fn new(length_limit: usize) -> Self { + let buf = if length_limit > 1000 { + // If the length limit is really large, don't preallocate tons of memory. + String::new() + } else { + // The length limit is actually a good heuristic for initial allocation size. + // Measurements showed that using it as the initial capacity ended up using less memory + // than `String::new`. + // See https://github.com/rust-lang/rust/pull/88173#discussion_r692531631 for more. + String::with_capacity(length_limit) + }; + Self { + buf, + len: 0, + limit: length_limit, + unclosed_tags: Vec::new(), + queued_tags: Vec::new(), + } + } + + /// Finish using the buffer and get the written output. + /// This function will close all unclosed tags for you. + pub(super) fn finish(mut self) -> String { + self.close_all_tags(); + self.buf + } + + /// Write some plain text to the buffer, escaping as needed. + /// + /// This function skips writing the text if the length limit was reached + /// and returns [`ControlFlow::Break`]. + pub(super) fn push(&mut self, text: &str) -> ControlFlow<(), ()> { + if self.len + text.len() > self.limit { + return ControlFlow::BREAK; + } + + self.flush_queue(); + write!(self.buf, "{}", Escape(text)).unwrap(); + self.len += text.len(); + + ControlFlow::CONTINUE + } + + /// Open an HTML tag. + /// + /// **Note:** HTML attributes have not yet been implemented. + /// This function will panic if called with a non-alphabetic `tag_name`. + pub(super) fn open_tag(&mut self, tag_name: &'static str) { + assert!( + tag_name.chars().all(|c| ('a'..='z').contains(&c)), + "tag_name contained non-alphabetic chars: {:?}", + tag_name + ); + self.queued_tags.push(tag_name); + } + + /// Close the most recently opened HTML tag. + pub(super) fn close_tag(&mut self) { + match self.unclosed_tags.pop() { + // Close the most recently opened tag. + Some(tag_name) => write!(self.buf, "", tag_name).unwrap(), + // There are valid cases where `close_tag()` is called without + // there being any tags to close. For example, this occurs when + // a tag is opened after the length limit is exceeded; + // `flush_queue()` will never be called, and thus, the tag will + // not end up being added to `unclosed_tags`. + None => {} + } + } + + /// Write all queued tags and add them to the `unclosed_tags` list. + fn flush_queue(&mut self) { + for tag_name in self.queued_tags.drain(..) { + write!(self.buf, "<{}>", tag_name).unwrap(); + + self.unclosed_tags.push(tag_name); + } + } + + /// Close all unclosed tags. + fn close_all_tags(&mut self) { + while !self.unclosed_tags.is_empty() { + self.close_tag(); + } + } +} + +#[cfg(test)] +mod tests; diff --git a/src/librustdoc/html/length_limit/tests.rs b/src/librustdoc/html/length_limit/tests.rs new file mode 100644 index 00000000000..2d02b8a16da --- /dev/null +++ b/src/librustdoc/html/length_limit/tests.rs @@ -0,0 +1,120 @@ +use super::*; + +#[test] +fn empty() { + assert_eq!(HtmlWithLimit::new(0).finish(), ""); + assert_eq!(HtmlWithLimit::new(60).finish(), ""); +} + +#[test] +fn basic() { + let mut buf = HtmlWithLimit::new(60); + buf.push("Hello "); + buf.open_tag("em"); + buf.push("world"); + buf.close_tag(); + buf.push("!"); + assert_eq!(buf.finish(), "Hello world!"); +} + +#[test] +fn no_tags() { + let mut buf = HtmlWithLimit::new(60); + buf.push("Hello"); + buf.push(" world!"); + assert_eq!(buf.finish(), "Hello world!"); +} + +#[test] +fn limit_0() { + let mut buf = HtmlWithLimit::new(0); + buf.push("Hello "); + buf.open_tag("em"); + buf.push("world"); + buf.close_tag(); + buf.push("!"); + assert_eq!(buf.finish(), ""); +} + +#[test] +fn exactly_limit() { + let mut buf = HtmlWithLimit::new(12); + buf.push("Hello "); + buf.open_tag("em"); + buf.push("world"); + buf.close_tag(); + buf.push("!"); + assert_eq!(buf.finish(), "Hello world!"); +} + +#[test] +fn multiple_nested_tags() { + let mut buf = HtmlWithLimit::new(60); + buf.open_tag("p"); + buf.push("This is a "); + buf.open_tag("em"); + buf.push("paragraph"); + buf.open_tag("strong"); + buf.push("!"); + buf.close_tag(); + buf.close_tag(); + buf.close_tag(); + assert_eq!(buf.finish(), "

This is a paragraph!

"); +} + +#[test] +fn forgot_to_close_tags() { + let mut buf = HtmlWithLimit::new(60); + buf.open_tag("p"); + buf.push("This is a "); + buf.open_tag("em"); + buf.push("paragraph"); + buf.open_tag("strong"); + buf.push("!"); + assert_eq!(buf.finish(), "

This is a paragraph!

"); +} + +#[test] +fn past_the_limit() { + let mut buf = HtmlWithLimit::new(20); + buf.open_tag("p"); + (0..10).try_for_each(|n| { + buf.open_tag("strong"); + buf.push("word#")?; + buf.push(&n.to_string())?; + buf.close_tag(); + ControlFlow::CONTINUE + }); + buf.close_tag(); + assert_eq!( + buf.finish(), + "

\ + word#0\ + word#1\ + word#2\ +

" + ); +} + +#[test] +fn quickly_past_the_limit() { + let mut buf = HtmlWithLimit::new(6); + buf.open_tag("p"); + buf.push("Hello"); + buf.push(" World"); + // intentionally not closing

before finishing + assert_eq!(buf.finish(), "

Hello

"); +} + +#[test] +fn close_too_many() { + let mut buf = HtmlWithLimit::new(60); + buf.open_tag("p"); + buf.push("Hello"); + buf.close_tag(); + // This call does not panic because there are valid cases + // where `close_tag()` is called with no tags left to close. + // So `close_tag()` does nothing in this case. + buf.close_tag(); + assert_eq!(buf.finish(), "

Hello

"); +} diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 7c6d7dff816..aa3723eddfc 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -23,12 +23,13 @@ use rustc_hir::HirId; use rustc_middle::ty::TyCtxt; use rustc_span::edition::Edition; use rustc_span::Span; + use std::borrow::Cow; use std::cell::RefCell; use std::collections::VecDeque; use std::default::Default; use std::fmt::Write; -use std::ops::Range; +use std::ops::{ControlFlow, Range}; use std::str; use crate::clean::RenderedLink; @@ -36,6 +37,7 @@ use crate::doctest; use crate::html::escape::Escape; use crate::html::format::Buffer; use crate::html::highlight; +use crate::html::length_limit::HtmlWithLimit; use crate::html::toc::TocBuilder; use pulldown_cmark::{ @@ -1081,15 +1083,6 @@ fn markdown_summary_with_limit( return (String::new(), false); } - let mut s = String::with_capacity(md.len() * 3 / 2); - let mut text_length = 0; - let mut stopped_early = false; - - fn push(s: &mut String, text_length: &mut usize, text: &str) { - write!(s, "{}", Escape(text)).unwrap(); - *text_length += text.len(); - } - let mut replacer = |broken_link: BrokenLink<'_>| { if let Some(link) = link_names.iter().find(|link| &*link.original_text == broken_link.reference) @@ -1101,56 +1094,48 @@ fn markdown_summary_with_limit( }; let p = Parser::new_with_broken_link_callback(md, opts(), Some(&mut replacer)); - let p = LinkReplacer::new(p, link_names); + let mut p = LinkReplacer::new(p, link_names); - 'outer: for event in p { + let mut buf = HtmlWithLimit::new(length_limit); + let mut stopped_early = false; + p.try_for_each(|event| { match &event { Event::Text(text) => { - for word in text.split_inclusive(char::is_whitespace) { - if text_length + word.len() >= length_limit { - stopped_early = true; - break 'outer; - } - - push(&mut s, &mut text_length, word); + let r = + text.split_inclusive(char::is_whitespace).try_for_each(|word| buf.push(word)); + if r.is_break() { + stopped_early = true; } + return r; } Event::Code(code) => { - if text_length + code.len() >= length_limit { + buf.open_tag("code"); + let r = buf.push(code); + if r.is_break() { stopped_early = true; - break; + } else { + buf.close_tag(); } - - s.push_str(""); - push(&mut s, &mut text_length, code); - s.push_str(""); + return r; } Event::Start(tag) => match tag { - Tag::Emphasis => s.push_str(""), - Tag::Strong => s.push_str(""), - Tag::CodeBlock(..) => break, + Tag::Emphasis => buf.open_tag("em"), + Tag::Strong => buf.open_tag("strong"), + Tag::CodeBlock(..) => return ControlFlow::BREAK, _ => {} }, Event::End(tag) => match tag { - Tag::Emphasis => s.push_str(""), - Tag::Strong => s.push_str(""), - Tag::Paragraph => break, - Tag::Heading(..) => break, + Tag::Emphasis | Tag::Strong => buf.close_tag(), + Tag::Paragraph | Tag::Heading(..) => return ControlFlow::BREAK, _ => {} }, - Event::HardBreak | Event::SoftBreak => { - if text_length + 1 >= length_limit { - stopped_early = true; - break; - } - - push(&mut s, &mut text_length, " "); - } + Event::HardBreak | Event::SoftBreak => buf.push(" ")?, _ => {} - } - } + }; + ControlFlow::CONTINUE + }); - (s, stopped_early) + (buf.finish(), stopped_early) } /// Renders a shortened first paragraph of the given Markdown as a subset of Markdown, diff --git a/src/librustdoc/html/markdown/tests.rs b/src/librustdoc/html/markdown/tests.rs index 1e4bdc2d151..eca75ef013a 100644 --- a/src/librustdoc/html/markdown/tests.rs +++ b/src/librustdoc/html/markdown/tests.rs @@ -225,6 +225,7 @@ fn test_short_markdown_summary() { assert_eq!(output, expect, "original: {}", input); } + t("", ""); t("hello [Rust](https://www.rust-lang.org) :)", "hello Rust :)"); t("*italic*", "italic"); t("**bold**", "bold"); @@ -264,6 +265,7 @@ fn test_plain_text_summary() { assert_eq!(output, expect, "original: {}", input); } + t("", ""); t("hello [Rust](https://www.rust-lang.org) :)", "hello Rust :)"); t("**bold**", "bold"); t("Multi-line\nsummary", "Multi-line summary"); diff --git a/src/librustdoc/html/mod.rs b/src/librustdoc/html/mod.rs index 60ebdf5690d..109b0a356db 100644 --- a/src/librustdoc/html/mod.rs +++ b/src/librustdoc/html/mod.rs @@ -2,6 +2,7 @@ crate mod escape; crate mod format; crate mod highlight; crate mod layout; +mod length_limit; // used by the error-index generator, so it needs to be public pub mod markdown; crate mod render; diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index dab6d655c6a..f9ddef4120b 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -40,7 +40,7 @@ h4 { .code-header { color: #e6e1cf; } -pre > code { +.docblock pre > code, pre > code { color: #e6e1cf; } span code { diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 70f8b673638..de32e31ca87 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -5,6 +5,7 @@ #![feature(rustc_private)] #![feature(array_methods)] #![feature(box_patterns)] +#![feature(control_flow_enum)] #![feature(in_band_lifetimes)] #![feature(nll)] #![feature(test)] diff --git a/src/test/rustdoc-gui/ayu-code-tag-colors.goml b/src/test/rustdoc-gui/ayu-code-tag-colors.goml deleted file mode 100644 index 50af36fa3d6..00000000000 --- a/src/test/rustdoc-gui/ayu-code-tag-colors.goml +++ /dev/null @@ -1,13 +0,0 @@ -// The ayu theme has a different color for the "" tags in the doc blocks. We need to -// check that the rule isn't applied on other "" elements. -goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html -// We need to show the text, otherwise the colors aren't "computed" by the web browser. -show-text: true -// We set the theme to ayu. -local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"} -// We reload to get the text appearing and the theme applied. -reload: - -assert-css: (".docblock code", {"color": "rgb(255, 180, 84)"}, ALL) -// It includes variants and the "titles" as well (for example: "impl RefUnwindSafe for AnEnum"). -assert-css: ("div:not(.docblock) > code", {"color": "rgb(197, 197, 197)"}, ALL) diff --git a/src/test/rustdoc-gui/code-color.goml b/src/test/rustdoc-gui/code-color.goml new file mode 100644 index 00000000000..2f95bfb6b17 --- /dev/null +++ b/src/test/rustdoc-gui/code-color.goml @@ -0,0 +1,30 @@ +// The ayu theme has a different color for the "" tags in the doc blocks. We need to +// check that the rule isn't applied on other "" elements. +// +// While we're at it, we also check it for the other themes. +goto: file://|DOC_PATH|/test_docs/fn.foo.html +// If the text isn't displayed, the browser doesn't compute color style correctly... +show-text: true +// Set the theme to dark. +local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} +// We reload the page so the local storage settings are being used. +reload: + +assert-css: (".docblock pre > code", {"color": "rgb(221, 221, 221)"}, ALL) +assert-css: (".docblock > p > code", {"color": "rgb(221, 221, 221)"}, ALL) + +// Set the theme to ayu. +local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"} +// We reload the page so the local storage settings are being used. +reload: + +assert-css: (".docblock pre > code", {"color": "rgb(230, 225, 207)"}, ALL) +assert-css: (".docblock > p > code", {"color": "rgb(255, 180, 84)"}, ALL) + +// Set the theme to light. +local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} +// We reload the page so the local storage settings are being used. +reload: + +assert-css: (".docblock pre > code", {"color": "rgb(0, 0, 0)"}, ALL) +assert-css: (".docblock > p > code", {"color": "rgb(0, 0, 0)"}, ALL) diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index bed72ccb9f9..af4f28047fc 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -25,6 +25,8 @@ use std::fmt; /// ```ignore (it's a test) /// Let's say I'm just some text will ya? /// ``` +/// +/// An inlined `code`! pub fn foo() {} /// Just a normal struct. diff --git a/src/test/rustfix/closure-immutable-outer-variable.fixed b/src/test/rustfix/closure-immutable-outer-variable.fixed deleted file mode 100644 index 05bbc13d714..00000000000 --- a/src/test/rustfix/closure-immutable-outer-variable.fixed +++ /dev/null @@ -1,10 +0,0 @@ -// Point at the captured immutable outer variable - -fn foo(mut f: Box) { - f(); -} - -fn main() { - let mut y = true; - foo(Box::new(move || y = false) as Box<_>); -} diff --git a/src/test/rustfix/closure-immutable-outer-variable.rs b/src/test/rustfix/closure-immutable-outer-variable.rs deleted file mode 100644 index 6ed1bc12cb5..00000000000 --- a/src/test/rustfix/closure-immutable-outer-variable.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Point at the captured immutable outer variable - -fn foo(mut f: Box) { - f(); -} - -fn main() { - let y = true; - foo(Box::new(move || y = false) as Box<_>); -} diff --git a/src/test/rustfix/empty-no-fixes.fixed b/src/test/rustfix/empty-no-fixes.fixed deleted file mode 100644 index 3724a00ce7c..00000000000 --- a/src/test/rustfix/empty-no-fixes.fixed +++ /dev/null @@ -1 +0,0 @@ -// compile-flags:--crate-type lib diff --git a/src/test/rustfix/empty-no-fixes.rs b/src/test/rustfix/empty-no-fixes.rs deleted file mode 100644 index 3724a00ce7c..00000000000 --- a/src/test/rustfix/empty-no-fixes.rs +++ /dev/null @@ -1 +0,0 @@ -// compile-flags:--crate-type lib diff --git a/src/test/rustfix/empty-no-fixes.rs.fixed b/src/test/rustfix/empty-no-fixes.rs.fixed deleted file mode 100644 index e30d3ae0965..00000000000 --- a/src/test/rustfix/empty-no-fixes.rs.fixed +++ /dev/null @@ -1,2 +0,0 @@ -// compile-flags:--crate-type lib -fn foo() {} diff --git a/src/test/rustfix/issue-45562.fixed b/src/test/rustfix/issue-45562.fixed deleted file mode 100644 index 955b2cbf899..00000000000 --- a/src/test/rustfix/issue-45562.fixed +++ /dev/null @@ -1,3 +0,0 @@ -#[no_mangle] pub static RAH: usize = 5; - -fn main() {} diff --git a/src/test/rustfix/issue-45562.rs b/src/test/rustfix/issue-45562.rs deleted file mode 100644 index a1ac07044e2..00000000000 --- a/src/test/rustfix/issue-45562.rs +++ /dev/null @@ -1,3 +0,0 @@ -#[no_mangle] pub const RAH: usize = 5; - -fn main() {} diff --git a/src/test/rustfix/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed b/src/test/rustfix/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed deleted file mode 100644 index b4ae4dc1ab2..00000000000 --- a/src/test/rustfix/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed +++ /dev/null @@ -1,2 +0,0 @@ -extern crate std as other_std; -fn main() {} diff --git a/src/test/rustfix/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs b/src/test/rustfix/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs deleted file mode 100644 index a202b6c389a..00000000000 --- a/src/test/rustfix/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs +++ /dev/null @@ -1,2 +0,0 @@ -extern crate std; -fn main() {} diff --git a/src/test/rustfix/issue-46756-consider-borrowing-cast-or-binexpr.fixed b/src/test/rustfix/issue-46756-consider-borrowing-cast-or-binexpr.fixed deleted file mode 100644 index bedc8e15ace..00000000000 --- a/src/test/rustfix/issue-46756-consider-borrowing-cast-or-binexpr.fixed +++ /dev/null @@ -1,12 +0,0 @@ -#![allow(unused)] - -fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize { - and_yet + 1 -} - -fn main() { - let behold: isize = 2; - let with_tears: usize = 3; - light_flows_our_war_of_mocking_words(&(behold as usize)); - light_flows_our_war_of_mocking_words(&(with_tears + 4)); -} diff --git a/src/test/rustfix/issue-46756-consider-borrowing-cast-or-binexpr.rs b/src/test/rustfix/issue-46756-consider-borrowing-cast-or-binexpr.rs deleted file mode 100644 index 9c7ae9657c0..00000000000 --- a/src/test/rustfix/issue-46756-consider-borrowing-cast-or-binexpr.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![allow(unused)] - -fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize { - and_yet + 1 -} - -fn main() { - let behold: isize = 2; - let with_tears: usize = 3; - light_flows_our_war_of_mocking_words(behold as usize); - light_flows_our_war_of_mocking_words(with_tears + 4); -} diff --git a/src/test/rustfix/main-no-fixes.fixed b/src/test/rustfix/main-no-fixes.fixed deleted file mode 100644 index f328e4d9d04..00000000000 --- a/src/test/rustfix/main-no-fixes.fixed +++ /dev/null @@ -1 +0,0 @@ -fn main() {} diff --git a/src/test/rustfix/main-no-fixes.rs b/src/test/rustfix/main-no-fixes.rs deleted file mode 100644 index f328e4d9d04..00000000000 --- a/src/test/rustfix/main-no-fixes.rs +++ /dev/null @@ -1 +0,0 @@ -fn main() {} diff --git a/src/test/rustfix/main-no-fixes.rs.fixed b/src/test/rustfix/main-no-fixes.rs.fixed deleted file mode 100644 index f328e4d9d04..00000000000 --- a/src/test/rustfix/main-no-fixes.rs.fixed +++ /dev/null @@ -1 +0,0 @@ -fn main() {} diff --git a/src/test/rustfix/missing-comma-in-match.fixed b/src/test/rustfix/missing-comma-in-match.fixed deleted file mode 100644 index d4696ab9547..00000000000 --- a/src/test/rustfix/missing-comma-in-match.fixed +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - match &Some(3) { - &None => 1, - &Some(2) => { 3 } - _ => 2 - }; -} diff --git a/src/test/rustfix/missing-comma-in-match.rs b/src/test/rustfix/missing-comma-in-match.rs deleted file mode 100644 index fed796cffe6..00000000000 --- a/src/test/rustfix/missing-comma-in-match.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - match &Some(3) { - &None => 1 - &Some(2) => { 3 } - _ => 2 - }; -} diff --git a/src/test/rustfix/str-as-char.fixed b/src/test/rustfix/str-as-char.fixed deleted file mode 100644 index 900fee94653..00000000000 --- a/src/test/rustfix/str-as-char.fixed +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("●●"); -} diff --git a/src/test/rustfix/str-as-char.rs b/src/test/rustfix/str-as-char.rs deleted file mode 100644 index b446551fefa..00000000000 --- a/src/test/rustfix/str-as-char.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!('●●'); -} diff --git a/src/test/rustfix/tuple-float-index.fixed b/src/test/rustfix/tuple-float-index.fixed deleted file mode 100644 index 358a27d3878..00000000000 --- a/src/test/rustfix/tuple-float-index.fixed +++ /dev/null @@ -1,3 +0,0 @@ -fn main () { - ((1, (2, 3)).1).1; -} diff --git a/src/test/rustfix/tuple-float-index.rs b/src/test/rustfix/tuple-float-index.rs deleted file mode 100644 index 72612252a80..00000000000 --- a/src/test/rustfix/tuple-float-index.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main () { - (1, (2, 3)).1.1; -} diff --git a/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs b/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs index 3f092846dd4..7cdb16b282d 100644 --- a/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs +++ b/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs @@ -2,12 +2,36 @@ #![crate_type = "rlib"] pub fn f(b: &mut i32) { - g(&mut b); + //~^ NOTE the binding is already a mutable borrow + //~| NOTE the binding is already a mutable borrow + h(&mut b); //~^ ERROR cannot borrow + //~| NOTE cannot borrow as mutable //~| HELP try removing `&mut` here g(&mut &mut b); //~^ ERROR cannot borrow + //~| NOTE cannot borrow as mutable //~| HELP try removing `&mut` here } -pub fn g(_: &mut i32) {} +pub fn g(b: &mut i32) { //~ NOTE the binding is already a mutable borrow + h(&mut &mut b); + //~^ ERROR cannot borrow + //~| NOTE cannot borrow as mutable + //~| HELP try removing `&mut` here +} + +pub fn h(_: &mut i32) {} + +trait Foo { + fn bar(&mut self); +} + +impl Foo for &mut String { + fn bar(&mut self) {} +} + +pub fn baz(f: &mut String) { //~ HELP consider making the binding mutable + f.bar(); //~ ERROR cannot borrow `f` as mutable, as it is not declared as mutable + //~^ NOTE cannot borrow as mutable +} diff --git a/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr b/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr index cb7355b2335..e4c51bb77c9 100644 --- a/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr +++ b/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr @@ -1,21 +1,65 @@ error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable - --> $DIR/mut-borrow-of-mut-ref.rs:5:7 + --> $DIR/mut-borrow-of-mut-ref.rs:7:7 | -LL | g(&mut b); - | ^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here +LL | h(&mut b); + | ^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/mut-borrow-of-mut-ref.rs:4:13 + | +LL | pub fn f(b: &mut i32) { + | ^^^^^^^^ +help: try removing `&mut` here + | +LL - h(&mut b); +LL + h(b); + | error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable - --> $DIR/mut-borrow-of-mut-ref.rs:8:12 + --> $DIR/mut-borrow-of-mut-ref.rs:11:12 | LL | g(&mut &mut b); - | ^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here + | ^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/mut-borrow-of-mut-ref.rs:4:13 + | +LL | pub fn f(b: &mut i32) { + | ^^^^^^^^ +help: try removing `&mut` here + | +LL - g(&mut &mut b); +LL + g(&mut b); + | -error: aborting due to 2 previous errors +error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable + --> $DIR/mut-borrow-of-mut-ref.rs:18:12 + | +LL | h(&mut &mut b); + | ^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/mut-borrow-of-mut-ref.rs:17:13 + | +LL | pub fn g(b: &mut i32) { + | ^^^^^^^^ +help: try removing `&mut` here + | +LL - h(&mut &mut b); +LL + h(&mut b); + | + +error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable + --> $DIR/mut-borrow-of-mut-ref.rs:35:5 + | +LL | f.bar(); + | ^ cannot borrow as mutable + | +help: consider making the binding mutable + | +LL | pub fn baz(mut f: &mut String) { + | +++ + +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr index 838e81043db..88617381236 100644 --- a/src/test/ui/did_you_mean/issue-31424.stderr +++ b/src/test/ui/did_you_mean/issue-31424.stderr @@ -1,11 +1,19 @@ error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-31424.rs:7:9 | +LL | (&mut self).bar(); + | ^^^^^^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/issue-31424.rs:6:12 + | +LL | fn foo(&mut self) { + | ^^^^^^^^^ +help: try removing `&mut` here + --> $DIR/issue-31424.rs:7:9 + | LL | (&mut self).bar(); | ^^^^^^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here warning: function cannot return without recursing --> $DIR/issue-31424.rs:13:5 @@ -22,11 +30,19 @@ LL | (&mut self).bar(); error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-31424.rs:16:9 | +LL | (&mut self).bar(); + | ^^^^^^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/issue-31424.rs:13:18 + | +LL | fn bar(self: &mut Self) { + | ^^^^^^^^^ +help: try removing `&mut` here + --> $DIR/issue-31424.rs:16:9 + | LL | (&mut self).bar(); | ^^^^^^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here error: aborting due to 2 previous errors; 1 warning emitted diff --git a/src/test/ui/did_you_mean/issue-34126.stderr b/src/test/ui/did_you_mean/issue-34126.stderr index 669684fb3dd..666172197ce 100644 --- a/src/test/ui/did_you_mean/issue-34126.stderr +++ b/src/test/ui/did_you_mean/issue-34126.stderr @@ -2,10 +2,18 @@ error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-34126.rs:6:18 | LL | self.run(&mut self); - | ^^^^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here + | ^^^^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/issue-34126.rs:5:14 + | +LL | fn start(&mut self) { + | ^^^^^^^^^ +help: try removing `&mut` here + | +LL - self.run(&mut self); +LL + self.run(self); + | error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable --> $DIR/issue-34126.rs:6:18 diff --git a/src/test/ui/nll/issue-51191.stderr b/src/test/ui/nll/issue-51191.stderr index 450993425e2..18696f57c44 100644 --- a/src/test/ui/nll/issue-51191.stderr +++ b/src/test/ui/nll/issue-51191.stderr @@ -13,11 +13,19 @@ LL | (&mut self).bar(); error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-51191.rs:7:9 | +LL | (&mut self).bar(); + | ^^^^^^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/issue-51191.rs:4:18 + | +LL | fn bar(self: &mut Self) { + | ^^^^^^^^^ +help: try removing `&mut` here + --> $DIR/issue-51191.rs:7:9 + | LL | (&mut self).bar(); | ^^^^^^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-51191.rs:13:9 @@ -42,11 +50,19 @@ LL | (&mut self).bar(); error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-51191.rs:28:9 | +LL | (&mut self).bar(); + | ^^^^^^^^^^^ cannot borrow as mutable + | +note: the binding is already a mutable borrow + --> $DIR/issue-51191.rs:27:16 + | +LL | fn mtblref(&mut self) { + | ^^^^^^^^^ +help: try removing `&mut` here + --> $DIR/issue-51191.rs:28:9 + | LL | (&mut self).bar(); | ^^^^^^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here error: aborting due to 5 previous errors; 1 warning emitted diff --git a/src/test/ui/suggestions/if-let-typo.rs b/src/test/ui/suggestions/if-let-typo.rs index 688b6e82658..b9714b67e58 100644 --- a/src/test/ui/suggestions/if-let-typo.rs +++ b/src/test/ui/suggestions/if-let-typo.rs @@ -10,4 +10,5 @@ fn main() { if Some(3) = foo {} //~ ERROR mismatched types //~^ ERROR destructuring assignments are unstable //~^^ ERROR invalid left-hand side of assignment + if x = 5 {} //~ ERROR cannot find value `x` in this scope } diff --git a/src/test/ui/suggestions/if-let-typo.stderr b/src/test/ui/suggestions/if-let-typo.stderr index 1e23ede7adc..7f71cb48581 100644 --- a/src/test/ui/suggestions/if-let-typo.stderr +++ b/src/test/ui/suggestions/if-let-typo.stderr @@ -9,6 +9,17 @@ help: you might have meant to use pattern matching LL | if let Some(x) = foo {} | +++ +error[E0425]: cannot find value `x` in this scope + --> $DIR/if-let-typo.rs:13:8 + | +LL | if x = 5 {} + | ^ not found in this scope + | +help: you might have meant to use pattern matching + | +LL | if let x = 5 {} + | +++ + error[E0658]: destructuring assignments are unstable --> $DIR/if-let-typo.rs:4:16 | @@ -79,7 +90,7 @@ error[E0308]: mismatched types LL | if Some(3) = foo {} | ^^^^^^^^^^^^^ expected `bool`, found `()` -error: aborting due to 9 previous errors +error: aborting due to 10 previous errors Some errors have detailed explanations: E0070, E0308, E0425, E0658. For more information about an error, try `rustc --explain E0070`. diff --git a/src/test/ui/type-alias-impl-trait/static-const-types.rs b/src/test/ui/type-alias-impl-trait/static-const-types.rs new file mode 100644 index 00000000000..f630d278335 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/static-const-types.rs @@ -0,0 +1,16 @@ +#![feature(type_alias_impl_trait)] +#![allow(dead_code)] + +// FIXME: This should compile, but it currently doesn't + +use std::fmt::Debug; + +type Foo = impl Debug; +//~^ ERROR: could not find defining uses + +static FOO1: Foo = 22_u32; +//~^ ERROR: mismatched types [E0308] +const FOO2: Foo = 22_u32; +//~^ ERROR: mismatched types [E0308] + +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/static-const-types.stderr b/src/test/ui/type-alias-impl-trait/static-const-types.stderr new file mode 100644 index 00000000000..72083d014fe --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/static-const-types.stderr @@ -0,0 +1,33 @@ +error[E0308]: mismatched types + --> $DIR/static-const-types.rs:11:20 + | +LL | type Foo = impl Debug; + | ---------- the expected opaque type +... +LL | static FOO1: Foo = 22_u32; + | ^^^^^^ expected opaque type, found `u32` + | + = note: expected opaque type `impl Debug` + found type `u32` + +error[E0308]: mismatched types + --> $DIR/static-const-types.rs:13:19 + | +LL | type Foo = impl Debug; + | ---------- the expected opaque type +... +LL | const FOO2: Foo = 22_u32; + | ^^^^^^ expected opaque type, found `u32` + | + = note: expected opaque type `impl Debug` + found type `u32` + +error: could not find defining uses + --> $DIR/static-const-types.rs:8:12 + | +LL | type Foo = impl Debug; + | ^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/unsized/param-mentioned-by-different-field.rs b/src/test/ui/unsized/param-mentioned-by-different-field.rs new file mode 100644 index 00000000000..cda94b306d3 --- /dev/null +++ b/src/test/ui/unsized/param-mentioned-by-different-field.rs @@ -0,0 +1,10 @@ +// We must not allow this with our current setup as `T` +// is mentioned both in the tail of `Foo` and by another +// field. +struct Foo(Box, T); + +fn main() { + let x: Foo<[u8; 1]> = Foo(Box::new([2]), [3]); + let y: &Foo<[u8]> = &x; //~ ERROR mismatched types + assert_eq!(y.0.len(), 1); +} diff --git a/src/test/ui/unsized/param-mentioned-by-different-field.stderr b/src/test/ui/unsized/param-mentioned-by-different-field.stderr new file mode 100644 index 00000000000..d18fa6456f3 --- /dev/null +++ b/src/test/ui/unsized/param-mentioned-by-different-field.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/param-mentioned-by-different-field.rs:8:25 + | +LL | let y: &Foo<[u8]> = &x; + | ---------- ^^ expected slice `[u8]`, found array `[u8; 1]` + | | + | expected due to this + | + = note: expected reference `&Foo<[u8]>` + found reference `&Foo<[u8; 1]>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/triagebot.toml b/triagebot.toml index 81c6719647f..1e4df4d3fb7 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -102,6 +102,8 @@ message_on_add = """\ - Needs `I-nominated`? """ message_on_remove = "Issue #{number}'s prioritization request has been removed." +message_on_close = "Issue #{number} has been closed while requested for prioritization." +message_on_reopen = "Issue #{number} has been reopened." [notify-zulip."T-rustdoc"] required_labels = ["I-nominated"]