Skip to content

Rollup of 13 pull requests #89386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Sep 30, 2021
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
47c5056
Fix highlighting for union keyword
GuillaumeGomez Jul 24, 2021
ee38116
Add test for union keyword highlighting
GuillaumeGomez Jul 24, 2021
18fb97e
Remove ignore-tidy-undocumented-unsafe from core::slice::sort
mdsn Aug 25, 2021
b226d17
Fix generics where bounds order
GuillaumeGomez Sep 19, 2021
592d089
:arrow_up: rust-analyzer
lnicola Sep 27, 2021
12c3f50
PassWrapper: handle function rename from upstream D36850
durin42 Sep 27, 2021
cd0873b
Add unit assignment to MIR for `asm!()`
FabianWolff Sep 27, 2021
dd0b5f4
Clarify that `CString::from_vec_unchecked` appends 0 byte.
et342 Sep 28, 2021
830ecbd
Optimize is_sorted for Range and RangeInclusive
mbrubeck Sep 28, 2021
d2613fb
Improve help for recursion limit errors
rossmacarthur Sep 28, 2021
a0f4e78
Remove lazy_static dependency
GuillaumeGomez Sep 29, 2021
bdd3471
Remove Never variant from clean::Type enum
GuillaumeGomez Sep 27, 2021
80b4718
Update cargo
ehuss Sep 29, 2021
762f81d
Update books
ehuss Sep 29, 2021
42ea15b
Rollup merge of #87428 - GuillaumeGomez:union-highlighting, r=notriddle
ehuss Sep 30, 2021
e24f522
Rollup merge of #88412 - mdsn:slice-sort-safety, r=dtolnay
ehuss Sep 30, 2021
7c23ff2
Rollup merge of #89098 - GuillaumeGomez:where-bounds-order, r=camelid
ehuss Sep 30, 2021
8087147
Rollup merge of #89232 - rossmacarthur:fix-76424, r=wesleywiser
ehuss Sep 30, 2021
9050c54
Rollup merge of #89294 - lnicola:rust-analyzer-2021-09-27, r=lnicola
ehuss Sep 30, 2021
8dfe522
Rollup merge of #89297 - GuillaumeGomez:remove-never-from-type-enum, …
ehuss Sep 30, 2021
c5f8675
Rollup merge of #89311 - FabianWolff:issue-89305, r=oli-obk
ehuss Sep 30, 2021
403e221
Rollup merge of #89313 - durin42:llvm-14-thinLTOResolvePrevailingInMo…
ehuss Sep 30, 2021
e392f5d
Rollup merge of #89315 - et342:cstr_from_vec_unchecked_doc, r=yaahc
ehuss Sep 30, 2021
8f9f3aa
Rollup merge of #89335 - mbrubeck:range-is-sorted, r=cuviper
ehuss Sep 30, 2021
9a77b21
Rollup merge of #89366 - GuillaumeGomez:remove-lazy-static, r=jyn514
ehuss Sep 30, 2021
4bb4789
Rollup merge of #89377 - ehuss:update-cargo, r=ehuss
ehuss Sep 30, 2021
20c9530
Rollup merge of #89378 - ehuss:update-books, r=ehuss
ehuss Sep 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
@@ -633,14 +633,18 @@ impl<'a, 'b> MacroExpander<'a, 'b> {

fn error_recursion_limit_reached(&mut self) {
let expn_data = self.cx.current_expansion.id.expn_data();
let suggested_limit = self.cx.ecfg.recursion_limit * 2;
let suggested_limit = match self.cx.ecfg.recursion_limit {
Limit(0) => Limit(2),
limit => limit * 2,
};
self.cx
.struct_span_err(
expn_data.call_site,
&format!("recursion limit reached while expanding `{}`", expn_data.kind.descr()),
)
.help(&format!(
"consider adding a `#![recursion_limit=\"{}\"]` attribute to your crate (`{}`)",
"consider increasing the recursion limit by adding a \
`#![recursion_limit = \"{}\"]` attribute to your crate (`{}`)",
suggested_limit, self.cx.ecfg.crate_name,
))
.emit();
4 changes: 4 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
@@ -1572,7 +1572,11 @@ extern "C" bool
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
Module &Mod = *unwrap(M);
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
#if LLVM_VERSION_GE(14, 0)
thinLTOFinalizeInModule(Mod, DefinedGlobals, /*PropagateAttrs=*/true);
#else
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
#endif
return true;
}

9 changes: 6 additions & 3 deletions compiler/rustc_mir_build/src/build/expr/into.rs
Original file line number Diff line number Diff line change
@@ -449,8 +449,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
})
.collect();

let destination = this.cfg.start_new_block();
if !options.contains(InlineAsmOptions::NORETURN) {
this.cfg.push_assign_unit(block, source_info, destination, this.tcx);
}

let destination_block = this.cfg.start_new_block();
this.cfg.terminate(
block,
source_info,
@@ -462,11 +465,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
destination: if options.contains(InlineAsmOptions::NORETURN) {
None
} else {
Some(destination)
Some(destination_block)
},
},
);
destination.unit()
destination_block.unit()
}

// These cases don't actually need a destination
10 changes: 7 additions & 3 deletions compiler/rustc_trait_selection/src/autoderef.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ use rustc_hir as hir;
use rustc_infer::infer::InferCtxt;
use rustc_middle::ty::{self, TraitRef, Ty, TyCtxt, WithConstness};
use rustc_middle::ty::{ToPredicate, TypeFoldable};
use rustc_session::DiagnosticMessageId;
use rustc_session::{DiagnosticMessageId, Limit};
use rustc_span::def_id::LOCAL_CRATE;
use rustc_span::Span;

@@ -217,7 +217,10 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {

pub fn report_autoderef_recursion_limit_error<'tcx>(tcx: TyCtxt<'tcx>, span: Span, ty: Ty<'tcx>) {
// We've reached the recursion limit, error gracefully.
let suggested_limit = tcx.recursion_limit() * 2;
let suggested_limit = match tcx.recursion_limit() {
Limit(0) => Limit(2),
limit => limit * 2,
};
let msg = format!("reached the recursion limit while auto-dereferencing `{:?}`", ty);
let error_id = (DiagnosticMessageId::ErrorId(55), Some(span), msg);
let fresh = tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
@@ -231,7 +234,8 @@ pub fn report_autoderef_recursion_limit_error<'tcx>(tcx: TyCtxt<'tcx>, span: Spa
)
.span_label(span, "deref recursion limit reached")
.help(&format!(
"consider adding a `#![recursion_limit=\"{}\"]` attribute to your crate (`{}`)",
"consider increasing the recursion limit by adding a \
`#![recursion_limit = \"{}\"]` attribute to your crate (`{}`)",
suggested_limit,
tcx.crate_name(LOCAL_CRATE),
))
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ use rustc_middle::ty::{
Infer, InferTy, ToPredicate, Ty, TyCtxt, TypeFoldable, WithConstness,
};
use rustc_middle::ty::{TypeAndMut, TypeckResults};
use rustc_session::Limit;
use rustc_span::def_id::LOCAL_CRATE;
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{BytePos, DesugaringKind, ExpnKind, ForLoopLoc, MultiSpan, Span, DUMMY_SP};
@@ -2426,10 +2427,13 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
}

fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder<'_>) {
let current_limit = self.tcx.recursion_limit();
let suggested_limit = current_limit * 2;
let suggested_limit = match self.tcx.recursion_limit() {
Limit(0) => Limit(2),
limit => limit * 2,
};
err.help(&format!(
"consider adding a `#![recursion_limit=\"{}\"]` attribute to your crate (`{}`)",
"consider increasing the recursion limit by adding a \
`#![recursion_limit = \"{}\"]` attribute to your crate (`{}`)",
suggested_limit,
self.tcx.crate_name(LOCAL_CRATE),
));
10 changes: 10 additions & 0 deletions library/core/src/iter/range.rs
Original file line number Diff line number Diff line change
@@ -672,6 +672,11 @@ impl<A: Step> Iterator for ops::Range<A> {
self.next_back()
}

#[inline]
fn is_sorted(self) -> bool {
true
}

#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
@@ -1095,6 +1100,11 @@ impl<A: Step> Iterator for ops::RangeInclusive<A> {
fn max(mut self) -> Option<A> {
self.next_back()
}

#[inline]
fn is_sorted(self) -> bool {
true
}
}

#[stable(feature = "inclusive_range", since = "1.26.0")]
25 changes: 23 additions & 2 deletions library/core/src/slice/sort.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@
//! Unstable sorting is compatible with libcore because it doesn't allocate memory, unlike our
//! stable sorting implementation.

// ignore-tidy-undocumented-unsafe

use crate::cmp;
use crate::mem::{self, MaybeUninit};
use crate::ptr;
@@ -291,6 +289,9 @@ where
} else if start_r < end_r {
block_l = rem;
} else {
// There were the same number of elements to switch on both blocks during the last
// iteration, so there are no remaining elements on either block. Cover the remaining
// items with roughly equally-sized blocks.
block_l = rem / 2;
block_r = rem - block_l;
}
@@ -437,6 +438,17 @@ where
// Move its remaining out-of-order elements to the far right.
debug_assert_eq!(width(l, r), block_l);
while start_l < end_l {
// remaining-elements-safety
// SAFETY: while the loop condition holds there are still elements in `offsets_l`, so it
// is safe to point `end_l` to the previous element.
//
// The `ptr::swap` is safe if both its arguments are valid for reads and writes:
// - Per the debug assert above, the distance between `l` and `r` is `block_l`
// elements, so there can be at most `block_l` remaining offsets between `start_l`
// and `end_l`. This means `r` will be moved at most `block_l` steps back, which
// makes the `r.offset` calls valid (at that point `l == r`).
// - `offsets_l` contains valid offsets into `v` collected during the partitioning of
// the last block, so the `l.offset` calls are valid.
unsafe {
end_l = end_l.offset(-1);
ptr::swap(l.offset(*end_l as isize), r.offset(-1));
@@ -449,6 +461,7 @@ where
// Move its remaining out-of-order elements to the far left.
debug_assert_eq!(width(l, r), block_r);
while start_r < end_r {
// SAFETY: See the reasoning in [remaining-elements-safety].
unsafe {
end_r = end_r.offset(-1);
ptr::swap(l, r.offset(-(*end_r as isize) - 1));
@@ -481,6 +494,8 @@ where

// Read the pivot into a stack-allocated variable for efficiency. If a following comparison
// operation panics, the pivot will be automatically written back into the slice.

// SAFETY: `pivot` is a reference to the first element of `v`, so `ptr::read` is safe.
let mut tmp = mem::ManuallyDrop::new(unsafe { ptr::read(pivot) });
let _pivot_guard = CopyOnDrop { src: &mut *tmp, dest: pivot };
let pivot = &*tmp;
@@ -646,6 +661,12 @@ where

if len >= 8 {
// Swaps indices so that `v[a] <= v[b]`.
// SAFETY: `len >= 8` so there are at least two elements in the neighborhoods of
// `a`, `b` and `c`. This means the three calls to `sort_adjacent` result in
// corresponding calls to `sort3` with valid 3-item neighborhoods around each
// pointer, which in turn means the calls to `sort2` are done with valid
// references. Thus the `v.get_unchecked` calls are safe, as is the `ptr::swap`
// call.
let mut sort2 = |a: &mut usize, b: &mut usize| unsafe {
if is_less(v.get_unchecked(*b), v.get_unchecked(*a)) {
ptr::swap(a, b);
2 changes: 2 additions & 0 deletions library/std/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
@@ -409,6 +409,8 @@ impl CString {
/// Creates a C-compatible string by consuming a byte vector,
/// without checking for interior 0 bytes.
///
/// Trailing 0 byte will be appended by this function.
///
/// This method is equivalent to [`CString::new`] except that no runtime
/// assertion is made that `v` contains no 0 bytes, and it requires an
/// actual byte vector, not anything that can be converted to one with Into.
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 76 files
+4 −4 .github/workflows/main.yml
+1 −5 listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
+1 −2 listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt
+1 −5 listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt
+1 −5 listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt
+2 −5 listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt
+0 −2 listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs
+1 −5 listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt
+1 −5 listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt
+1 −5 listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt
+1 −5 listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt
+1 −5 listings/ch04-understanding-ownership/listing-04-06/output.txt
+1 −5 listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt
+1 −5 listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt
+1 −5 listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt
+1 −5 listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt
+1 −5 listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt
+1 −6 listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt
+10 −12 listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt
+2 −7 listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt
+1 −5 listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt
+1 −5 listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt
+1 −5 listings/ch07-managing-growing-projects/listing-07-03/output.txt
+1 −5 listings/ch07-managing-growing-projects/listing-07-05/output.txt
+1 −5 listings/ch08-common-collections/listing-08-07/output.txt
+1 −5 listings/ch08-common-collections/listing-08-19/output.txt
+1 −5 listings/ch09-error-handling/no-listing-02-ask-compiler-for-type/output.txt
+11 −15 listings/ch09-error-handling/no-listing-06-question-mark-in-main/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-fixing-listing-10-05/output.txt
+1 −5 listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/output.txt
+1 −1 listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/output.txt
+1 −2 listings/ch12-an-io-project/listing-12-12/output.txt
+1 −5 listings/ch12-an-io-project/output-only-02-missing-lifetimes/output.txt
+1 −5 listings/ch13-functional-features/listing-13-08/output.txt
+1 −2 listings/ch13-functional-features/listing-13-17/output.txt
+1 −5 listings/ch13-functional-features/no-listing-02-functions-cant-capture/output.txt
+1 −5 listings/ch13-functional-features/no-listing-03-move-closures/output.txt
+1 −5 listings/ch15-smart-pointers/listing-15-03/output.txt
+1 −5 listings/ch15-smart-pointers/listing-15-09/output.txt
+1 −5 listings/ch15-smart-pointers/listing-15-15/output.txt
+1 −5 listings/ch15-smart-pointers/listing-15-17/output.txt
+1 −5 listings/ch15-smart-pointers/listing-15-21/output.txt
+1 −5 listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt
+1 −5 listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt
+1 −5 listings/ch16-fearless-concurrency/listing-16-03/output.txt
+1 −5 listings/ch16-fearless-concurrency/listing-16-09/output.txt
+1 −5 listings/ch16-fearless-concurrency/listing-16-13/output.txt
+1 −5 listings/ch16-fearless-concurrency/listing-16-14/output.txt
+1 −5 listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt
+1 −5 listings/ch17-oop/listing-17-10/output.txt
+3 −7 listings/ch17-oop/no-listing-01-trait-object-of-clone/output.txt
+1 −5 listings/ch18-patterns-and-matching/listing-18-05/output.txt
+1 −5 listings/ch18-patterns-and-matching/listing-18-08/output.txt
+1 −2 listings/ch18-patterns-and-matching/listing-18-10/output.txt
+1 −5 listings/ch18-patterns-and-matching/listing-18-25/output.txt
+1 −5 listings/ch19-advanced-features/listing-19-05/output.txt
+6 −8 listings/ch19-advanced-features/listing-19-20/output.txt
+1 −5 listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/output.txt
+1 −5 listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt
+1 −5 listings/ch19-advanced-features/output-only-01-missing-unsafe/output.txt
+1 −5 listings/ch20-web-server/listing-20-12/output.txt
+1 −5 listings/ch20-web-server/listing-20-17/output.txt
+1 −5 listings/ch20-web-server/listing-20-22/output.txt
+1 −5 listings/ch20-web-server/no-listing-01-define-threadpool-struct/output.txt
+1 −5 listings/ch20-web-server/no-listing-02-impl-threadpool-new/output.txt
+1 −5 listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt
+1 −1 rust-toolchain
+1 −1 src/appendix-02-operators.md
+1 −1 src/ch17-01-what-is-oo.md
+1 −1 src/title-page.md
+3 −0 tools/update-rustc.sh
2 changes: 1 addition & 1 deletion src/doc/nomicon
Submodule nomicon updated 1 files
+2 −2 src/lifetimes.md
2 changes: 1 addition & 1 deletion src/doc/reference
2 changes: 1 addition & 1 deletion src/doc/rust-by-example
4 changes: 2 additions & 2 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
@@ -1313,7 +1313,7 @@ impl Clean<Type> for hir::Ty<'_> {
use rustc_hir::*;

match self.kind {
TyKind::Never => Never,
TyKind::Never => Primitive(PrimitiveType::Never),
TyKind::Ptr(ref m) => RawPointer(m.mutbl, box m.ty.clean(cx)),
TyKind::Rptr(ref l, ref m) => {
// There are two times a `Fresh` lifetime can be created:
@@ -1402,7 +1402,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
trace!("cleaning type: {:?}", self);
let ty = normalize(cx, self).unwrap_or(self);
match *ty.kind() {
ty::Never => Never,
ty::Never => Primitive(PrimitiveType::Never),
ty::Bool => Primitive(PrimitiveType::Bool),
ty::Char => Primitive(PrimitiveType::Char),
ty::Int(int_ty) => Primitive(int_ty.into()),
10 changes: 6 additions & 4 deletions src/librustdoc/clean/simplify.rs
Original file line number Diff line number Diff line change
@@ -11,8 +11,7 @@
//! This module attempts to reconstruct the original where and/or parameter
//! bounds by special casing scenarios such as these. Fun!

use std::collections::BTreeMap;

use rustc_data_structures::fx::FxIndexMap;
use rustc_hir::def_id::DefId;
use rustc_middle::ty;
use rustc_span::Symbol;
@@ -23,8 +22,11 @@ use crate::clean::WherePredicate as WP;
use crate::core::DocContext;

crate fn where_clauses(cx: &DocContext<'_>, clauses: Vec<WP>) -> Vec<WP> {
// First, partition the where clause into its separate components
let mut params: BTreeMap<_, (Vec<_>, Vec<_>)> = BTreeMap::new();
// First, partition the where clause into its separate components.
//
// We use `FxIndexMap` so that the insertion order is preserved to prevent messing up to
// the order of the generated bounds.
let mut params: FxIndexMap<Symbol, (Vec<_>, Vec<_>)> = FxIndexMap::default();
let mut lifetimes = Vec::new();
let mut equalities = Vec::new();
let mut tybounds = Vec::new();
3 changes: 0 additions & 3 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
@@ -1396,7 +1396,6 @@ crate enum Type {
Slice(Box<Type>),
/// The `String` field is about the size or the constant representing the array's length.
Array(Box<Type>, String),
Never,
RawPointer(Mutability, Box<Type>),
BorrowedRef {
lifetime: Option<Lifetime>,
@@ -1462,7 +1461,6 @@ impl Type {
}
RawPointer(..) => Some(PrimitiveType::RawPointer),
BareFunction(..) => Some(PrimitiveType::Fn),
Never => Some(PrimitiveType::Never),
_ => None,
}
}
@@ -1550,7 +1548,6 @@ impl Type {
}
}
BareFunction(..) => PrimitiveType::Fn,
Never => PrimitiveType::Never,
Slice(..) => PrimitiveType::Slice,
Array(..) => PrimitiveType::Array,
RawPointer(..) => PrimitiveType::RawPointer,
6 changes: 3 additions & 3 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ use rustc_span::symbol::sym;
use rustc_span::Span;

use std::cell::RefCell;
use std::lazy::SyncLazy;
use std::mem;
use std::rc::Rc;

@@ -271,9 +272,8 @@ crate fn create_config(
providers.typeck_item_bodies = |_, _| {};
// hack so that `used_trait_imports` won't try to call typeck
providers.used_trait_imports = |_, _| {
lazy_static! {
static ref EMPTY_SET: FxHashSet<LocalDefId> = FxHashSet::default();
}
static EMPTY_SET: SyncLazy<FxHashSet<LocalDefId>> =
SyncLazy::new(FxHashSet::default);
&EMPTY_SET
};
// In case typeck does end up being called, don't ICE in case there were name resolution errors
4 changes: 3 additions & 1 deletion src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
@@ -761,6 +761,9 @@ fn fmt_type<'cx>(
fmt::Display::fmt(&tybounds(bounds, lt, cx), f)
}
clean::Infer => write!(f, "_"),
clean::Primitive(clean::PrimitiveType::Never) => {
primitive_link(f, PrimitiveType::Never, "!", cx)
}
clean::Primitive(prim) => primitive_link(f, prim, &*prim.as_sym().as_str(), cx),
clean::BareFunction(ref decl) => {
if f.alternate() {
@@ -819,7 +822,6 @@ fn fmt_type<'cx>(
primitive_link(f, PrimitiveType::Array, &format!("; {}]", Escape(n)), cx)
}
}
clean::Never => primitive_link(f, PrimitiveType::Never, "!", cx),
clean::RawPointer(m, ref t) => {
let m = match m {
hir::Mutability::Mut => "mut",
70 changes: 65 additions & 5 deletions src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ use crate::clean::PrimitiveType;
use crate::html::escape::Escape;
use crate::html::render::Context;

use std::collections::VecDeque;
use std::fmt::{Display, Write};
use std::iter::Peekable;

use rustc_lexer::{LiteralKind, TokenKind};
use rustc_span::edition::Edition;
@@ -201,10 +201,57 @@ fn get_real_ident_class(text: &str, edition: Edition, allow_path_keywords: bool)
})
}

/// This iterator comes from the same idea than "Peekable" except that it allows to "peek" more than
/// just the next item by using `peek_next`. The `peek` method always returns the next item after
/// the current one whereas `peek_next` will return the next item after the last one peeked.
///
/// You can use both `peek` and `peek_next` at the same time without problem.
struct PeekIter<'a> {
stored: VecDeque<(TokenKind, &'a str)>,
/// This position is reinitialized when using `next`. It is used in `peek_next`.
peek_pos: usize,
iter: TokenIter<'a>,
}

impl PeekIter<'a> {
fn new(iter: TokenIter<'a>) -> Self {
Self { stored: VecDeque::new(), peek_pos: 0, iter }
}
/// Returns the next item after the current one. It doesn't interfer with `peek_next` output.
fn peek(&mut self) -> Option<&(TokenKind, &'a str)> {
if self.stored.is_empty() {
if let Some(next) = self.iter.next() {
self.stored.push_back(next);
}
}
self.stored.front()
}
/// Returns the next item after the last one peeked. It doesn't interfer with `peek` output.
fn peek_next(&mut self) -> Option<&(TokenKind, &'a str)> {
self.peek_pos += 1;
if self.peek_pos - 1 < self.stored.len() {
self.stored.get(self.peek_pos - 1)
} else if let Some(next) = self.iter.next() {
self.stored.push_back(next);
self.stored.back()
} else {
None
}
}
}

impl Iterator for PeekIter<'a> {
type Item = (TokenKind, &'a str);
fn next(&mut self) -> Option<Self::Item> {
self.peek_pos = 0;
if let Some(first) = self.stored.pop_front() { Some(first) } else { self.iter.next() }
}
}

/// Processes program tokens, classifying strings of text by highlighting
/// category (`Class`).
struct Classifier<'a> {
tokens: Peekable<TokenIter<'a>>,
tokens: PeekIter<'a>,
in_attribute: bool,
in_macro: bool,
in_macro_nonterminal: bool,
@@ -218,7 +265,7 @@ impl<'a> Classifier<'a> {
/// Takes as argument the source code to HTML-ify, the rust edition to use and the source code
/// file span which will be used later on by the `span_correspondance_map`.
fn new(src: &str, edition: Edition, file_span: Span) -> Classifier<'_> {
let tokens = TokenIter { src }.peekable();
let tokens = PeekIter::new(TokenIter { src });
Classifier {
tokens,
in_attribute: false,
@@ -369,7 +416,7 @@ impl<'a> Classifier<'a> {
// Assume that '&' or '*' is the reference or dereference operator
// or a reference or pointer type. Unless, of course, it looks like
// a logical and or a multiplication operator: `&&` or `* `.
TokenKind::Star => match lookahead {
TokenKind::Star => match self.peek() {
Some(TokenKind::Whitespace) => Class::Op,
_ => Class::RefKeyWord,
},
@@ -480,6 +527,9 @@ impl<'a> Classifier<'a> {
None => match text {
"Option" | "Result" => Class::PreludeTy,
"Some" | "None" | "Ok" | "Err" => Class::PreludeVal,
// "union" is a weak keyword and is only considered as a keyword when declaring
// a union type.
"union" if self.check_if_is_union_keyword() => Class::KeyWord,
_ if self.in_macro_nonterminal => {
self.in_macro_nonterminal = false;
Class::MacroNonTerminal
@@ -500,7 +550,17 @@ impl<'a> Classifier<'a> {
}

fn peek(&mut self) -> Option<TokenKind> {
self.tokens.peek().map(|(toke_kind, _text)| *toke_kind)
self.tokens.peek().map(|(token_kind, _text)| *token_kind)
}

fn check_if_is_union_keyword(&mut self) -> bool {
while let Some(kind) = self.tokens.peek_next().map(|(token_kind, _text)| token_kind) {
if *kind == TokenKind::Whitespace {
continue;
}
return *kind == TokenKind::Ident;
}
false
}
}

8 changes: 8 additions & 0 deletions src/librustdoc/html/highlight/fixtures/union.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<span class="kw">union</span> <span class="ident">Foo</span> {
<span class="ident">i</span>: <span class="ident">i8</span>,
<span class="ident">u</span>: <span class="ident">i8</span>,
}

<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">union</span> <span class="op">=</span> <span class="number">0</span>;
}
8 changes: 8 additions & 0 deletions src/librustdoc/html/highlight/fixtures/union.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
union Foo {
i: i8,
u: i8,
}

fn main() {
let union = 0;
}
10 changes: 10 additions & 0 deletions src/librustdoc/html/highlight/tests.rs
Original file line number Diff line number Diff line change
@@ -54,3 +54,13 @@ let y = Self::whatever;";
expect_file!["fixtures/highlight.html"].assert_eq(&html.into_inner());
});
}

#[test]
fn test_union_highlighting() {
create_default_session_globals_then(|| {
let src = include_str!("fixtures/union.rs");
let mut html = Buffer::new();
write_code(&mut html, src, Edition::Edition2018, None);
expect_file!["fixtures/union.html"].assert_eq(&html.into_inner());
});
}
1 change: 0 additions & 1 deletion src/librustdoc/html/render/cache.rs
Original file line number Diff line number Diff line change
@@ -244,7 +244,6 @@ fn get_index_type_name(clean_type: &clean::Type, accept_generic: bool) -> Option
| clean::Tuple(_)
| clean::Slice(_)
| clean::Array(_, _)
| clean::Never
| clean::RawPointer(_, _)
| clean::QPath { .. }
| clean::Infer
2 changes: 1 addition & 1 deletion src/librustdoc/json/conversions.rs
Original file line number Diff line number Diff line change
@@ -417,13 +417,13 @@ impl FromWithTcx<clean::Type> for Type {
}
}
Generic(s) => Type::Generic(s.to_string()),
Primitive(clean::PrimitiveType::Never) => Type::Never,
Primitive(p) => Type::Primitive(p.as_sym().to_string()),
BareFunction(f) => Type::FunctionPointer(Box::new((*f).into_tcx(tcx))),
Tuple(t) => Type::Tuple(t.into_iter().map(|x| x.into_tcx(tcx)).collect()),
Slice(t) => Type::Slice(Box::new((*t).into_tcx(tcx))),
Array(t, s) => Type::Array { type_: Box::new((*t).into_tcx(tcx)), len: s },
ImplTrait(g) => Type::ImplTrait(g.into_iter().map(|x| x.into_tcx(tcx)).collect()),
Never => Type::Never,
Infer => Type::Infer,
RawPointer(mutability, type_) => Type::RawPointer {
mutable: mutability == ast::Mutability::Mut,
2 changes: 0 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@
#![recursion_limit = "256"]
#![warn(rustc::internal)]

#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate tracing;

14 changes: 14 additions & 0 deletions src/test/ui/asm/issue-89305.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Regression test for #89305, where a variable was erroneously reported
// as both unused and possibly-uninitialized.

// check-pass

#![feature(asm)]
#![warn(unused)]

fn main() {
unsafe {
let x: () = asm!("nop");
//~^ WARNING: unused variable: `x`
}
}
15 changes: 15 additions & 0 deletions src/test/ui/asm/issue-89305.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
warning: unused variable: `x`
--> $DIR/issue-89305.rs:11:13
|
LL | let x: () = asm!("nop");
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
note: the lint level is defined here
--> $DIR/issue-89305.rs:7:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ LL | | type U = str;
LL | | }
| |_^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`hr_associated_type_bound_2`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`)
note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
--> $DIR/hr-associated-type-bound-2.rs:11:6
|
@@ -24,7 +24,7 @@ error[E0275]: overflow evaluating the requirement `for<'b> u32: X<'b>`
LL | type U = str;
| ^^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`hr_associated_type_bound_2`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`)
note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
--> $DIR/hr-associated-type-bound-2.rs:11:6
|
2 changes: 1 addition & 1 deletion src/test/ui/autoref-autoderef/issue-38940.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0055]: reached the recursion limit while auto-dereferencing `J`
LL | let x: &Bottom = &t;
| ^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="20"]` attribute to your crate (`issue_38940`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`issue_38940`)

error[E0308]: mismatched types
--> $DIR/issue-38940.rs:43:22
2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/recursion_limit.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `K: Send`
LL | is_send::<A>();
| ^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="20"]` attribute to your crate (`recursion_limit`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`recursion_limit`)
note: required because it appears within the type `J`
--> $DIR/recursion_limit.rs:24:9
|
2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/recursion_limit_deref.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0055]: reached the recursion limit while auto-dereferencing `J`
LL | let x: &Bottom = &t;
| ^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="20"]` attribute to your crate (`recursion_limit_deref`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`recursion_limit_deref`)

error[E0308]: mismatched types
--> $DIR/recursion_limit_deref.rs:50:22
2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/recursion_limit_macro.stderr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ LL | ($t:tt $($tail:tt)*) => { recurse!($($tail)*) };
LL | recurse!(0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9);
| -------------------------------------------------- in this macro invocation
|
= help: consider adding a `#![recursion_limit="20"]` attribute to your crate (`recursion_limit_macro`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`recursion_limit_macro`)
= note: this error originates in the macro `recurse` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0055.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
LL | ref_foo.foo();
| ^^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="8"]` attribute to your crate (`E0055`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`E0055`)

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0275.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `Bar<Bar<Bar<Bar<Bar<Bar<Bar<B
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`E0275`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`E0275`)
note: required because of the requirements on the impl of `Foo` for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/E0275.rs:5:9
|
6 changes: 3 additions & 3 deletions src/test/ui/infinite/infinite-autoderef.stderr
Original file line number Diff line number Diff line change
@@ -12,15 +12,15 @@ error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
LL | Foo.foo;
| ^^^^^^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`infinite_autoderef`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_autoderef`)

error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
--> $DIR/infinite-autoderef.rs:25:9
|
LL | Foo.foo;
| ^^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`infinite_autoderef`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_autoderef`)

error[E0609]: no field `foo` on type `Foo`
--> $DIR/infinite-autoderef.rs:25:9
@@ -34,7 +34,7 @@ error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
LL | Foo.bar();
| ^^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`infinite_autoderef`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_autoderef`)

error[E0599]: no method named `bar` found for struct `Foo` in the current scope
--> $DIR/infinite-autoderef.rs:26:9
2 changes: 1 addition & 1 deletion src/test/ui/infinite/infinite-macro-expansion.stderr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ LL | () => (recursive!())
LL | recursive!()
| ------------ in this macro invocation
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`infinite_macro_expansion`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_macro_expansion`)
= note: this error originates in the macro `recursive` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-16098.stderr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ LL | $n + prob1!($n - 1);
LL | println!("Problem 1: {}", prob1!(1000));
| ------------ in this macro invocation
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_16098`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_16098`)
= note: this error originates in the macro `prob1` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-18400.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `_: Sized`
LL | 0.contains(bits);
| ^^^^^^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_18400`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_18400`)
note: required because of the requirements on the impl of `Set<&[_]>` for `{integer}`
--> $DIR/issue-18400.rs:6:16
|
12 changes: 6 additions & 6 deletions src/test/ui/issues/issue-20413.stderr
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<N
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-20413.rs:8:9
|
@@ -33,7 +33,7 @@ error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<N
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-20413.rs:8:9
|
@@ -53,7 +53,7 @@ error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<Eve
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-20413.rs:28:9
|
@@ -78,7 +78,7 @@ error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<Eve
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-20413.rs:28:9
|
@@ -103,7 +103,7 @@ error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<Alm
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-20413.rs:36:9
|
@@ -128,7 +128,7 @@ error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<Alm
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-20413.rs:36:9
|
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-23122-2.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
LL | type Next = <GetNext<T::Next> as Next>::Next;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_23122_2`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`)
note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>`
--> $DIR/issue-23122-2.rs:8:15
|
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ macro_rules! a {
(A) => (concat!("", a!()));
(A, $($A:ident),*) => (concat!("", a!($($A),*)))
//~^ ERROR recursion limit reached
//~| HELP consider adding
//~| HELP consider increasing the recursion limit
}

fn main() {
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ LL | (A, $($A:ident),*) => (concat!("", a!($($A),*)))
LL | a!(A, A, A, A, A, A, A, A, A, A, A);
| ------------------------------------ in this macro invocation
|
= help: consider adding a `#![recursion_limit="30"]` attribute to your crate (`issue_84632_eager_expansion_recursion_limit`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "30"]` attribute to your crate (`issue_84632_eager_expansion_recursion_limit`)
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
2 changes: 1 addition & 1 deletion src/test/ui/macros/trace_faulty_macros.stderr
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ LL | my_recursive_macro!();
LL | my_recursive_macro!();
| ---------------------- in this macro invocation
|
= help: consider adding a `#![recursion_limit="8"]` attribute to your crate (`trace_faulty_macros`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`trace_faulty_macros`)
= note: this error originates in the macro `my_recursive_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

note: trace_macro
2 changes: 1 addition & 1 deletion src/test/ui/recursion/issue-83150.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error[E0275]: overflow evaluating the requirement `Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>: Iterator`
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_83150`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`)
= note: required because of the requirements on the impl of `Iterator` for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>`

error: aborting due to previous error
6 changes: 6 additions & 0 deletions src/test/ui/recursion_limit/no-value.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Test the parse error for no value provided to recursion_limit

#![recursion_limit]
//~^ ERROR malformed `recursion_limit` attribute input

fn main() {}
8 changes: 8 additions & 0 deletions src/test/ui/recursion_limit/no-value.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: malformed `recursion_limit` attribute input
--> $DIR/no-value.rs:3:1
|
LL | #![recursion_limit]
| ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![recursion_limit = "N"]`

error: aborting due to previous error

7 changes: 7 additions & 0 deletions src/test/ui/recursion_limit/zero-overflow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//~ ERROR overflow evaluating the requirement `&mut Self: DispatchFromDyn<&mut RustaceansAreAwesome>
//~| HELP consider increasing the recursion limit
// build-fail

#![recursion_limit = "0"]

fn main() {}
7 changes: 7 additions & 0 deletions src/test/ui/recursion_limit/zero-overflow.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
error[E0275]: overflow evaluating the requirement `&mut Self: DispatchFromDyn<&mut RustaceansAreAwesome>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`zero_overflow`)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
2 changes: 1 addition & 1 deletion src/test/ui/recursion_limit/zero.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error: recursion limit reached while expanding `test!`
LL | test!(test);
| ^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="0"]` attribute to your crate (`zero`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`zero`)

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/traits/mutual-recursion-issue-75860.stderr
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `Option<_>: Sized`
LL | iso(left, right)
| ^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`mutual_recursion_issue_75860`)
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`mutual_recursion_issue_75860`)
note: required by a bound in `Option`
--> $SRC_DIR/core/src/option.rs:LL:COL
|
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer