diff --git a/Cargo.lock b/Cargo.lock index 1d9a9240ccf2c..3d09068dbdf33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3590,7 +3590,7 @@ version = "0.0.0" dependencies = [ "arrayvec", "bitflags", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "ena", "indexmap", "jobserver", @@ -4374,7 +4374,7 @@ dependencies = [ name = "rustc_span" version = "0.0.0" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "md-5", "rustc_arena", "rustc_data_structures", diff --git a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs index b5a0044e9e8cd..bcc8afbfd952d 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs @@ -18,11 +18,11 @@ use rustc_infer::infer::{ use rustc_middle::hir::place::PlaceBase; use rustc_middle::mir::{ConstraintCategory, ReturnConstraint}; use rustc_middle::ty::subst::InternalSubsts; -use rustc_middle::ty::Region; use rustc_middle::ty::TypeVisitor; use rustc_middle::ty::{self, RegionVid, Ty}; +use rustc_middle::ty::{Region, TyCtxt}; use rustc_span::symbol::{kw, Ident}; -use rustc_span::Span; +use rustc_span::{Span, DUMMY_SP}; use crate::borrowck_errors; use crate::session_diagnostics::{ @@ -70,7 +70,25 @@ impl<'tcx> ConstraintDescription for ConstraintCategory<'tcx> { /// /// Usually we expect this to either be empty or contain a small number of items, so we can avoid /// allocation most of the time. -pub(crate) type RegionErrors<'tcx> = Vec>; +pub(crate) struct RegionErrors<'tcx>(Vec>, TyCtxt<'tcx>); + +impl<'tcx> RegionErrors<'tcx> { + pub fn new(tcx: TyCtxt<'tcx>) -> Self { + Self(vec![], tcx) + } + #[track_caller] + pub fn push(&mut self, val: impl Into>) { + let val = val.into(); + self.1.sess.delay_span_bug(DUMMY_SP, "{val:?}"); + self.0.push(val); + } + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + pub fn into_iter(self) -> impl Iterator> { + self.0.into_iter() + } +} #[derive(Clone, Debug)] pub(crate) enum RegionErrorKind<'tcx> { diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs index 0d03346ef0a5e..308f6e19a73e8 100644 --- a/compiler/rustc_borrowck/src/region_infer/mod.rs +++ b/compiler/rustc_borrowck/src/region_infer/mod.rs @@ -562,7 +562,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { let mir_def_id = body.source.def_id(); self.propagate_constraints(body); - let mut errors_buffer = RegionErrors::new(); + let mut errors_buffer = RegionErrors::new(infcx.tcx); // If this is a closure, we can propagate unsatisfied // `outlives_requirements` to our creator, so create a vector @@ -1647,26 +1647,29 @@ impl<'tcx> RegionInferenceContext<'tcx> { let longer_fr_scc = self.constraint_sccs.scc(longer_fr); debug!("check_bound_universal_region: longer_fr_scc={:?}", longer_fr_scc,); - // If we have some bound universal region `'a`, then the only - // elements it can contain is itself -- we don't know anything - // else about it! - let Some(error_element) = ({ - self.scc_values.elements_contained_in(longer_fr_scc).find(|element| match element { - RegionElement::Location(_) => true, - RegionElement::RootUniversalRegion(_) => true, - RegionElement::PlaceholderRegion(placeholder1) => placeholder != *placeholder1, - }) - }) else { - return; - }; - debug!("check_bound_universal_region: error_element = {:?}", error_element); + for error_element in self.scc_values.elements_contained_in(longer_fr_scc) { + match error_element { + RegionElement::Location(_) | RegionElement::RootUniversalRegion(_) => {} + // If we have some bound universal region `'a`, then the only + // elements it can contain is itself -- we don't know anything + // else about it! + RegionElement::PlaceholderRegion(placeholder1) => { + if placeholder == placeholder1 { + continue; + } + } + } - // Find the region that introduced this `error_element`. - errors_buffer.push(RegionErrorKind::BoundUniversalRegionError { - longer_fr, - error_element, - placeholder, - }); + errors_buffer.push(RegionErrorKind::BoundUniversalRegionError { + longer_fr, + error_element, + placeholder, + }); + + // Stop after the first error, it gets too noisy otherwise, and does not provide more information. + break; + } + debug!("check_bound_universal_region: all bounds satisfied"); } #[instrument(level = "debug", skip(self, infcx, errors_buffer))] diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 8d4a720f8ce9b..247607ff29e20 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -1153,16 +1153,23 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { category: ConstraintCategory<'tcx>, ) -> Fallible<()> { let annotated_type = self.user_type_annotations[user_ty.base].inferred_ty; + trace!(?annotated_type); let mut curr_projected_ty = PlaceTy::from_ty(annotated_type); let tcx = self.infcx.tcx; for proj in &user_ty.projs { + if let ty::Alias(ty::Opaque, ..) = curr_projected_ty.ty.kind() { + // There is nothing that we can compare here if we go through an opaque type. + // We're always in its defining scope as we can otherwise not project through + // it, so we're constraining it anyways. + return Ok(()); + } let projected_ty = curr_projected_ty.projection_ty_core( tcx, self.param_env, proj, - |this, field, _| { + |this, field, ()| { let ty = this.field_ty(tcx, field); self.normalize(ty, locations) }, @@ -1170,10 +1177,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { ); curr_projected_ty = projected_ty; } - debug!( - "user_ty base: {:?} freshened: {:?} projs: {:?} yields: {:?}", - user_ty.base, annotated_type, user_ty.projs, curr_projected_ty - ); + trace!(?curr_projected_ty); let ty = curr_projected_ty.ty; self.relate_types(ty, v.xform(ty::Variance::Contravariant), a, locations, category)?; diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 5afce15e26bfc..0366fb0a148c7 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] arrayvec = { version = "0.7", default-features = false } bitflags = "1.2.1" -cfg-if = "0.1.2" +cfg-if = "1.0" ena = "0.14" indexmap = { version = "1.9.1" } jobserver_crate = { version = "0.1.13", package = "jobserver" } @@ -21,7 +21,11 @@ rustc-hash = "1.1.0" rustc_index = { path = "../rustc_index", package = "rustc_index" } rustc_macros = { path = "../rustc_macros" } rustc_serialize = { path = "../rustc_serialize" } -smallvec = { version = "1.8.1", features = ["const_generics", "union", "may_dangle"] } +smallvec = { version = "1.8.1", features = [ + "const_generics", + "union", + "may_dangle", +] } stable_deref_trait = "1.0.0" stacker = "0.1.15" tempfile = "3.2" diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index 4e149fc2b9973..276f83f1f237d 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -249,6 +249,7 @@ E0464: include_str!("./error_codes/E0464.md"), E0466: include_str!("./error_codes/E0466.md"), E0468: include_str!("./error_codes/E0468.md"), E0469: include_str!("./error_codes/E0469.md"), +E0472: include_str!("./error_codes/E0472.md"), E0477: include_str!("./error_codes/E0477.md"), E0478: include_str!("./error_codes/E0478.md"), E0482: include_str!("./error_codes/E0482.md"), @@ -599,7 +600,6 @@ E0791: include_str!("./error_codes/E0791.md"), // E0467, // removed // E0470, // removed // E0471, // constant evaluation error (in pattern) - E0472, // llvm_asm! is unsupported on this target // E0473, // dereference of reference outside its lifetime // E0474, // captured variable `..` does not outlive the enclosing closure // E0475, // index of slice outside its lifetime diff --git a/compiler/rustc_error_codes/src/error_codes/E0472.md b/compiler/rustc_error_codes/src/error_codes/E0472.md new file mode 100644 index 0000000000000..0005cd41911a9 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0472.md @@ -0,0 +1,31 @@ +Inline assembly (`asm!`) is not supported on this target. + +Example of erroneous code: + +```ignore (cannot-change-target) +// compile-flags: --target sparc64-unknown-linux-gnu +#![no_std] + +use core::arch::asm; + +fn main() { + unsafe { + asm!(""); // error: inline assembly is not supported on this target + } +} +``` + +The Rust compiler does not support inline assembly, with the `asm!` macro +(previously `llvm_asm!`), for all targets. All Tier 1 targets do support this +macro but support among Tier 2 and 3 targets is not guaranteed (even when they +have `std` support). Note that this error is related to +`error[E0658]: inline assembly is not stable yet on this architecture`, but +distinct in that with `E0472` support is not planned or in progress. + +There is no way to easily fix this issue, however: + * Consider if you really need inline assembly, is there some other way to + achieve your goal (intrinsics, etc)? + * Consider writing your assembly externally, linking with it and calling it + from Rust. + * Consider contributing to and help + integrate support for your target! diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs index 7a5191b77f1d4..4ec71a78a0031 100644 --- a/compiler/rustc_hir_typeck/src/callee.rs +++ b/compiler/rustc_hir_typeck/src/callee.rs @@ -4,7 +4,7 @@ use super::{Expectation, FnCtxt, TupleArgumentsFlag}; use crate::type_error_struct; use rustc_ast::util::parser::PREC_POSTFIX; -use rustc_errors::{struct_span_err, Applicability, Diagnostic, StashKey}; +use rustc_errors::{struct_span_err, Applicability, Diagnostic, ErrorGuaranteed, StashKey}; use rustc_hir as hir; use rustc_hir::def::{self, CtorKind, Namespace, Res}; use rustc_hir::def_id::DefId; @@ -424,21 +424,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - self.report_invalid_callee(call_expr, callee_expr, callee_ty, arg_exprs); - - // This is the "default" function signature, used in case of error. - // In that case, we check each argument against "error" in order to - // set up all the node type bindings. - ( - ty::Binder::dummy(self.tcx.mk_fn_sig( - self.err_args(arg_exprs.len()).into_iter(), - self.tcx.ty_error(), - false, - hir::Unsafety::Normal, - abi::Abi::Rust, - )), - None, - ) + let err = self.report_invalid_callee(call_expr, callee_expr, callee_ty, arg_exprs); + + return self.tcx.ty_error_with_guaranteed(err); } }; @@ -591,7 +579,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { callee_expr: &'tcx hir::Expr<'tcx>, callee_ty: Ty<'tcx>, arg_exprs: &'tcx [hir::Expr<'tcx>], - ) { + ) -> ErrorGuaranteed { let mut unit_variant = None; if let hir::ExprKind::Path(qpath) = &callee_expr.kind && let Res::Def(def::DefKind::Ctor(kind, CtorKind::Const), _) @@ -720,7 +708,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err.span_label(span, label); } } - err.emit(); + err.emit() } fn confirm_deferred_closure_call( diff --git a/compiler/rustc_middle/src/mir/tcx.rs b/compiler/rustc_middle/src/mir/tcx.rs index 8d2a8f33d6aa9..599f0b9d3fab4 100644 --- a/compiler/rustc_middle/src/mir/tcx.rs +++ b/compiler/rustc_middle/src/mir/tcx.rs @@ -32,8 +32,9 @@ impl<'tcx> PlaceTy<'tcx> { /// not carry a `Ty` for `T`.) /// /// Note that the resulting type has not been normalized. + #[instrument(level = "debug", skip(tcx), ret)] pub fn field_ty(self, tcx: TyCtxt<'tcx>, f: Field) -> Ty<'tcx> { - let answer = match self.ty.kind() { + match self.ty.kind() { ty::Adt(adt_def, substs) => { let variant_def = match self.variant_index { None => adt_def.non_enum_variant(), @@ -47,9 +48,7 @@ impl<'tcx> PlaceTy<'tcx> { } ty::Tuple(tys) => tys[f.index()], _ => bug!("extracting field of non-tuple non-adt: {:?}", self), - }; - debug!("field_ty self: {:?} f: {:?} yields: {:?}", self, f, answer); - answer + } } /// Convenience wrapper around `projection_ty_core` for diff --git a/compiler/rustc_middle/src/ty/subst.rs b/compiler/rustc_middle/src/ty/subst.rs index a04b15f8cf13c..2071d01027266 100644 --- a/compiler/rustc_middle/src/ty/subst.rs +++ b/compiler/rustc_middle/src/ty/subst.rs @@ -400,6 +400,7 @@ impl<'tcx> InternalSubsts<'tcx> { } #[inline] + #[track_caller] pub fn type_at(&self, i: usize) -> Ty<'tcx> { if let GenericArgKind::Type(ty) = self[i].unpack() { ty @@ -409,6 +410,7 @@ impl<'tcx> InternalSubsts<'tcx> { } #[inline] + #[track_caller] pub fn region_at(&self, i: usize) -> ty::Region<'tcx> { if let GenericArgKind::Lifetime(lt) = self[i].unpack() { lt @@ -418,6 +420,7 @@ impl<'tcx> InternalSubsts<'tcx> { } #[inline] + #[track_caller] pub fn const_at(&self, i: usize) -> ty::Const<'tcx> { if let GenericArgKind::Const(ct) = self[i].unpack() { ct @@ -427,6 +430,7 @@ impl<'tcx> InternalSubsts<'tcx> { } #[inline] + #[track_caller] pub fn type_for_def(&self, def: &ty::GenericParamDef) -> GenericArg<'tcx> { self.type_at(def.index as usize).into() } diff --git a/compiler/rustc_mir_build/src/build/expr/as_constant.rs b/compiler/rustc_mir_build/src/build/expr/as_constant.rs index 3b7ed818dc9b7..1d96893c7a3ea 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_constant.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_constant.rs @@ -66,14 +66,14 @@ pub fn as_constant_inner<'tcx>( let literal = ConstantKind::Val(ConstValue::Scalar(Scalar::Int(lit)), ty); - Constant { span, user_ty: user_ty, literal } + Constant { span, user_ty, literal } } ExprKind::ZstLiteral { ref user_ty } => { let user_ty = user_ty.as_ref().map(push_cuta).flatten(); let literal = ConstantKind::Val(ConstValue::ZeroSized, ty); - Constant { span, user_ty: user_ty, literal } + Constant { span, user_ty, literal } } ExprKind::NamedConst { def_id, substs, ref user_ty } => { let user_ty = user_ty.as_ref().map(push_cuta).flatten(); diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index 7edcd46a34f29..f90aba80bf3cf 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -2210,7 +2210,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { BindingMode::ByValue => ty::BindingMode::BindByValue(mutability), BindingMode::ByRef(_) => ty::BindingMode::BindByReference(mutability), }; - let local = LocalDecl::<'tcx> { + let local = LocalDecl { mutability, ty: var_ty, user_ty: if user_ty.is_empty() { None } else { Some(Box::new(user_ty)) }, diff --git a/compiler/rustc_span/Cargo.toml b/compiler/rustc_span/Cargo.toml index 48a2ab0f904ac..5ce2577b63c1d 100644 --- a/compiler/rustc_span/Cargo.toml +++ b/compiler/rustc_span/Cargo.toml @@ -13,7 +13,7 @@ rustc_index = { path = "../rustc_index" } rustc_arena = { path = "../rustc_arena" } scoped-tls = "1.0" unicode-width = "0.1.4" -cfg-if = "0.1.2" +cfg-if = "1.0" tracing = "0.1" sha1 = { package = "sha-1", version = "0.10.0" } sha2 = "0.10.1" diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in index 9a08a7be0f5f7..5b2aba9aa2dc8 100644 --- a/src/bootstrap/mk/Makefile.in +++ b/src/bootstrap/mk/Makefile.in @@ -57,11 +57,6 @@ tidy: prepare: $(Q)$(BOOTSTRAP) build --stage 2 nonexistent/path/to/trigger/cargo/metadata -check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu: - $(Q)$(BOOTSTRAP) test --stage 2 --target arm-linux-androideabi -check-stage2-T-x86_64-unknown-linux-musl-H-x86_64-unknown-linux-gnu: - $(Q)$(BOOTSTRAP) test --stage 2 --target x86_64-unknown-linux-musl - TESTS_IN_2 := \ src/test/ui \ src/tools/linkchecker diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index f6c453ebe107b..68f917d352859 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -600,6 +600,9 @@ fn configure_cmake( if target.starts_with("aarch64") { // macOS uses a different name for building arm64 cfg.define("CMAKE_OSX_ARCHITECTURES", "arm64"); + } else if target.starts_with("i686") { + // macOS uses a different name for building i386 + cfg.define("CMAKE_OSX_ARCHITECTURES", "i386"); } else { cfg.define("CMAKE_OSX_ARCHITECTURES", target.triple.split('-').next().unwrap()); } diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 11e34a3fc7d1f..b2f220b057110 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -543,6 +543,7 @@ ul.block, .block li { .rustdoc .example-wrap > pre.example-line-numbers, .rustdoc .example-wrap > pre.src-line-numbers { flex-grow: 0; + min-width: fit-content; /* prevent collapsing into nothing in truncated scraped examples */ overflow: initial; text-align: right; -webkit-user-select: none; @@ -689,14 +690,10 @@ a { position: relative; } -.small-section-header:hover > .anchor { +.small-section-header:hover > .anchor, .impl:hover > .anchor, +.trait-impl:hover > .anchor, .variant:hover > .anchor { display: initial; } - -.impl:hover > .anchor, .trait-impl:hover > .anchor, .variant:hover > .anchor { - display: inline-block; - position: absolute; -} .anchor { display: none; position: absolute; diff --git a/src/test/rustdoc-gui/scrape-examples-layout.goml b/src/test/rustdoc-gui/scrape-examples-layout.goml new file mode 100644 index 0000000000000..988c911b7839a --- /dev/null +++ b/src/test/rustdoc-gui/scrape-examples-layout.goml @@ -0,0 +1,35 @@ +// Check that the line number column has the correct layout. +goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" + +// Check that it's not zero. +assert-property-false: ( + ".more-scraped-examples .scraped-example .code-wrapper .src-line-numbers", + {"clientWidth": "0"} +) + +// Check that examples with very long lines have the same width as ones that don't. +store-property: ( + clientWidth, + ".more-scraped-examples .scraped-example:nth-child(1) .code-wrapper .src-line-numbers", + "clientWidth" +) + +assert-property: ( + ".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers", + {"clientWidth": |clientWidth|} +) + +assert-property: ( + ".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers", + {"clientWidth": |clientWidth|} +) + +assert-property: ( + ".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers", + {"clientWidth": |clientWidth|} +) + +assert-property: ( + ".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers", + {"clientWidth": |clientWidth|} +) diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-1.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-1.rs index 1d1bc5002aa8f..81a48ac50c813 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-1.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-1.rs @@ -1,3 +1,13 @@ fn main() { + // all examples have same line count + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); scrape_examples::test_many(); } diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-2.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-2.rs index 1d1bc5002aa8f..c9fdf68d3be0c 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-2.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-2.rs @@ -1,3 +1,13 @@ fn main() { - scrape_examples::test_many(); + // ignore-tidy-linelength + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ } diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-3.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-3.rs index 1d1bc5002aa8f..c9fdf68d3be0c 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-3.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-3.rs @@ -1,3 +1,13 @@ fn main() { - scrape_examples::test_many(); + // ignore-tidy-linelength + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ + scrape_examples::test_many(); /* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. */ } diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-4.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-4.rs index 1d1bc5002aa8f..81a48ac50c813 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-4.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-4.rs @@ -1,3 +1,13 @@ fn main() { + // all examples have same line count + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); scrape_examples::test_many(); } diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-5.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-5.rs index 1d1bc5002aa8f..81a48ac50c813 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-5.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-5.rs @@ -1,3 +1,13 @@ fn main() { + // all examples have same line count + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); scrape_examples::test_many(); } diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-6.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-6.rs index 1d1bc5002aa8f..81a48ac50c813 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-6.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-6.rs @@ -1,3 +1,13 @@ fn main() { + // all examples have same line count + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); scrape_examples::test_many(); } diff --git a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-7.rs b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-7.rs index 1d1bc5002aa8f..81a48ac50c813 100644 --- a/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-7.rs +++ b/src/test/rustdoc-gui/src/scrape_examples/examples/check-many-7.rs @@ -1,3 +1,13 @@ fn main() { + // all examples have same line count + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); + scrape_examples::test_many(); scrape_examples::test_many(); } diff --git a/src/test/ui/asm/bad-arch.mirunsafeck.stderr b/src/test/ui/asm/bad-arch.mirunsafeck.stderr index 4aa27180758e2..d7af296152f79 100644 --- a/src/test/ui/asm/bad-arch.mirunsafeck.stderr +++ b/src/test/ui/asm/bad-arch.mirunsafeck.stderr @@ -14,3 +14,4 @@ LL | global_asm!(""); error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0472`. diff --git a/src/test/ui/asm/bad-arch.thirunsafeck.stderr b/src/test/ui/asm/bad-arch.thirunsafeck.stderr index 4aa27180758e2..d7af296152f79 100644 --- a/src/test/ui/asm/bad-arch.thirunsafeck.stderr +++ b/src/test/ui/asm/bad-arch.thirunsafeck.stderr @@ -14,3 +14,4 @@ LL | global_asm!(""); error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0472`. diff --git a/src/test/ui/type-alias-impl-trait/destructuring.rs b/src/test/ui/type-alias-impl-trait/destructuring.rs new file mode 100644 index 0000000000000..b752e58380a89 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/destructuring.rs @@ -0,0 +1,10 @@ +#![feature(type_alias_impl_trait)] + +// check-pass + +// issue: https://github.com/rust-lang/rust/issues/104551 + +fn main() { + type T = impl Sized; + let (_a, _b): T = (1u32, 2u32); +}