diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index bce9ba12ac0c4..5c32dd372dde1 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -261,14 +261,16 @@ pub enum DefPathData { // they are treated specially by the `def_path` function. /// The crate root (marker). CrateRoot, - // Catch-all for random `DefId` things like `DUMMY_NODE_ID`. - Misc, // Different kinds of items and item-like things: /// An impl. Impl, /// An `extern` block. ForeignMod, + /// A `use` item. + Use, + /// A global asm item. + GlobalAsm, /// Something in the type namespace. TypeNs(Symbol), /// Something in the value namespace. @@ -443,9 +445,8 @@ impl DefPathData { match *self { TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name), - Impl | ForeignMod | CrateRoot | Misc | ClosureExpr | Ctor | AnonConst | ImplTrait => { - None - } + Impl | ForeignMod | CrateRoot | Use | GlobalAsm | ClosureExpr | Ctor | AnonConst + | ImplTrait => None, } } @@ -459,7 +460,8 @@ impl DefPathData { CrateRoot => DefPathDataName::Anon { namespace: kw::Crate }, Impl => DefPathDataName::Anon { namespace: kw::Impl }, ForeignMod => DefPathDataName::Anon { namespace: kw::Extern }, - Misc => DefPathDataName::Anon { namespace: sym::misc }, + Use => DefPathDataName::Anon { namespace: kw::Use }, + GlobalAsm => DefPathDataName::Anon { namespace: sym::global_asm }, ClosureExpr => DefPathDataName::Anon { namespace: sym::closure }, Ctor => DefPathDataName::Anon { namespace: sym::constructor }, AnonConst => DefPathDataName::Anon { namespace: sym::constant }, diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 0e30998388d31..c4e0ebdc63876 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1994,6 +1994,7 @@ impl<'tcx> TyCtxt<'tcx> { .filter(|item| item.kind == AssocKind::Fn && item.defaultness.has_value()) } + /// Look up the name of a definition across crates. This does not look at HIR. fn opt_item_name(self, def_id: DefId) -> Option { if let Some(cnum) = def_id.as_crate_root() { Some(self.crate_name(cnum)) @@ -2014,16 +2015,11 @@ impl<'tcx> TyCtxt<'tcx> { /// Look up the name of a definition across crates. This does not look at HIR. /// - /// When possible, this function should be used for cross-crate lookups over - /// [`opt_item_name`] to avoid invalidating the incremental cache. If you - /// need to handle items without a name, or HIR items that will not be - /// serialized cross-crate, or if you need the span of the item, use + /// This method will ICE if the corresponding item does not have a name. In these cases, use /// [`opt_item_name`] instead. /// /// [`opt_item_name`]: Self::opt_item_name pub fn item_name(self, id: DefId) -> Symbol { - // Look at cross-crate items first to avoid invalidating the incremental cache - // unless we have to. self.opt_item_name(id).unwrap_or_else(|| { bug!("item_name: no name for {:?}", self.def_path(id)); }) diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 1e8cca6122c4c..f0861103098d2 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -109,7 +109,7 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> { visit::walk_item(self, i); return self.visit_macro_invoc(i.id); } - ItemKind::GlobalAsm(..) => DefPathData::Misc, + ItemKind::GlobalAsm(..) => DefPathData::GlobalAsm, ItemKind::Use(..) => { return visit::walk_item(self, i); } @@ -160,11 +160,11 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> { } fn visit_use_tree(&mut self, use_tree: &'a UseTree, id: NodeId, _nested: bool) { - self.create_def(id, DefPathData::Misc, use_tree.span); + self.create_def(id, DefPathData::Use, use_tree.span); match use_tree.kind { UseTreeKind::Simple(_, id1, id2) => { - self.create_def(id1, DefPathData::Misc, use_tree.prefix.span); - self.create_def(id2, DefPathData::Misc, use_tree.prefix.span); + self.create_def(id1, DefPathData::Use, use_tree.prefix.span); + self.create_def(id2, DefPathData::Use, use_tree.prefix.span); } UseTreeKind::Glob => (), UseTreeKind::Nested(..) => {} diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index c8fdf363f053e..e1e14011e52b4 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -788,7 +788,8 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> { // These should never show up as `path_append` arguments. DefPathData::CrateRoot - | DefPathData::Misc + | DefPathData::Use + | DefPathData::GlobalAsm | DefPathData::Impl | DefPathData::MacroNs(_) | DefPathData::LifetimeNs(_) => { diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs index 290b7f0d08a72..f27970eaaf122 100644 --- a/library/std/src/os/windows/io/handle.rs +++ b/library/std/src/os/windows/io/handle.rs @@ -22,8 +22,10 @@ use crate::sys_common::{AsInner, FromInner, IntoInner}; /// so it can be used in FFI in places where a handle is passed as an argument, /// it is not captured or consumed. /// -/// Note that it *may* have the value `INVALID_HANDLE_VALUE` (-1), which is -/// sometimes a valid handle value. See [here] for the full story. +/// Note that it *may* have the value `-1`, which in `BorrowedHandle` always +/// represents a valid handle value, such as [the current process handle], and +/// not `INVALID_HANDLE_VALUE`, despite the two having the same value. See +/// [here] for the full story. /// /// And, it *may* have the value `NULL` (0), which can occur when consoles are /// detached from processes, or when `windows_subsystem` is used. @@ -33,6 +35,7 @@ use crate::sys_common::{AsInner, FromInner, IntoInner}; /// handle, which is then borrowed under the same lifetime. /// /// [here]: https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443 +/// [the current process handle]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#remarks #[derive(Copy, Clone)] #[repr(transparent)] #[unstable(feature = "io_safety", issue = "87074")] @@ -45,8 +48,10 @@ pub struct BorrowedHandle<'handle> { /// /// This closes the handle on drop. /// -/// Note that it *may* have the value `INVALID_HANDLE_VALUE` (-1), which is -/// sometimes a valid handle value. See [here] for the full story. +/// Note that it *may* have the value `-1`, which in `OwnedHandle` always +/// represents a valid handle value, such as [the current process handle], and +/// not `INVALID_HANDLE_VALUE`, despite the two having the same value. See +/// [here] for the full story. /// /// And, it *may* have the value `NULL` (0), which can occur when consoles are /// detached from processes, or when `windows_subsystem` is used. @@ -59,6 +64,7 @@ pub struct BorrowedHandle<'handle> { /// [`RegCloseKey`]: https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regclosekey /// /// [here]: https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443 +/// [the current process handle]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#remarks #[repr(transparent)] #[unstable(feature = "io_safety", issue = "87074")] pub struct OwnedHandle { @@ -75,11 +81,13 @@ pub struct OwnedHandle { /// `NULL`. This ensures that such FFI calls cannot start using the handle without /// checking for `NULL` first. /// -/// This type considers any value other than `NULL` to be valid, including `INVALID_HANDLE_VALUE`. -/// This is because APIs that use `NULL` as their sentry value don't treat `INVALID_HANDLE_VALUE` -/// as special. +/// This type may hold any handle value that [`OwnedHandle`] may hold. As with `OwnedHandle`, when +/// it holds `-1`, that value is interpreted as a valid handle value, such as +/// [the current process handle], and not `INVALID_HANDLE_VALUE`. /// -/// If this holds a valid handle, it will close the handle on drop. +/// If this holds a non-null handle, it will close the handle on drop. +/// +/// [the current process handle]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#remarks #[repr(transparent)] #[unstable(feature = "io_safety", issue = "87074")] #[derive(Debug)] @@ -95,11 +103,10 @@ pub struct HandleOrNull(OwnedHandle); /// `INVALID_HANDLE_VALUE`. This ensures that such FFI calls cannot start using the handle without /// checking for `INVALID_HANDLE_VALUE` first. /// -/// This type considers any value other than `INVALID_HANDLE_VALUE` to be valid, including `NULL`. -/// This is because APIs that use `INVALID_HANDLE_VALUE` as their sentry value may return `NULL` -/// under `windows_subsystem = "windows"` or other situations where I/O devices are detached. +/// This type may hold any handle value that [`OwnedHandle`] may hold, except that when it holds +/// `-1`, that value is interpreted to mean `INVALID_HANDLE_VALUE`. /// -/// If this holds a valid handle, it will close the handle on drop. +/// If holds a handle other than `INVALID_HANDLE_VALUE`, it will close the handle on drop. #[repr(transparent)] #[unstable(feature = "io_safety", issue = "87074")] #[derive(Debug)] diff --git a/library/std/src/os/windows/io/raw.rs b/library/std/src/os/windows/io/raw.rs index 68fa8918a56a0..49e4f304f5dba 100644 --- a/library/std/src/os/windows/io/raw.rs +++ b/library/std/src/os/windows/io/raw.rs @@ -32,8 +32,15 @@ pub trait AsRawHandle { /// raw handle to the caller, and the handle is only guaranteed /// to be valid while the original object has not yet been destroyed. /// + /// This function may return null, such as when called on [`Stdin`], + /// [`Stdout`], or [`Stderr`] when the console is detached. + /// /// However, borrowing is not strictly required. See [`AsHandle::as_handle`] /// for an API which strictly borrows a handle. + /// + /// [`Stdin`]: io::Stdin + /// [`Stdout`]: io::Stdout + /// [`Stderr`]: io::Stderr #[stable(feature = "rust1", since = "1.0.0")] fn as_raw_handle(&self) -> RawHandle; } diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md index 952d8ef48fe57..df95325c83d5d 100644 --- a/src/doc/rustc/src/SUMMARY.md +++ b/src/doc/rustc/src/SUMMARY.md @@ -15,12 +15,12 @@ - [Platform Support](platform-support.md) - [Template for target-specific documentation](platform-support/TEMPLATE.md) - [aarch64-apple-ios-sim](platform-support/aarch64-apple-ios-sim.md) - - [aarch64-unknown-none-hermitkernel](platform-support/aarch64-unknown-none-hermitkernel.md) - [armv7-unknown-linux-uclibceabi](platform-support/armv7-unknown-linux-uclibceabi.md) - [armv7-unknown-linux-uclibceabihf](platform-support/armv7-unknown-linux-uclibceabihf.md) - [\*-kmc-solid_\*](platform-support/kmc-solid.md) - [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md) - [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md) + - [nvptx64-nvidia-cuda](platform-support/nvptx64-nvidia-cuda.md) - [*-unknown-openbsd](platform-support/openbsd.md) - [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md) - [x86_64-unknown-none](platform-support/x86_64-unknown-none.md) diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 7754d626e209e..b596adf32c6fd 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -119,7 +119,7 @@ window.initSearch = rawSearchIndex => { */ let searchIndex; let currentResults; - const ALIASES = {}; + const ALIASES = Object.create(null); const params = searchState.getQueryStringParams(); // Populate search bar with query string search term when provided, @@ -1953,7 +1953,7 @@ window.initSearch = rawSearchIndex => { } if (aliases) { - ALIASES[crate] = {}; + ALIASES[crate] = Object.create(null); for (const alias_name in aliases) { if (!hasOwnPropertyRustdoc(aliases, alias_name)) { continue; diff --git a/src/test/mir-opt/inline/cycle.g.Inline.diff b/src/test/mir-opt/inline/cycle.g.Inline.diff index 46f5e5e20655b..450157e64284f 100644 --- a/src/test/mir-opt/inline/cycle.g.Inline.diff +++ b/src/test/mir-opt/inline/cycle.g.Inline.diff @@ -4,22 +4,55 @@ fn g() -> () { let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:11:8: 11:8 let _1: (); // in scope 0 at $DIR/cycle.rs:12:5: 12:12 ++ let mut _2: fn() {main}; // in scope 0 at $DIR/cycle.rs:12:5: 12:12 ++ let mut _5: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8 ++ scope 1 (inlined f::) { // at $DIR/cycle.rs:12:5: 12:12 ++ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7 ++ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6 ++ scope 2 (inlined >::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8 ++ } ++ } bb0: { StorageLive(_1); // scope 0 at $DIR/cycle.rs:12:5: 12:12 - _1 = f::(main) -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 12:12 - // mir::Constant - // + span: $DIR/cycle.rs:12:5: 12:6 - // + literal: Const { ty: fn(fn() {main}) {f::}, val: Value(Scalar()) } +- _1 = f::(main) -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 12:12 ++ StorageLive(_2); // scope 0 at $DIR/cycle.rs:12:5: 12:12 ++ _2 = main; // scope 0 at $DIR/cycle.rs:12:5: 12:12 // mir::Constant +- // + span: $DIR/cycle.rs:12:5: 12:6 +- // + literal: Const { ty: fn(fn() {main}) {f::}, val: Value(Scalar()) } +- // mir::Constant // + span: $DIR/cycle.rs:12:7: 12:11 // + literal: Const { ty: fn() {main}, val: Value(Scalar()) } ++ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6 ++ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6 ++ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ _5 = const (); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { ++ StorageDead(_2); // scope 0 at $DIR/cycle.rs:12:5: 12:12 StorageDead(_1); // scope 0 at $DIR/cycle.rs:12:12: 12:13 _0 = const (); // scope 0 at $DIR/cycle.rs:11:8: 13:2 return; // scope 0 at $DIR/cycle.rs:13:2: 13:2 ++ } ++ ++ bb2 (cleanup): { ++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ } ++ ++ bb3 (cleanup): { ++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 ++ } ++ ++ bb4: { ++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9 ++ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2 } } diff --git a/src/test/mir-opt/inline/cycle.main.Inline.diff b/src/test/mir-opt/inline/cycle.main.Inline.diff index c8d1448d949d4..5e2f70799e41e 100644 --- a/src/test/mir-opt/inline/cycle.main.Inline.diff +++ b/src/test/mir-opt/inline/cycle.main.Inline.diff @@ -4,22 +4,72 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:16:11: 16:11 let _1: (); // in scope 0 at $DIR/cycle.rs:17:5: 17:9 ++ let mut _2: fn() {g}; // in scope 0 at $DIR/cycle.rs:17:5: 17:9 ++ let mut _5: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8 ++ scope 1 (inlined f::) { // at $DIR/cycle.rs:17:5: 17:9 ++ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7 ++ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6 ++ scope 2 (inlined >::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8 ++ scope 3 (inlined g) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL ++ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:12:5: 12:12 ++ scope 4 (inlined f::) { // at $DIR/cycle.rs:12:5: 12:12 ++ debug g => _6; // in scope 4 at $DIR/cycle.rs:5:6: 5:7 ++ let _7: (); // in scope 4 at $DIR/cycle.rs:6:5: 6:8 ++ let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:6:5: 6:6 ++ scope 5 (inlined >::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8 ++ } ++ } ++ } ++ } ++ } bb0: { StorageLive(_1); // scope 0 at $DIR/cycle.rs:17:5: 17:9 - _1 = f::(g) -> bb1; // scope 0 at $DIR/cycle.rs:17:5: 17:9 - // mir::Constant - // + span: $DIR/cycle.rs:17:5: 17:6 - // + literal: Const { ty: fn(fn() {g}) {f::}, val: Value(Scalar()) } +- _1 = f::(g) -> bb1; // scope 0 at $DIR/cycle.rs:17:5: 17:9 ++ StorageLive(_2); // scope 0 at $DIR/cycle.rs:17:5: 17:9 ++ _2 = g; // scope 0 at $DIR/cycle.rs:17:5: 17:9 // mir::Constant +- // + span: $DIR/cycle.rs:17:5: 17:6 +- // + literal: Const { ty: fn(fn() {g}) {f::}, val: Value(Scalar()) } +- // mir::Constant // + span: $DIR/cycle.rs:17:7: 17:8 // + literal: Const { ty: fn() {g}, val: Value(Scalar()) } ++ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6 ++ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6 ++ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ _5 = const (); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ StorageLive(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12 ++ StorageLive(_7); // scope 4 at $DIR/cycle.rs:6:5: 6:8 ++ StorageLive(_8); // scope 4 at $DIR/cycle.rs:6:5: 6:6 ++ _8 = &_6; // scope 4 at $DIR/cycle.rs:6:5: 6:6 ++ _7 = move (*_8)() -> [return: bb4, unwind: bb2]; // scope 5 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { ++ StorageDead(_2); // scope 0 at $DIR/cycle.rs:17:5: 17:9 StorageDead(_1); // scope 0 at $DIR/cycle.rs:17:9: 17:10 _0 = const (); // scope 0 at $DIR/cycle.rs:16:11: 18:2 return; // scope 0 at $DIR/cycle.rs:18:2: 18:2 ++ } ++ ++ bb2 (cleanup): { ++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ } ++ ++ bb3 (cleanup): { ++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 ++ } ++ ++ bb4: { ++ StorageDead(_8); // scope 4 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_7); // scope 4 at $DIR/cycle.rs:6:8: 6:9 ++ StorageDead(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12 ++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9 ++ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2 } } diff --git a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff index fddf7e6e1f0a7..267f53a8dfe7b 100644 --- a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff @@ -4,20 +4,13 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/inline-cycle-generic.rs:8:11: 8:11 let _1: (); // in scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 -+ scope 1 (inlined ::call) { // at $DIR/inline-cycle-generic.rs:9:5: 9:24 -+ scope 2 (inlined as Call>::call) { // at $DIR/inline-cycle-generic.rs:38:9: 38:31 -+ } -+ } bb0: { StorageLive(_1); // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 -- _1 = ::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 -+ _1 = ::call() -> bb1; // scope 2 at $DIR/inline-cycle-generic.rs:31:9: 31:28 + _1 = ::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 // mir::Constant -- // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22 -- // + literal: Const { ty: fn() {::call}, val: Value(Scalar()) } -+ // + span: $DIR/inline-cycle-generic.rs:31:9: 31:26 -+ // + literal: Const { ty: fn() {::call}, val: Value(Scalar()) } + // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22 + // + literal: Const { ty: fn() {::call}, val: Value(Scalar()) } } bb1: { diff --git a/src/test/rustdoc-js/prototype.js b/src/test/rustdoc-js/prototype.js new file mode 100644 index 0000000000000..2f1d841c3be19 --- /dev/null +++ b/src/test/rustdoc-js/prototype.js @@ -0,0 +1,16 @@ +// exact-check + +const QUERY = ['constructor', '__proto__']; + +const EXPECTED = [ + { + 'others': [], + 'returned': [], + 'in_args': [], + }, + { + 'others': [], + 'returned': [], + 'in_args': [], + }, +]; diff --git a/src/test/rustdoc-js/prototype.rs b/src/test/rustdoc-js/prototype.rs new file mode 100644 index 0000000000000..5f6d73cc19626 --- /dev/null +++ b/src/test/rustdoc-js/prototype.rs @@ -0,0 +1,4 @@ +// The alias needed to be there to reproduce the bug +// that used to be here. +#[doc(alias="other_alias")] +pub fn something_else() {} diff --git a/src/test/ui/macros/macro-comma-support-rpass.rs b/src/test/ui/macros/macro-comma-support-rpass.rs index f6c4f896d67c1..25b8c3cc62e16 100644 --- a/src/test/ui/macros/macro-comma-support-rpass.rs +++ b/src/test/ui/macros/macro-comma-support-rpass.rs @@ -192,6 +192,12 @@ fn line() { let _ = line!(); } +#[test] +fn matches() { + let _ = matches!(1, x if x > 0); + let _ = matches!(1, x if x > 0,); +} + #[test] fn module_path() { let _ = module_path!(); diff --git a/src/test/ui/symbol-names/basic.legacy.stderr b/src/test/ui/symbol-names/basic.legacy.stderr index e4d58d3ccdb29..3ad4ed24cf7fc 100644 --- a/src/test/ui/symbol-names/basic.legacy.stderr +++ b/src/test/ui/symbol-names/basic.legacy.stderr @@ -1,10 +1,10 @@ -error: symbol-name(_ZN5basic4main17h87acd86b3a6f1754E) +error: symbol-name(_ZN5basic4main17hcbad207c0eeb0b3bE) --> $DIR/basic.rs:8:1 | LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(basic::main::h87acd86b3a6f1754) +error: demangling(basic::main::hcbad207c0eeb0b3b) --> $DIR/basic.rs:8:1 | LL | #[rustc_symbol_name] diff --git a/src/test/ui/symbol-names/issue-60925.legacy.stderr b/src/test/ui/symbol-names/issue-60925.legacy.stderr index c987ebc534302..21bf21ee71c6f 100644 --- a/src/test/ui/symbol-names/issue-60925.legacy.stderr +++ b/src/test/ui/symbol-names/issue-60925.legacy.stderr @@ -1,10 +1,10 @@ -error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h8d22952c45e20d65E) +error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h2f2efcf580c9b1eeE) --> $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(issue_60925::foo::Foo::foo::h8d22952c45e20d65) +error: demangling(issue_60925::foo::Foo::foo::h2f2efcf580c9b1ee) --> $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] diff --git a/src/test/ui/traits/object/enforce-supertrait-projection.rs b/src/test/ui/traits/object/enforce-supertrait-projection.rs index 0ea944ec2df55..2c9b41eea2abe 100644 --- a/src/test/ui/traits/object/enforce-supertrait-projection.rs +++ b/src/test/ui/traits/object/enforce-supertrait-projection.rs @@ -7,7 +7,7 @@ trait Trait: SuperTrait::B> {} fn transmute(x: A) -> B { foo::>(x) - //~^ ERROR type mismatch resolving ` as SuperTrait>::A == B` + //~^ ERROR type mismatch resolving ` as SuperTrait>::A == B` } fn foo(x: T::A) -> B diff --git a/src/test/ui/traits/object/enforce-supertrait-projection.stderr b/src/test/ui/traits/object/enforce-supertrait-projection.stderr index a3d17fabbe47f..eab42ca568a04 100644 --- a/src/test/ui/traits/object/enforce-supertrait-projection.stderr +++ b/src/test/ui/traits/object/enforce-supertrait-projection.stderr @@ -1,4 +1,4 @@ -error[E0271]: type mismatch resolving ` as SuperTrait>::A == B` +error[E0271]: type mismatch resolving ` as SuperTrait>::A == B` --> $DIR/enforce-supertrait-projection.rs:9:5 | LL | fn transmute(x: A) -> B {