profile
viewpoint
Manish Goregaokar Manishearth @mozilla Berkeley, CA http://manishearth.github.io/ I work on @servo at @mozilla. @rustlang core team

immersive-web/webxr 1826

Repository for the WebXR Device API Specification.

laumann/compiletest-rs 153

An extraction of the compiletest utility from the Rust compiler

Manishearth/absolution 95

"Freedom from syn": Proc macro tools for operating on token trees

immersive-web/webxr-hand-input 44

A feature repo for working on hand input support in WebXR. Feature lead: Manish Goregaokar

Manishearth/array-init 30

Safe wrapper for initializing arrays

Manishearth/AnnoTabe 12

Annotations for tabs in Chrome

immersive-web/webxr-test-api 6

WPT testing API for WebXR

ByteCommander/ChatExchange6 5

Python2&3 API for talking to the StackExchange chat

Deependra-Patel/cs733 3

Distributed file system using Raft Consensus protocol

izgzhen/gsoc-file-support 2

Meta-tracker for my GSoC 2016 project

issue commentimmersive-web/webxr-hand-input

Have a joint set object that lets you fetch all joint poses at once

@thetuvix we're discussing this now

Manishearth

comment created time in 4 hours

issue commentw3c/i18n-request

webxr-1 2020-08-04 > 2020-08-27

Yeah, it's not a big deal if the deadline is slipped, my hope was to get reviews as soon as they can be acquired, but if it takes time it takes time.

Manishearth

comment created time in 4 hours

issue commentw3c/i18n-request

webxr-1 2020-08-04 > 2020-??-??

@aphillips My hope is in a month. We have a couple small things to wrap up and then it's all about getting these reviews.

Manishearth

comment created time in 5 hours

issue openedw3c/i18n-request

webxr-1 2020-08-04 > 2020-??-??

In the issue title above add the document name followed by the date of this request, then the date of your proposed deadline for comments.

  • name of spec to be reviewed: WebXR Device API Level 1

  • URL of spec: https://immersive-web.github.io/webxr/

  • What and when is your next expected transition? : We do not have a planned transition date yet, but we are hoping for CR soon.

  • What has changed since any previous review?: I do not think there has been a previous review.

  • Any information arising from a self-review?: Filed the checklist here. The spec largely does not deal in text and thus does not have most of these issues.

  • Where and how to file issues arising? : https://github.com/immersive-web/webxr/issues/new

  • Pointer to any explainer for the spec? : https://github.com/immersive-web/webxr/blob/master/explainer.md , and some secondary explainers for spatial tracking, input, and privacy and security

Other comments:

created time in 6 hours

issue openedimmersive-web/webxr

Internationalization review

Before we hit CR, we need to go through an internationalization review in https://w3c.github.io/i18n-drafts/techniques/shortchecklist

  • [x] ... contains any natural language text that will be read by a human (this includes error messages or other UI text, JSON strings, etc, etc),
    • We do not contain any such text
  • [x] ... allows content authors to produce typographically appealing text, either in its own right, or in association with graphics.
    • Not inherently, people can produce text in WebGL that they may display, however.
  • [x] ... allows the user to point into text, creates text fragments, concatenates text, allows the user to select or step through text (using a cursor or other methods), etc.
  • Nope
  • [x] ... allows searching or matching of text, including syntax and identifiers
  • Nope
  • [x] ... sorts text
  • Nope
  • [x] ... captures user input
  • Yes, but the user input is in the form of gestures and controller actions, not language
  • [x] ... deals with time in any way that will be read by humans and/or crosses time zone boundaries
  • Nope
  • [x] ... allows any character encoding other than UTF-8
  • Nope, we don't handle text at all
  • [x] ... defines markup
  • Nope
  • [x] ... deals with names, addresses, time & date formats, etc
  • Nope
  • [x] ... describes a format or data that is likely to need localisation
  • Nope
  • [ ] ... makes any reference to or relies on any cultural norms
    • Not that I can think of. There are "norms" on how an XR device is to be used, but those are set by the XR device and we try to be accomodating to different norms on different devices.

created time in 6 hours

issue commentservo/servo

Separate pref panel for select WebXR prefs

Can you include the hand input pref?

Manishearth

comment created time in 6 hours

push eventrust-lang/rust-clippy

GHA CI

commit sha a084e5b48fb3e37d41850514af735fb8c0f2b2ca

Automatic deploy to GitHub Pages: 80121781a3eaf75d3b7cbf54b8b4d0a419e39bbe

view details

push time in 13 hours

issue commentrust-lang/rust

Tracking Issue for intra-doc links in libstd

I'm not sure which ones you think will be broken.

jyn514

comment created time in 15 hours

pull request commentweb-platform-tests/wpt

Add a new test for updateRenderState()

Retriggered the build

svillar

comment created time in 15 hours

PullRequestEvent

PR closed web-platform-tests/wpt

Reviewers
Add a new test for updateRenderState() webxr wg-immersive-web

This PR adds a new test for the updateRenderState() algorithm described https://immersive-web.github.io/webxr/#dom-xrsession-updaterenderstate.

+96 -0

9 comments

1 changed file

svillar

pr closed time in 15 hours

pull request commentweb-platform-tests/wpt

Add a new test for updateRenderState()

Alex might not have merge access to this repo? But I do, and even with my review it's not working

svillar

comment created time in 15 hours

issue commentwhatwg/html

Table grouping should clear row spans

Also yeah I previously misunderstood when rowspan=0 applies. Given that, this may be less necessary.

Manishearth

comment created time in 15 hours

issue commentwhatwg/html

Table grouping should clear row spans

Hmm, fair. I think as written the algorithm generates a lot of extraneous rows, though. Also I suspect extraneous rows may in fact impact percentage height distribution in the layout algorithm? I'm not sure, I don't understand it as well.

Manishearth

comment created time in 15 hours

Pull request review commentzbraniecki/tinystr

Add tinystr_macros

+extern crate proc_macro;++use proc_macro::TokenStream;++fn get_value_from_token_stream(input: TokenStream) -> String {+    let val = format!("{}", input);+    if !val.starts_with('"') || !val.ends_with('"') {+        panic!("Argument must be a string literal.");+    }+    let len = val.len();+    (&val[1..len - 1]).to_string()+}++#[proc_macro]+pub fn tinystr4(input: TokenStream) -> TokenStream {+    let val = get_value_from_token_stream(input);+    let bytes: u32 = tinystr::TinyStr4::from_bytes(val.as_bytes())+        .expect("Failed to construct TinyStr from input")+        .into();+    let formula = format!("unsafe {{ tinystr::TinyStr4::new_unchecked({}) }}", bytes);

This is the problem $crate is designed to solve, and it can be used in proc macros. There's no need for gymnastics.

zbraniecki

comment created time in 17 hours

issue commentrust-lang/rust

Tracking Issue for intra-doc links in libstd

Go ahead and try the regex approach, if there are conflcits we can try and resolve them.

jyn514

comment created time in 17 hours

pull request commentrust-lang/rust

Rename intra_doc_link_resolution_failure

Renaming lints is not uncommon, library authors are expected to apply allow(unknown_lints) for that duration.

Manishearth

comment created time in 18 hours

pull request commentrust-lang/rust

Doc alias checks: ensure only items appearing in search index can use it

Nah, I don't have many opinions on doc(alias) and I trust the others

GuillaumeGomez

comment created time in 20 hours

pull request commentservo/servo

2020: Implement table map construction

r? @SimonSapin

Manishearth

comment created time in 21 hours

PR opened servo/servo

2020: Implement table map construction

Progress towards https://github.com/servo/servo/issues/27459

This PR does not do any table layout whatsoever, nor does it even construct boxes for table elements.

What this does is construct the CellMap, which makes it easy to find which cells are occupying each slot of the table. This will be useful when iterating over the table repeatedly during the layout algorithms.

+680 -59

0 comment

13 changed files

pr created time in 21 hours

push eventManishearth/servo

Manish Goregaokar

commit sha d3a729fd760bf1cdfa0f78c8bedec05375c7b8e5

Correctly handle internal display types

view details

Manish Goregaokar

commit sha 1dc6439d2bef9c5734159e295c229184c650342a

Implement correct skeleton for table traversal

view details

Manish Goregaokar

commit sha 392e8ed4aa178b74d87b1005567bd61c76f019da

Add code to fill in incoming rowspanned cells

view details

Manish Goregaokar

commit sha 8191b7eb16a245550e1a6a923b4cc87224c7a0cb

Add code for handling cells

view details

Manish Goregaokar

commit sha 54fd0d9d338fcc8d09835e864c0acb54f72f99f6

Add better Debug formatter for TableSlot

view details

Manish Goregaokar

commit sha 3f2ed5482e8403fa62a59a5de490876713a54096

Handle any remaining incoming rowspans after the current row is out of cells

view details

Manish Goregaokar

commit sha c9201860449035b47fd8078c07683dc6162910a7

Suppress warnings

view details

Manish Goregaokar

commit sha cc19f931d0db9a0ed98873e353d06b810b0aad9a

Licenses, spec links

view details

push time in 21 hours

push eventManishearth/servo

Manish Goregaokar

commit sha dda22ea49093bb072a3f0a59fdb51387670f197a

Add code to fill in incoming rowspanned cells

view details

Manish Goregaokar

commit sha a27571fff0be7e08ab8de48de16605ccc156265a

Add code for handling cells

view details

Manish Goregaokar

commit sha aa0386e5a94108c83a7ad3865d5edb871af37277

Add better Debug formatter for TableSlot

view details

Manish Goregaokar

commit sha 8dc647d7b50359b0d7d4d0db75b3003db6068177

Handle any remaining incoming rowspans after the current row is out of cells

view details

Manish Goregaokar

commit sha 2416b129a26ea212fa2e6a6f4ee323d15f55c9e0

Suppress warnings

view details

push time in 21 hours

push eventManishearth/servo

Manish Goregaokar

commit sha d7a7455a58ce104b920f286daa4378d20ee2c5e2

Suppress warnings

view details

push time in 21 hours

push eventManishearth/servo

Manish Goregaokar

commit sha b32d532506e855eefea0ac8a164be2962015b0ec

Add code for handling cells

view details

Manish Goregaokar

commit sha 44b0549efb51e17fe11628fcbee26a3981361377

Add better Debug formatter for TableSlot

view details

Manish Goregaokar

commit sha 0db3815fd735d4968ffad35322925c6298b57df1

Handle any remaining incoming rowspans after the current row is out of cells

view details

push time in 21 hours

create barnchManishearth/servo

branch : tables-2020

created branch time in a day

pull request commentrust-lang/rust

Fix intra-doc links for associated items

I am fine with it. I'm not sure if others are.

jyn514

comment created time in a day

Pull request review commentimmersive-web/layers

Fix pending layers algorithm

 This module replaces the steps given by "[=update the pending layers state=]" fr <dfn dfn-for="layers">update the pending layers state</dfn> with {{XRSession}} |session| and {{XRRenderStateInit}} |newState|, it must run the following steps:   1. If |newState|'s {{XRRenderStateInit/baseLayer}} is set:     1. If the |session| was created with "[=feature descriptor/layers=]" enabled, throw an {{NotSupportedError}} and abort these steps.-    1. If |newState|'s {{XRRenderStateInit/layers}} is not empty, throw a {{TypeError}} and abort these steps.+    1. If |newState|'s {{XRRenderStateInit/layers}} is not <code>null</code>, throw a {{NotSupportedError}}.+    1. Abort these steps.

This should just be "and abort these steps". If you want to make a nested list, the previous thing needs to end with "perform the following steps" or something, but a single-step sublist is not really common

cabanier

comment created time in a day

pull request commentservo/servo

WebXR Layers update WebIDL

@bors-servo r+

asajeffrey

comment created time in a day

pull request commentrust-lang/rust

Add support for "true"/"false" intra doc link

@bors r-

two team members are against it at this point. Maybe we should hold off unless there's strong motivation?

GuillaumeGomez

comment created time in a day

issue commentunicode-org/icu4x

Multi-layered directory structure

I like the slightly flatter one. No strong preference

sffc

comment created time in a day

pull request commentrust-lang/rust

Rollup of 7 pull requests

@bors retry yield

Manishearth

comment created time in a day

issue commentrust-lang/rust

async-std docs no longer build on recent nightlies

Oh, right!

yoshuawuyts

comment created time in a day

issue commentimmersive-web/webxr-hand-input

Have a joint set object that lets you fetch all joint poses at once

I think the issue is that there are two approaches. I can prepare a PR for both but I'm a bit busy today.

Manishearth

comment created time in a day

issue commentimmersive-web/webxr-hand-input

Have a joint set object that lets you fetch all joint poses at once

TAG discussion at https://github.com/w3ctag/design-principles/issues/231

Manishearth

comment created time in a day

issue commentw3ctag/design-principles

Discuss when APIs that take a buffer to write into are considered A-OK

There's some discussion of this for WebXR in https://github.com/immersive-web/webxr-hand-input/issues/37 . Basically, to avoid recreating 3-5 objects per joint (for 50 joints), we want to introduce an API that has outparams, either of the form:

// setup
let set = new XRJointSet(inputSource.hand, ...);
// each frame
frame.populatePoses(set, ...);
for (joint in joints) {
   let jointPosition = set[joint].position; // or `set.position[joint]`
   let jointOrientation = set[joint].orientation; // or `set.position[joint]`
}

// OR (this one is more friendly to sending the data directly to the GPU)
// setup
let positions = new Float32Array();
let orientations = new Float32Array();

// each frame
frame.getPoses(inputSource.hand.joints, positions, orientations);
for (joint in joints) {
   let jointPosition = positions[joint * 4, joint* 4 + 4];
   let jointOrientation = orientations[joint * 4, joint* 4 + 4];
}

it would be nice to know if either of these is acceptable, and if the TAG has a preference between the two.

annevk

comment created time in a day

pull request commentrust-lang/rust-clippy

Stable sort primitive

@bors r+

JarredAllen

comment created time in a day

push eventrust-lang/rust-clippy

GHA CI

commit sha 8143e3b21503f764e4eb5bfd50ee47e8e0dbc787

Automatic deploy to GitHub Pages: bbbc973a842fc515f9b22d10d103bbf2d7827697

view details

push time in a day

Pull request review commentimmersive-web/webxr-hand-input

Add privacy considerations section

 function checkOrientation(tipOrientation, metacarpalOrientation) { } ``` +## Privacy and Security Considerations++Exposing hand input poses a risk to both a user's identity and their sensitive characteristics. This API exposes details of hand, finger, and joint size, which could be used to uniquely identify a user. Beyond exposing details of hand size, this API is intended to enable gesture recognition. Gestures have been used in authentication mechanisms as a behavioral biometric, and are likely to expose uniquely identifying information about users.++Medical conditions that produce tremors in the hands may be exposed by this API, as well as whether a user is missing fingers or parts of fingers. Additionally, hand size can reveal age, and possibly gender. Finally, there's the possibility that someone might misuse this API in an attempt to infer ethnic background from hand size, which amounts to hand-based phrenology.++This API can also potentially capture sensitive inputs, e.g. capturing typed input.

This one we can fix by ensuring that hand spaces are also not active during security-blurred states

avadacatavra

comment created time in a day

PR closed rust-lang/rust

Rollup of 8 pull requests S-waiting-on-bors rollup

Successful merges:

  • #74759 (add unsigned_abs to signed integers)
  • #75056 (Lint path statements to suggest using drop when the type needs drop)
  • #75058 (Clarify reuse of a BTreeMap insert support function and treats split support likewise)
  • #75081 (Fix logging for rustdoc)
  • #75083 (Do not trigger unused_braces for while let)
  • #75086 (Use u32::from_le_bytes to fix a FIXME)
  • #75095 (ci: disable fast-fail on auto-fallible)
  • #75103 (Disable building rust-analyzer on riscv64)

Failed merges:

r? @ghost

+181 -111

4 comments

13 changed files

Manishearth

pr closed time in a day

pull request commentrust-lang/rust

Rollup of 7 pull requests

@rustbot modify labels: +rollup @bors r+ rollup=never p=5

Manishearth

comment created time in a day

PR opened rust-lang/rust

Rollup of 7 pull requests

Successful merges:

  • #74759 (add unsigned_abs to signed integers)
  • #75056 (Lint path statements to suggest using drop when the type needs drop)
  • #75058 (Clarify reuse of a BTreeMap insert support function and treats split support likewise)
  • #75081 (Fix logging for rustdoc)
  • #75083 (Do not trigger unused_braces for while let)
  • #75095 (ci: disable fast-fail on auto-fallible)
  • #75103 (Disable building rust-analyzer on riscv64)

Failed merges:

r? @ghost

+180 -102

0 comment

12 changed files

pr created time in a day

push eventManishearth/rust

Mark Rousskov

commit sha d2fc809fdb2e92581a0ecd70dec3e179dbd3439a

Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build.

view details

Manish Goregaokar

commit sha 1be0d554187e1e29beff8e93c91487fab201401e

Rollup merge of #75103 - Mark-Simulacrum:no-ra-for-riscv64, r=matklad Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build. Should permit future rust-analyzer ups (e.g., https://github.com/rust-lang/rust/pull/74813) to land.

view details

push time in a day

push eventManishearth/rust

Pietro Albini

commit sha 4657923a978df2849886f9d94f2ddd9fc05a4922

ci: disable fast-fail on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed.

view details

Manish Goregaokar

commit sha b42ab2051c114b01acbc49ec18596d82741e5a40

Rollup merge of #75095 - pietroalbini:fallible-fast-fail, r=Mark-Simulacrum ci: disable fast-fail on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed. r? @Mark-Simulacrum

view details

push time in a day

push eventManishearth/rust

Yuki Okushi

commit sha 2e5c50195aa0345e174ff9970ec58b7e154c0132

Do not trigger `unused_braces` for `while let`

view details

Manish Goregaokar

commit sha 6c23b4555993f5c0206ffcddaf453370e4da2bcb

Rollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for #75031 r? @lcnr

view details

push time in a day

push eventManishearth/rust

Joshua Nelson

commit sha e97e6fbe343d0afac795e6c13201ce31047dc219

Fix logging for rustdoc

view details

Manish Goregaokar

commit sha da8bbe48fea680bea7dbd4f214f036bf2b731c19

Rollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum Fix logging for rustdoc https://github.com/rust-lang/rust/pull/74726#issuecomment-667765557

view details

push time in a day

push eventManishearth/rust

Stein Somers

commit sha 532e7f49fc6719528d37f69373aec821b09cd478

Separate off a leafy insert function instead of lying, and split split similarly

view details

Manish Goregaokar

commit sha dcea1fb0882d96e98935aef65e146aa0b10bf4d3

Rollup merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrum Clarify reuse of a BTreeMap insert support function and treats split support likewise r? @Mark-Simulacrum

view details

push time in a day

push eventManishearth/rust

Lukas Wirth

commit sha 35d6a2ef2ba71d5ea120c2879825968babcf9a89

Lint path statements to use drop for drop types

view details

Manish Goregaokar

commit sha 30b6b8a7f75ed095b3e229aa36369ad56a436e80

Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk Lint path statements to suggest using drop when the type needs drop Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.

view details

push time in a day

push eventManishearth/rust

carbotaniuman

commit sha 784dd22aac3f58eebc73ff54ae0ea43682392e68

add `unsigned_abs` to signed integers

view details

Manish Goregaokar

commit sha 2335456d2168da9daa2464e47728af571cdc3903

Rollup merge of #74759 - carbotaniuman:uabs, r=shepmaster add `unsigned_abs` to signed integers Mentioned on rust-lang/rfcs#2914 This PR simply adds an `unsigned_abs` to signed integers function which returns the correct absolute value as a unsigned integer.

view details

push time in a day

create barnchManishearth/rust

branch : rollup-x3n642e

created branch time in a day

pull request commentrust-lang/rust-clippy

Fix ui-cargo tests in CI

@bors r+

flip1995

comment created time in a day

issue commentrust-fuzz/arbitrary

Revisit making `String`'s `Arbitrary` implementation fallible

I think it's important for fallibility to be an option since without that the fuzzer is worse at generating useful strings and also slower.

fitzgen

comment created time in a day

issue commentrust-fuzz/arbitrary

Revisit making `String`'s `Arbitrary` implementation fallible

Hmm, makes sense

fitzgen

comment created time in a day

issue commentrust-lang/rust

async-std docs no longer build on recent nightlies

Ah, makes sense, thanks.

@estebank It should have hit beta, but the stack of patches that has landed after this depending on it makes it hard to revert, and we should probably just fix it instead.

yoshuawuyts

comment created time in a day

issue commentrust-lang/rust

async-std docs no longer build on recent nightlies

@yoshuawuyts one thing I don't understand: Is this a new error on your CI, or was your CI broken before but ignored? I'm surprised this was only caught now given that the nightly that broke it was months ago, and y'all seem to be running the doc CI run on nightly.

yoshuawuyts

comment created time in a day

pull request commentrust-lang/rust-clippy

Add lint for duplicate methods of trait bounds

@bors r+

@flip1995 yeah i was going to suggest this, unfortunately suggestions removing a bound require some weird spans where you include one of the + operators, and it's icky.

wiomoc

comment created time in a day

push eventrust-lang/team

Sam Elliott

commit sha 612b730490e1aea954c1588fdf4827e374da1587

Add lenary to RISC-V team

view details

Manish Goregaokar

commit sha 4e50cae370ae1039f4b2cbf1e9e5d760823009e4

Merge pull request #395 from lenary/lenary/add-lenary-risc-v Add @lenary to RISC-V team

view details

push time in a day

PR merged rust-lang/team

Add @lenary to RISC-V team

I work on the RISC-V LLVM backend, at lowRISC (we are the official maintainers). It is useful to be tagged on bugs which may need upstream fixes, or reviews around expected functionality of the backend - this allows me to prioritise fixes.

I'm not sure who I should be cc'ing on this PR.

+7 -0

2 comments

2 changed files

lenary

pr closed time in a day

push eventrust-lang/team

Joel Palmer

commit sha 21c5ecacbb60fe7d1de7c22a8d7ebceacf99e9d3

Update email address

view details

Manish Goregaokar

commit sha 57b9e501fad3fc0ce8459c87db47f2713b6e4562

Merge pull request #397 from joelpalmer/patch-1 Update email address

view details

push time in a day

PR merged rust-lang/team

Update email address
+1 -1

0 comment

1 changed file

joelpalmer

pr closed time in a day

Pull request review commentrust-lang/rust

Disallow linking to items with a mismatched disambiguator

 impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {                             // The resolved item did not match the disambiguator; give a better error than 'not found'                             let msg = format!("unresolved link to `{}`", path_str);                             report_diagnostic(cx, &msg, &item, &dox, link_range, |diag, sp| {-                                let msg = format!("this item resolved to {} {}, which did not match the disambiguator '{}'", kind.article(), kind.descr(id), disambiguator);+                                let msg = format!("this link resolved to {} {}, which did not match the disambiguator '{}'", kind.article(), kind.descr(id), disambiguator);

I would call it the disambiguator and point it out in the source. It's not a prefix since many of these are suffixes.

jyn514

comment created time in a day

issue commentrust-lang/rust

async-std docs no longer build on recent nightlies

Oh, another thing I should note: everybody_loops had a bunch of problems with impl Trait back in the day, I kinda expected there to be something similar with rustdoc's new item-bodies skipping approach but when we were working on it I was unable to construct an example (looks like async lets you produce one). But it's worth perhaps looking at whatever everybody_loops did to fix this issue.

yoshuawuyts

comment created time in a day

pull request commentrust-lang/rust

Add support for "true"/"false" intra doc link

No that was a response to @jyn514 who wanted us to do all keywords if we do true/false.

GuillaumeGomez

comment created time in a day

Pull request review commentrust-lang/rust-clippy

Stable sort primitive

+use crate::utils::{span_lint_and_sugg, sugg::Sugg};++use if_chain::if_chain;++use rustc_errors::Applicability;+use rustc_hir::{Expr, ExprKind};+use rustc_lint::{LateContext, LateLintPass};+use rustc_middle::ty::{self, Ty};+use rustc_session::{declare_lint_pass, declare_tool_lint};++declare_clippy_lint! {+    /// **What it does:**+    /// When sorting primitive values (integers, bools, chars, as well+    /// as arrays, slices, and tuples of such items), it is better to+    /// use an unstable sort than a stable sort.+    ///+    /// **Why is this bad?**+    /// Using a stable sort consumes more memory and cpu cycles. Because+    /// values which compare equal are identical, preserving their+    /// relative order (the guarantee that a stable sort provides) means+    /// nothing, while the extra costs still apply.+    ///+    /// **Known problems:**+    /// None+    ///+    /// **Example:**+    ///+    /// ```rust+    /// let mut vec = vec![2, 1, 3];+    /// vec.sort();+    /// ```+    /// Use instead:+    /// ```rust+    /// let mut vec = vec![2, 1, 3];+    /// vec.sort_unstable();+    /// ```+    pub STABLE_SORT_PRIMITIVE,+    perf,+    "use of sort() when sort_unstable() is equivalent"+}++declare_lint_pass!(StableSortPrimitive => [STABLE_SORT_PRIMITIVE]);++/// The three "kinds" of sorts+enum SortingKind {+    Vanilla,+    /* The other kinds of lint are currently commented out because they+     * can map distinct values to equal ones. If the key function is+     * provably one-to-one, or if the Cmp function conserves equality,+     * then they could be linted on, but I don't know if we can check+     * for that. */++    /* ByKey,+     * ByCmp, */+}+impl SortingKind {+    /// The name of the stable version of this kind of sort+    fn stable_name(&self) -> &str {+        match self {+            SortingKind::Vanilla => "sort",+            /* SortingKind::ByKey => "sort_by_key",+             * SortingKind::ByCmp => "sort_by", */+        }+    }+    /// The name of the unstable version of this kind of sort+    fn unstable_name(&self) -> &str {+        match self {+            SortingKind::Vanilla => "sort_unstable",+            /* SortingKind::ByKey => "sort_unstable_by_key",+             * SortingKind::ByCmp => "sort_unstable_by", */+        }+    }+    /// Takes the name of a function call and returns the kind of sort+    /// that corresponds to that function name (or None if it isn't)+    fn from_stable_name(name: &str) -> Option<SortingKind> {+        match name {+            "sort" => Some(SortingKind::Vanilla),+            // "sort_by" => Some(SortingKind::ByCmp),+            // "sort_by_key" => Some(SortingKind::ByKey),+            _ => None,+        }+    }+}++/// A detected instance of this lint+struct LintDetection {+    slice_name: String,+    method: SortingKind,+    method_args: String,+}++/// Returns true iff the given type is a primitive which we should lint+/// on.+fn is_primitive_type(ty: Ty<'_>) -> bool {

That should be a Ref of a Slice of a Str

Can we rename this function is_recursively_primitive_type and stick it in utils somewhere?

JarredAllen

comment created time in a day

Pull request review commentrust-lang/rust-clippy

Stable sort primitive

+use crate::utils::{span_lint_and_sugg, sugg::Sugg};++use if_chain::if_chain;++use rustc_errors::Applicability;+use rustc_hir::{Expr, ExprKind};+use rustc_lint::{LateContext, LateLintPass};+use rustc_middle::ty::{self, Ty};+use rustc_session::{declare_lint_pass, declare_tool_lint};++declare_clippy_lint! {+    /// **What it does:**+    /// When sorting primitive values (integers, bools, chars, as well+    /// as arrays, slices, and tuples of such items), it is better to+    /// use an unstable sort than a stable sort.+    ///+    /// **Why is this bad?**+    /// Using a stable sort consumes more memory and cpu cycles. Because+    /// values which compare equal are identical, preserving their+    /// relative order (the guarantee that a stable sort provides) means+    /// nothing, while the extra costs still apply.+    ///+    /// **Known problems:**+    /// None+    ///+    /// **Example:**+    ///+    /// ```rust+    /// let mut vec = vec![2, 1, 3];+    /// vec.sort();+    /// ```+    /// Use instead:+    /// ```rust+    /// let mut vec = vec![2, 1, 3];+    /// vec.sort_unstable();+    /// ```+    pub STABLE_SORT_PRIMITIVE,+    perf,+    "use of sort() when sort_unstable() is equivalent"+}++declare_lint_pass!(StableSortPrimitive => [STABLE_SORT_PRIMITIVE]);++/// The three "kinds" of sorts+enum SortingKind {+    Vanilla,+    /* The other kinds of lint are currently commented out because they+     * can map distinct values to equal ones. If the key function is+     * provably one-to-one, or if the Cmp function conserves equality,+     * then they could be linted on, but I don't know if we can check+     * for that. */++    /* ByKey,+     * ByCmp, */+}+impl SortingKind {+    /// The name of the stable version of this kind of sort+    fn stable_name(&self) -> &str {+        match self {+            SortingKind::Vanilla => "sort",+            /* SortingKind::ByKey => "sort_by_key",+             * SortingKind::ByCmp => "sort_by", */+        }+    }+    /// The name of the unstable version of this kind of sort+    fn unstable_name(&self) -> &str {+        match self {+            SortingKind::Vanilla => "sort_unstable",+            /* SortingKind::ByKey => "sort_unstable_by_key",+             * SortingKind::ByCmp => "sort_unstable_by", */+        }+    }+    /// Takes the name of a function call and returns the kind of sort+    /// that corresponds to that function name (or None if it isn't)+    fn from_stable_name(name: &str) -> Option<SortingKind> {+        match name {+            "sort" => Some(SortingKind::Vanilla),+            // "sort_by" => Some(SortingKind::ByCmp),+            // "sort_by_key" => Some(SortingKind::ByKey),+            _ => None,+        }+    }+}++/// A detected instance of this lint+struct LintDetection {+    slice_name: String,+    method: SortingKind,+    method_args: String,+}++/// Returns true iff the given type is a primitive which we should lint+/// on.+fn is_primitive_type(ty: Ty<'_>) -> bool {+    match ty.kind {+        ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Str => true,+        ty::Ref(_, ref_ty, _) => is_primitive_type(ref_ty),+        ty::Array(inner_type, _) | ty::Slice(inner_type) => is_primitive_type(inner_type),+        ty::Tuple(inner_types) => inner_types.types().all(is_primitive_type),+        _ => false,+    }+}++/// Returns true iff the given expression is a slice of primitives or if+/// it is of some type that implements deref to such a slice+fn is_slice_of_primitives(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {

Can this also be in utils?

JarredAllen

comment created time in a day

Pull request review commentrust-lang/rust-clippy

Stable sort primitive

+use crate::utils::{span_lint_and_sugg, sugg::Sugg};++use if_chain::if_chain;++use rustc_errors::Applicability;+use rustc_hir::{Expr, ExprKind};+use rustc_lint::{LateContext, LateLintPass};+use rustc_middle::ty::{self, Ty};+use rustc_session::{declare_lint_pass, declare_tool_lint};++declare_clippy_lint! {+    /// **What it does:**+    /// When sorting primitive values (integers, bools, chars, as well+    /// as arrays, slices, and tuples of such items), it is better to+    /// use an unstable sort than a stable sort.+    ///+    /// **Why is this bad?**+    /// Using a stable sort consumes more memory and cpu cycles. Because+    /// values which compare equal are identical, preserving their+    /// relative order (the guarantee that a stable sort provides) means+    /// nothing, while the extra costs still apply.+    ///+    /// **Known problems:**+    /// None+    ///+    /// **Example:**+    ///+    /// ```rust+    /// let mut vec = vec![2, 1, 3];+    /// vec.sort();+    /// ```+    /// Use instead:+    /// ```rust+    /// let mut vec = vec![2, 1, 3];+    /// vec.sort_unstable();+    /// ```+    pub STABLE_SORT_PRIMITIVE,+    perf,+    "use of sort() when sort_unstable() is equivalent"+}++declare_lint_pass!(StableSortPrimitive => [STABLE_SORT_PRIMITIVE]);++/// The three "kinds" of sorts+enum SortingKind {+    Vanilla,+    /* The other kinds of lint are currently commented out because they

I would avoid using multiline comments and instead just use lots of //, it's pretty standard style in Rust or at least in this codebase.

JarredAllen

comment created time in a day

pull request commentrust-lang/rust

Add support for "true"/"false" intra doc link

I'm very against linking to all keywords, the only reason I'm somewhat okay with this one is because true and false behave kind of like paths; they operate in path positions (unlike most other keywords).

GuillaumeGomez

comment created time in a day

pull request commentrust-lang/rust

Rollup of 8 pull requests

@rustbot modify labels: +rollup @bors r+ rollup=never p=5

Manishearth

comment created time in a day

PR opened rust-lang/rust

Rollup of 8 pull requests

Successful merges:

  • #74759 (add unsigned_abs to signed integers)
  • #75056 (Lint path statements to suggest using drop when the type needs drop)
  • #75058 (Clarify reuse of a BTreeMap insert support function and treats split support likewise)
  • #75081 (Fix logging for rustdoc)
  • #75083 (Do not trigger unused_braces for while let)
  • #75086 (Use u32::from_le_bytes to fix a FIXME)
  • #75095 (ci: disable fast-fail on auto-fallible)
  • #75103 (Disable building rust-analyzer on riscv64)

Failed merges:

r? @ghost

+181 -111

0 comment

13 changed files

pr created time in a day

push eventManishearth/rust

Mark Rousskov

commit sha d2fc809fdb2e92581a0ecd70dec3e179dbd3439a

Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build.

view details

Manish Goregaokar

commit sha 5aaf07a46ec7b3bb1f8db18968885cee86026419

Rollup merge of #75103 - Mark-Simulacrum:no-ra-for-riscv64, r=matklad Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build. Should permit future rust-analyzer ups (e.g., https://github.com/rust-lang/rust/pull/74813) to land.

view details

push time in a day

push eventManishearth/rust

Pietro Albini

commit sha 4657923a978df2849886f9d94f2ddd9fc05a4922

ci: disable fast-fail on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed.

view details

Manish Goregaokar

commit sha 6bc70f1087ab592990bed3d3a766f1111372e7fa

Rollup merge of #75095 - pietroalbini:fallible-fast-fail, r=Mark-Simulacrum ci: disable fast-fail on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed. r? @Mark-Simulacrum

view details

push time in a day

push eventManishearth/rust

Lzu Tao

commit sha aca025823221f2c7d52fcc8893f69f5042edafbc

Use u32::from_le_bytes to fix a FIXME

view details

Manish Goregaokar

commit sha f414f2ab7559060b02ee660bf5e4e23492a5d1e1

Rollup merge of #75086 - lzutao:u32const, r=oli-obk Use u32::from_le_bytes to fix a FIXME `u32::from_be_bytes` has been const stable since 1.44.

view details

push time in a day

push eventManishearth/rust

Yuki Okushi

commit sha 2e5c50195aa0345e174ff9970ec58b7e154c0132

Do not trigger `unused_braces` for `while let`

view details

Manish Goregaokar

commit sha 3902bbd862098afe9789ed969fa281c045fdaf09

Rollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for #75031 r? @lcnr

view details

push time in a day

push eventManishearth/rust

Joshua Nelson

commit sha e97e6fbe343d0afac795e6c13201ce31047dc219

Fix logging for rustdoc

view details

Manish Goregaokar

commit sha 40a13825f4d76be44485d9856d295bdcba4533f8

Rollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum Fix logging for rustdoc https://github.com/rust-lang/rust/pull/74726#issuecomment-667765557

view details

push time in a day

push eventManishearth/rust

Stein Somers

commit sha 532e7f49fc6719528d37f69373aec821b09cd478

Separate off a leafy insert function instead of lying, and split split similarly

view details

Manish Goregaokar

commit sha b3e6836299c3cb1aeb4a33d97bd71b9cfe2d989d

Rollup merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrum Clarify reuse of a BTreeMap insert support function and treats split support likewise r? @Mark-Simulacrum

view details

push time in a day

push eventManishearth/rust

Lukas Wirth

commit sha 35d6a2ef2ba71d5ea120c2879825968babcf9a89

Lint path statements to use drop for drop types

view details

Manish Goregaokar

commit sha 4edd34cb6ea7d81722b66067cd6ed3b911d19457

Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk Lint path statements to suggest using drop when the type needs drop Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.

view details

push time in a day

push eventManishearth/rust

carbotaniuman

commit sha 784dd22aac3f58eebc73ff54ae0ea43682392e68

add `unsigned_abs` to signed integers

view details

Manish Goregaokar

commit sha 86d85b63203729a94cceeb8db223d0498bf66342

Rollup merge of #74759 - carbotaniuman:uabs, r=shepmaster add `unsigned_abs` to signed integers Mentioned on rust-lang/rfcs#2914 This PR simply adds an `unsigned_abs` to signed integers function which returns the correct absolute value as a unsigned integer.

view details

push time in a day

create barnchManishearth/rust

branch : rollup-phupwxa

created branch time in a day

issue commentrust-lang/rust

async-std docs no longer build on recent nightlies

Worth remembering: rustdoc does not care one bit about what the actual type of an impl Trait is, aside from the trait itself, which should already be known since that's explicitly specified (via trait or via the async keyword). So it should theoretically be possible to make this work without solving item bodies.

yoshuawuyts

comment created time in a day

pull request commentrust-lang/rust

Doc alias checks: ensure only items appearing in search index can use it

Do you want review from others? Seems like jyn and Ollie are reviewing this PR

GuillaumeGomez

comment created time in a day

pull request commentrust-lang/rust

Add support for "true"/"false" intra doc link

I think we should link to the keywords here.

But I'm kinda skeptical of doing this at all, these are keywords and not paths. Seems ok for true and false but maybe not so much for other keywords. I also see a very low utility for it, and because they're not paths, I don't expect people to reach for them aside from the bool literals (which behave kinda like paths, at least)

GuillaumeGomez

comment created time in a day

Pull request review commentrust-lang/rust

Disallow linking to items with a mismatched disambiguator

 impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {                     link.trim_start_matches(prefix)                 } else if link.ends_with("!()") {                     kind = Some(MacroNS);+                    disambiguator = Some("bang");

@jyn514 I'd rather not use DefKind because we can have multiple disambiguators, like () vs fn vs function.

A cool thing we could do, however, is somehow generate the span for the disambiguator only, and then we don't need to explicitly name it and instead can call it "the function disambiguator here^^". For perf it might be desirable to generate this only when we need to raise an error, i.e. perform a search for it after the fact and adjust the span. Idk.

jyn514

comment created time in a day

PR closed rust-lang/rust

Rollup of 5 pull requests S-waiting-on-review rollup

Successful merges:

  • #75037 (Completes support for coverage in external crates)
  • #75056 (Lint path statements to suggest using drop when the type needs drop)
  • #75081 (Fix logging for rustdoc)
  • #75083 (Do not trigger unused_braces for while let)
  • #75086 (Use u32::from_le_bytes to fix a FIXME)

Failed merges:

r? @ghost

+419 -365

4 comments

22 changed files

Manishearth

pr closed time in 2 days

pull request commentrust-lang/rust

Rollup of 5 pull requests

@rustbot modify labels: +rollup @bors r+ rollup=never p=5

Manishearth

comment created time in 2 days

PR opened rust-lang/rust

Rollup of 5 pull requests

Successful merges:

  • #75037 (Completes support for coverage in external crates)
  • #75056 (Lint path statements to suggest using drop when the type needs drop)
  • #75081 (Fix logging for rustdoc)
  • #75083 (Do not trigger unused_braces for while let)
  • #75086 (Use u32::from_le_bytes to fix a FIXME)

Failed merges:

r? @ghost

+419 -365

0 comment

22 changed files

pr created time in 2 days

push eventManishearth/rust

Lzu Tao

commit sha aca025823221f2c7d52fcc8893f69f5042edafbc

Use u32::from_le_bytes to fix a FIXME

view details

Manish Goregaokar

commit sha 7d2d7f5fba10798be17f237d857373edf8a5888c

Rollup merge of #75086 - lzutao:u32const, r=oli-obk Use u32::from_le_bytes to fix a FIXME `u32::from_be_bytes` has been const stable since 1.44.

view details

push time in 2 days

push eventManishearth/rust

Yuki Okushi

commit sha 2e5c50195aa0345e174ff9970ec58b7e154c0132

Do not trigger `unused_braces` for `while let`

view details

Manish Goregaokar

commit sha f5f0fc574228077b65b775c0aa3bd1ca28d5af3e

Rollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for #75031 r? @lcnr

view details

push time in 2 days

push eventManishearth/rust

Joshua Nelson

commit sha e97e6fbe343d0afac795e6c13201ce31047dc219

Fix logging for rustdoc

view details

Manish Goregaokar

commit sha ab21dc95d701ef2a45e07bd033c3874241eb77d4

Rollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum Fix logging for rustdoc https://github.com/rust-lang/rust/pull/74726#issuecomment-667765557

view details

push time in 2 days

push eventManishearth/rust

Lukas Wirth

commit sha 35d6a2ef2ba71d5ea120c2879825968babcf9a89

Lint path statements to use drop for drop types

view details

Manish Goregaokar

commit sha 65b0d13650a09c64fd408489a94c79e097f400ae

Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk Lint path statements to suggest using drop when the type needs drop Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.

view details

push time in 2 days

create barnchManishearth/rust

branch : rollup-zrw5oc4

created branch time in 2 days

push eventManishearth/rust

Rich Kadel

commit sha d55f927220f26a346d71a0f29bfb0d03d15aa0da

Completes support for coverage in external crates The prior PR corrected for errors encountered when trying to generate the coverage map on source code inlined from external crates (including macros and generics) by avoiding adding external DefIds to the coverage map. This made it possible to generate a coverage report including external crates, but the external crate coverage was incomplete (did not include coverage for the DefIds that were eliminated. The root issue was that the coverage map was converting Span locations to source file and locations, using the SourceMap for the current crate, and this would not work for spans from external crates (compliled with a different SourceMap). The solution was to convert the Spans to filename and location during MIR generation instead, so precompiled external crates would already have the correct source code locations embedded in their MIR, when imported into another crate.

view details

Manish Goregaokar

commit sha f7b7fa563f071aaa897e84a98e24e130ee6b1dc1

Rollup merge of #75037 - richkadel:llvm-coverage-map-gen-5.2, r=wesleywiser Completes support for coverage in external crates Follow-up to #74959 : The prior PR corrected for errors encountered when trying to generate the coverage map on source code inlined from external crates (including macros and generics) by avoiding adding external DefIds to the coverage map. This made it possible to generate a coverage report including external crates, but the external crate coverage was incomplete (did not include coverage for the DefIds that were eliminated. The root issue was that the coverage map was converting Span locations to source file and locations, using the SourceMap for the current crate, and this would not work for spans from external crates (compliled with a different SourceMap). The solution was to convert the Spans to filename and location during MIR generation instead, so precompiled external crates would already have the correct source code locations embedded in their MIR, when imported into another crate. @wesleywiser FYI r? @tmandry

view details

push time in 2 days

pull request commentrust-lang/rust

Disable stylesheet objects rather than link elements

@GuillaumeGomez right, as long as the JS occurs in the head tag it doesn't matter

The parsing is inevitable. It's the relayout you want to avoid

Cldfire

comment created time in 2 days

pull request commentweb-platform-tests/wpt

Add a new test for updateRenderState()

Alex's review should be fine

svillar

comment created time in 2 days

issue commentrequest-for-explanation/podcast

Polish rss feed

@LinusCDE I'd accept a PR doing this, I'm not actively maintaining this otherwise, sorry

Gankra

comment created time in 2 days

Pull request review commentrust-lang/rust-clippy

Add lint for duplicate methods of trait bounds

 impl<'tcx> LateLintPass<'tcx> for TraitBounds {         }     } }++fn check_trait_bound_duplication(cx: &LateContext<'_>, gen: &'_ Generics<'_>) {+    if in_macro(gen.span) {+        return;+    }++    let mut map = FxHashMap::default();

we should early return if:

  • there are no parameters
  • there are no predicates in the where clause
wiomoc

comment created time in 2 days

pull request commentrust-lang/rust-clippy

Stable sort primitive

@krishna-veerareddy I'll let you review this PR since you've already started, let me know when you think it's ready!

JarredAllen

comment created time in 2 days

issue commentrust-lang/rust

Tracking Issue for intra-doc links in libstd

Go for it!

jyn514

comment created time in 2 days

Pull request review commentrust-lang/rust

Disallow linking to items with a mismatched disambiguator

 impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {                     link.trim_start_matches(prefix)                 } else if link.ends_with("!()") {                     kind = Some(MacroNS);+                    disambiguator = Some("bang");

Can we set an enum instead of a string here (yes, it will have multiple variants for each spelling)? Bonus: we can make the kind derivation a method on it, so we just call disambiguator.kind(), and we can do the same thing with the DefKind, and we can also do the thing with the prefix-matching (something like fn strip_prefix(&mut String) -> Option<Self>)

We would have to add a method that converts it back to a useful string though. But we'd be able to nicely move a ton of code out of here.

jyn514

comment created time in 2 days

Pull request review commentrust-lang/rust

Disallow linking to items with a mismatched disambiguator

 pub fn register_res(cx: &DocContext<'_>, res: Res) -> DefId {         Res::Def(DefKind::TyAlias, i) => (i, TypeKind::Typedef),         Res::Def(DefKind::Enum, i) => (i, TypeKind::Enum),         Res::Def(DefKind::Trait, i) => (i, TypeKind::Trait),+        Res::Def(DefKind::AssocTy | DefKind::AssocFn | DefKind::AssocConst, i) => {+            (cx.tcx.parent(i).unwrap(), TypeKind::Trait)

good catch

jyn514

comment created time in 2 days

pull request commentrust-lang/rust

Disable stylesheet objects rather than link elements

On slowest computers, it's gonna be an issue for sure: the browser will have to parse and render multiple styles at once. Definitely not optimal...

No, <style disabled> does not change parsing. What it does change is whether or not the style is applied, and flipping that attribute will cause a relayout to occur. If you set it in the <head> tag this will occur before any layout has happened so there should be no observable change.

Cldfire

comment created time in 2 days

Pull request review commentrust-lang/rust

Disallow linking to items with a mismatched disambiguator

 impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {             } else {                 debug!("intra-doc link to {} resolved to {:?}", path_str, res); +                // Disallow e.g. linking to enums with `struct@`+                if let Res::Def(kind, id) = res {+                    debug!("saw kind {:?} with disambiguator {:?}", kind, disambiguator);+                    // NOTE: this relies on the fact that `''` is never parsed as a disambiguator+                    // NOTE: this needs to be kept in sync with the disambiguator parsing+                    match (kind, disambiguator.unwrap_or_default().trim_end_matches("@")) {+                        | (DefKind::Struct, "struct")+                        | (DefKind::Enum, "enum")+                        | (DefKind::Trait, "trait")+                        | (DefKind::Union, "union")+                        | (DefKind::Mod, "mod" | "module")+                        | (DefKind::Const | DefKind::ConstParam | DefKind::AssocConst | DefKind::AnonConst, "const")+                        | (DefKind::Static, "static")+                        // NOTE: this allows 'method' to mean both normal functions and associated functions+                        // This can't cause ambiguity because both are in the same namespace.+                        | (DefKind::Fn | DefKind::AssocFn, "fn" | "function" | "method")+                        | (DefKind::Macro(MacroKind::Bang), "bang")+                        | (DefKind::Macro(MacroKind::Derive), "derive")+                        // These are namespaces; allow anything in the namespace to match+                        | (_, "type" | "macro" | "value")+                        // If no disambiguator given, allow anything+                        | (_, "")+                        // All of these are valid, so do nothing+                        => {}+                        (_, disambiguator) => {+                            // The resolved item did not match the disambiguator; give a better error than 'not found'+                            let msg = format!("unresolved link to `{}`", path_str);+                            report_diagnostic(cx, &msg, &item, &dox, link_range, |diag, sp| {+                                let msg = format!("this item resolved to {} {}, which did not match the disambiguator '{}'", kind.article(), kind.descr(id), disambiguator);

Or "this path" but I prefer "this link"

jyn514

comment created time in 2 days

more