profile
viewpoint
varkor varkor https://varkor.github.io/blog/ Type theorist and Rust compiler developer.

varkor/DISTORT 3

A small game demonstrating a grid distortion effect

varkor/Epilog 3

A toy Prolog compiler

ocrawford555/teamOscarSSE 2

Simulated Stock Exchange for Part IB Group Project

varkor/chalk 1

A PROLOG-ish interpreter written in Rust, intended eventually for use in the compiler

varkor/acs-category-theory-notes-2017 0

Cambridge ACS Category Theory, Type Theory, and Logic - lecture notes 2017.

varkor/bitflags 0

A macro to generate structures which behave like bitflags

varkor/blog 0

A small blog about type theory and mathematics

varkor/book 0

The Rust Programming Language

issue commentrust-lang/rust

Cannot use `use Self::*;` inside a method

@Centril: could you point out where in #61682 this is mentioned? I couldn't spot it by glancing through, though the discussion thread is quite long, so I could easily have missed it.

varkor

comment created time in 5 hours

push eventvarkor/quiver

varkor

commit sha 3f58f15dcf8938ce0d0ce48cc58238005e0307c9

Use query parameter for share URL This is slightly more flexible and only costs an extra couple of characters. The only format is still accepted, but no longer exported.

view details

varkor

commit sha 8eea74f53628d48a115ffda37d40af28c0de6afe

Add KaTeX manually

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 3f58f15dcf8938ce0d0ce48cc58238005e0307c9

Use query parameter for share URL This is slightly more flexible and only costs an extra couple of characters. The only format is still accepted, but no longer exported.

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 38dff5c689b271d38b8478edfed5e2256852e823

Use query parameter for share URL This is slightly more flexible and only costs an extra couple of characters. The only format is still accepted, but no longer exported.

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 4f65f06c0914f6c9c35757f290b3a0e42ad4ad49

Add titles to radio buttons Hopefully this aids accessibility, whilst also making the pullback/pushout edge type slightly more discoverable.

view details

varkor

commit sha 9e63cb45555e40938852759b4b01eb0e9a8975ca

Add KaTeX manually

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 4f65f06c0914f6c9c35757f290b3a0e42ad4ad49

Add titles to radio buttons Hopefully this aids accessibility, whilst also making the pullback/pushout edge type slightly more discoverable.

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 39ba687f471b217ba94cd0f859953b3c0afa156b

Add titles to radio buttons Hopefully this aids accessibility, whilst also making the pullback/pushout edge type slightly more discoverable.

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 30d0c49045a053de69c735c62c62ac8abb9c90e0

Add background to curve

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha fe16a5dc66a2f51205d39a7a268151368f93d2bc

Add a preliminary label

view details

push time in a day

push eventvarkor/quiver

varkor

commit sha 84307e6cace5b577e70a9dd15897de2a21a87eca

Draw the grid with canvas instead of a CSS background This will facilitate the grid rows and columns to be made proportional to the size of their content.

view details

varkor

commit sha 0a1bff5fa9834d94ff3332c676188280e38d34a0

Fix an issue with the insertion point not disappearing when the cursor is moved

view details

varkor

commit sha 5fea6c9882aa10148895b164e794376721e95832

Hide the insertion point when panning

view details

varkor

commit sha 44be9fa4fa8968c1afd2c30b4f20b1c9496cb839

Fix a false error when releasing certain configurations of cells

view details

varkor

commit sha 9785546919618650ef6769a146fb2c389999bc9a

Improve the sizing of the bottom panel

view details

varkor

commit sha c38f127c0c613c49998a712b07eb8b90260a87d4

Minor cleanup

view details

varkor

commit sha 8d798e193779431681b7da053a2af1b997010385

Start implementing curves from scratch

view details

varkor

commit sha e7ec4aded0cf72787c2adc4d9a7745f9f9657e73

Draw n-cells and arrow heads

view details

varkor

commit sha a081daf7bdf23ddf7409854450d3cb835172e6cf

Special-case flat Bézier curves

view details

varkor

commit sha 80e25e4e02ac24f8d01c3aaa736779782ccdf7f4

Resize SVG appropriately

view details

varkor

commit sha 183110985271abaca1f27affd0f63b8c9eb30a80

Make a start on different arrow styles

view details

varkor

commit sha d162c0a07e6c287ecce9b6a4aa5c5c3bd20b7e2d

Add explicit namespace to SVGs

view details

varkor

commit sha d53d4f7b043432a95f336a541be62f17730fb55e

Preliminary work on squiggly arrows

view details

push time in a day

pull request commentrust-lang/rust

recursion_limit parsing handles overflows

@fisherdarling: thanks for bearing with all the comments! This looks good to go now! And thanks @hellow554 for helping with the review.

@bors r=varkor,hellow554 rollup

fisherdarling

comment created time in 2 days

create barnchvarkor/quiver

branch : centre-view

created branch time in 2 days

delete branch varkor/rust

delete branch : infer-binary-operand-behind-reference

delete time in 3 days

push eventvarkor/quiver

varkor

commit sha 546dfef4c29ad091b3f8b1e14e7e5df6e34889ee

Minor cleanup

view details

varkor

commit sha 0d8887cc568ef0287d91c718f9f70a51f3b94815

Allow the grid visibility to be toggled with `H` This makes taking pretty screenshots easier.

view details

varkor

commit sha 9177d64b13c6f070b206a0e3cda9a7d20e78375e

Add KaTeX manually

view details

push time in 5 days

push eventvarkor/quiver

varkor

commit sha 546dfef4c29ad091b3f8b1e14e7e5df6e34889ee

Minor cleanup

view details

varkor

commit sha 0d8887cc568ef0287d91c718f9f70a51f3b94815

Allow the grid visibility to be toggled with `H` This makes taking pretty screenshots easier.

view details

push time in 5 days

issue commentvarkor/quiver

Curved arrows

For now, we'll use this issue to also track adding loops, as these features will probably be added at similar times. Both require rewriting the arrow rendering system, which is not flexible enough at present.

varkor

comment created time in 5 days

push eventvarkor/quiver

varkor

commit sha 4c97a9146446bd6372056cbe4636c632def2d48c

Allow the grid visibility to be toggled with `H` This makes taking pretty screenshots easier.

view details

push time in 5 days

push eventvarkor/quiver

varkor

commit sha 8062d43898271a6a9c81f495a65b9141be7e9c76

Allow the grid visibility to be toggled with `H` This makes taking pretty screenshots easier.

view details

push time in 5 days

push eventvarkor/quiver

varkor

commit sha aa3cdc499938457f544bf9eec332b3670c2b6292

Add explicit namespace to SVGs

view details

push time in 5 days

issue openedvarkor/quiver

SVG export

Currently, quiver draws arrows using SVG, but makes use of a lot of CSS styling, which is badly supported outside of browsers. This makes it difficult to export a diagram as an SVG. Implementing curved arrows (https://github.com/varkor/quiver/issues/5) is going to require rewriting the arrow rendering and we should make sure to use SVG attributes rather than CSS styles, so that it becomes possible to export the entire diagram as an SVG file.

Being able to export to an image format (rather than just LaTeX) would mean quiver could be used as a standalone commutative diagram editor, rather than something that has to be used in conjunction with LaTeX.

created time in 5 days

push eventvarkor/quiver

varkor

commit sha c38f127c0c613c49998a712b07eb8b90260a87d4

Minor cleanup

view details

push time in 5 days

push eventvarkor/quiver

varkor

commit sha 32257da59be8ece1a0db0770017ddabf3fccd1f0

Make a start on different arrow styles

view details

push time in 5 days

push eventvarkor/quiver

varkor

commit sha 9e09772c931fd9bfe26844a0cf11282ebe2b7dbb

Improve the sizing of the bottom panel

view details

varkor

commit sha df97e7649e751cca7b52316f8f2a27f07d50bde9

Add KaTeX manually

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha 9e09772c931fd9bfe26844a0cf11282ebe2b7dbb

Improve the sizing of the bottom panel

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha 9785546919618650ef6769a146fb2c389999bc9a

Improve the sizing of the bottom panel

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha db1097ab830e191ea21fa68343346da080fcba31

Draw the grid with canvas instead of a CSS background This will facilitate the grid rows and columns to be made proportional to the size of their content.

view details

varkor

commit sha cf9fa73cb41bcf3dbdcaaf2a784aee9c6a783322

Fix an issue with the insertion point not disappearing when the cursor is moved

view details

varkor

commit sha f368bf3e778ed8a2c359e1137dfdf9e92bd2283c

Hide the insertion point when panning

view details

varkor

commit sha 34cf36c38d6c58f535baaff80ac4f7330e5ae489

Fix a false error when releasing certain configurations of cells

view details

varkor

commit sha a34cb6ac1039ef8932d65a278700e16f94dceaf4

Add KaTeX manually

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha db1097ab830e191ea21fa68343346da080fcba31

Draw the grid with canvas instead of a CSS background This will facilitate the grid rows and columns to be made proportional to the size of their content.

view details

varkor

commit sha cf9fa73cb41bcf3dbdcaaf2a784aee9c6a783322

Fix an issue with the insertion point not disappearing when the cursor is moved

view details

varkor

commit sha f368bf3e778ed8a2c359e1137dfdf9e92bd2283c

Hide the insertion point when panning

view details

varkor

commit sha 34cf36c38d6c58f535baaff80ac4f7330e5ae489

Fix a false error when releasing certain configurations of cells

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha 44be9fa4fa8968c1afd2c30b4f20b1c9496cb839

Fix a false error when releasing certain configurations of cells

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha 5fea6c9882aa10148895b164e794376721e95832

Hide the insertion point when panning

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha a8db60abe6b993716a2526982d1465745bc44257

Hide the insertion point when panning

view details

push time in 6 days

create barnchvarkor/quiver

branch : long-input

created branch time in 6 days

push eventvarkor/quiver

varkor

commit sha 0a1bff5fa9834d94ff3332c676188280e38d34a0

Fix an issue with the insertion point not disappearing when the cursor is moved

view details

push time in 6 days

create barnchvarkor/quiver

branch : proportional-grid

created branch time in 6 days

push eventvarkor/quiver

varkor

commit sha 84307e6cace5b577e70a9dd15897de2a21a87eca

Draw the grid with canvas instead of a CSS background This will facilitate the grid rows and columns to be made proportional to the size of their content.

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha 94515a88e0c44e04f0fa5d9f899f9838837d7b8c

Draw the grid with canvas instead of a CSS background This will facilitate the grid rows and columns to be made proportional to the size of their content.

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha 59e4dbb6463c59cea3d187ae85ef858c962c289a

Draw the grid with canvas instead of a CSS background This will facilitate the grid rows and columns to be made proportional to the size of their content.

view details

push time in 6 days

push eventvarkor/quiver

varkor

commit sha a7e5bc2289a413610767d20b8c0fd1462e24a62e

Resize SVG appropriately

view details

push time in 7 days

push eventvarkor/quiver

varkor

commit sha b36b67fd6d108eafc9476e8e4b300b8576537054

Special-case flat Bézier curves

view details

push time in 7 days

push eventvarkor/quiver

varkor

commit sha 5be40dffb07b4fc2ffa3aaf5358734eac4b1aaf4

Draw n-cells and arrow heads

view details

push time in 7 days

create barnchvarkor/quiver

branch : arrow

created branch time in 8 days

delete branch varkor/quiver

delete branch : arrows

delete time in 8 days

create barnchvarkor/quiver

branch : arrows

created branch time in 8 days

push eventvarkor/quiver

varkor

commit sha 4133aad9ed9443de59164980b90eaf6f01359769

Fix an issue with overriding default options with solely a cell level

view details

varkor

commit sha a972fea9458446995a6e4497387ab6f736bba513

Add analytics

view details

varkor

commit sha 78d90101946add7a9ec7e383eb9c1c49909bc38b

Round pullback corner angles to nearest 45º This corrects their appearance in rectangles, or in situations where the angle of the arrow is not a clean diagonal.

view details

varkor

commit sha ea7da0cde901885b6517f02de1df0a624b4e9d42

Properly trim tikz-cd output

view details

varkor

commit sha 4bfbf5909186ba2347870eff4bb24154796def4f

Improve handling of edge reconnection between cells of different levels Cell levels are now recalculated and levels are better accounted for when computing padding. Extra padding has also been added in tikz-cd output for 2-cells.

view details

varkor

commit sha 899db67cecdecc8306e386b1042ae38fab0a2987

Work around bug with `description` in tikz-cd output for empty labels

view details

varkor

commit sha fed195580df4762cfb8aceb9d74f8fa5fdbc53a0

wip

view details

push time in 8 days

issue commentrust-lang/rust

ICE when type parameter and const generic are in wrong order

I think this should be fixed by https://github.com/rust-lang/rust/pull/68434.

is8ac

comment created time in 10 days

Pull request review commentrust-lang/rust

Tweak borrow error on `FnMut` when `Fn` is expected

 impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {          err.buffer(&mut self.errors_buffer);     }++    /// Targetted error when encountering an `FnMut` closure where an `Fn` closure was expected.+    fn expected_fn_found_fn_mut_call(&self, err: &mut DiagnosticBuilder<'_>, sp: Span, act: &str) {+        err.span_label(sp, format!("cannot {ACT}", ACT = act));

Let's just use {}: the named parameter doesn't aid readability at all here :P

estebank

comment created time in 10 days

Pull request review commentrust-lang/rust

Tweak borrow error on `FnMut` when `Fn` is expected

 error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure   --> $DIR/borrow-immutable-upvar-mutation.rs:15:27    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _f = to_fn(|| x = 42);-   |                           ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:15:24-   |-LL |         let _f = to_fn(|| x = 42);-   |                        ^^^^^^^^^+   |                  -----    ^^^^^^ cannot assign+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure   --> $DIR/borrow-immutable-upvar-mutation.rs:18:31    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _g = to_fn(|| set(&mut y));-   |                               ^^^^^^ cannot borrow as mutable-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:18:24-   |-LL |         let _g = to_fn(|| set(&mut y));-   |                        ^^^^^^^^^^^^^^+   |                  -----        ^^^^^^ cannot borrow as mutable+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:21:55-   |-LL |         let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });-   |                                                       ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:21:52-   |-LL |         let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });-   |                                                    ^^^^^^^^^+  --> $DIR/borrow-immutable-upvar-mutation.rs:23:22+   |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+...+LL |             to_fn(|| z = 42);+   |             -----    ^^^^^^ cannot assign+   |             |+   |             expects `Fn` instead of `FnMut`  error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:27:32-   |-LL |         let _f = to_fn(move || x = 42);-   |                                ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:27:24+  --> $DIR/borrow-immutable-upvar-mutation.rs:30:32    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _f = to_fn(move || x = 42);-   |                        ^^^^^^^^^^^^^^+   |                  -----         ^^^^^^ cannot assign+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:30:36-   |-LL |         let _g = to_fn(move || set(&mut y));-   |                                    ^^^^^^ cannot borrow as mutable-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:30:24+  --> $DIR/borrow-immutable-upvar-mutation.rs:33:36    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _g = to_fn(move || set(&mut y));-   |                        ^^^^^^^^^^^^^^^^^^^+   |                  -----             ^^^^^^ cannot borrow as mutable+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:33:65+  --> $DIR/borrow-immutable-upvar-mutation.rs:36:65    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });-   |                                                                 ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:33:57-   |-LL |         let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });-   |                                                         ^^^^^^^^^^^^^^+   |                                                   -----         ^^^^^^ cannot assign+   |                                                   |+   |                                                   expects `Fn` instead of `FnMut`++error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure+  --> $DIR/borrow-immutable-upvar-mutation.rs:43:9+   |+LL |   fn foo() -> Box<dyn Fn() -> usize> {+   |      ---      ---------------------- ...to return `FnMut` instead of `Fn`+   |      |+   |      you might have to change this...

The actual text is fine — I'm just inclined to read the topmost line first:

...to return `FnMut` instead of `Fn`
you might have to change this...

when it's intended to be read in the opposite order.

estebank

comment created time in 10 days

push eventvarkor/rust

Camille GILLOT

commit sha 894dc2d3d2b96e1f992324aa95125e0d161ab681

Do not forget to provide queries.

view details

Yuki Okushi

commit sha 19f8c5824f1e431a08cfdfd27b816e48c56b4857

Update Clippy

view details

Oliver Scherer

commit sha 19b9b26986246b92e1f686a9a7b29da42a79ed9f

Early abort validation of arrays of zsts because there is no data to be checked

view details

bors

commit sha 31dd4f4acbcbdb02b0745d2136399ed664a28050

Auto merge of #68088 - oli-obk:fix_miri, r=RalfJung Don't try to force_ptr pointers to zsts r? @RalfJung cc @wesleywiser This is required to fix miri after https://github.com/rust-lang/rust/pull/67501 broke it. The reason only miri sees this is that it uses validation on values during interpretation and not just on the final value of constants, which never contain such values.

view details

Ben Lewis

commit sha a6c4025fac3c3a60581af72998230d46aa6f5ade

perf: eagerly convert literals to consts, this avoids creating loads on unevaluated consts which requires a lot of unnecessary work to evaluate them further down the line.

view details

Ben Lewis

commit sha 02fffc1556e01c64d84d07d0a3ab059a9c7505f8

Code review changes and fix rustdoc test.

view details

bors

commit sha 30ca215b4e38b32aa7abdd635c5e2d56f5724494

Auto merge of #68183 - JohnTitor:clippy-up, r=JohnTitor Update Clippy Fixes #68107 r? @ghost

view details

Yuki Okushi

commit sha d975228cedeaab828e91ab72d4d6fb5ded324de8

Tweak assertion note in fmt

view details

Yuki Okushi

commit sha fd162a48bcd70ba93a039cb7a2bbbcf81a62c748

Rollup merge of #67854 - afnanenayet:afnan/report-external-macro-lints, r=petrochenkov Use `report_in_external_macro` for internal lints Add the option to report lints in external macros for rustc internal lints to resolve #66370

view details

Yuki Okushi

commit sha 9e47ddd399fab91af5eb804727f9f1400a140753

Rollup merge of #67989 - ollie27:rustdoc_unstable, r=GuillaumeGomez rustdoc: Don't allow `#![feature(...)]` on stable or beta Fixes #67647 r? @GuillaumeGomez

view details

Yuki Okushi

commit sha 974b69927b2ca665a414a477717d40320cc7fbbd

Rollup merge of #68036 - euclio:libterm-ncurses6-fix, r=KodrAus libterm: parse extended terminfo format Fixes #45728. Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions. The ideal fix for this would be to migrate libtest to use `termcolor` (https://github.com/rust-lang/rust/issues/60349), but that's blocked for the foreseeable future.

view details

Yuki Okushi

commit sha 7da1dcc3e0eee606b61ac7f7039b39b3332dfb6f

Rollup merge of #68127 - varkor:clarify-extended-option, r=alexcrichton Clarify the relationship between `extended` and `tools` in `config.toml` I.e. `tools` is only effective if `extended = true`. Alternatively, we could make `tools = []` by default and remove `extended` (although we'd want to list the possible options), but improving the description seems sufficient to solve the issue. Fixes https://github.com/rust-lang/rust/issues/61194.

view details

Yuki Okushi

commit sha d7e599203c3d3abbc3be486792a76cb89d3fa067

Rollup merge of #68143 - skinny121:const-param-type-elided-lifetime, r=petrochenkov Forbid elided lifetimes within const generic parameter types Disallows `fn foo<const T: &u32>()`, the lifetime must be explicitly given, i.e. `fn foo<const T: &'static u32>()`. Fixes #67883

view details

Yuki Okushi

commit sha 725f88b09c4fdf718c47439a3fe6a5970d16aaac

Rollup merge of #68150 - tillarnold:master, r=cramertj Document behavior of set_nonblocking on UnixListener The description on `set_nonblocking` in `UnixListener` was rather brief so I adapted it to be more like the documentation of `set_nonblocking` in `TcpListener`.

view details

Yuki Okushi

commit sha 076d6a0c9a6dd53358dbd56ca1aa662325c2df6b

Rollup merge of #68166 - ollie27:rustdoc_help_escape, r=GuillaumeGomez rustdoc: HTML escape arrows on help popup r? @GuillaumeGomez

view details

Yuki Okushi

commit sha d6d5b74fb229685a932a8a470635d3ea2517117c

Rollup merge of #68176 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC Clean up err codes r? @Dylan-DPC

view details

Yuki Okushi

commit sha 7d1cbc7f7cb36eb6148c4bda5528882a3b278449

Rollup merge of #68179 - JohnTitor:nll-scope, r=varkor Remove unneeded scope Now, we can remove this scope.

view details

Yuki Okushi

commit sha b8c0e3129c0db858226f48406f6f8cb6f2a2b066

Rollup merge of #68188 - JohnTitor:tweak-assertion-note, r=Mark-Simulacrum Tweak assertion note in format check It's informative to tell the existence of `--bless` flag if we're running `tidy`.

view details

Yuki Okushi

commit sha 6421127340047130e546af9dc3afb45643cf692f

Update rustc-guide

view details

bors

commit sha c06e4aca19046b07d952b16e9f002bfab38fde6b

Auto merge of #68201 - JohnTitor:rollup-26e39gu, r=JohnTitor Rollup of 10 pull requests Successful merges: - #67854 (Use `report_in_external_macro` for internal lints) - #67989 (rustdoc: Don't allow `#![feature(...)]` on stable or beta) - #68036 (libterm: parse extended terminfo format) - #68127 (Clarify the relationship between `extended` and `tools` in `config.toml`) - #68143 (Forbid elided lifetimes within const generic parameter types) - #68150 (Document behavior of set_nonblocking on UnixListener) - #68166 (rustdoc: HTML escape arrows on help popup) - #68176 (Clean up err codes) - #68179 (Remove unneeded scope) - #68188 (Tweak assertion note in format check) Failed merges: r? @ghost

view details

push time in 10 days

pull request commentrust-lang/rust

Correct inference of primitive operand type behind binary operation

To test cases where there is no expected type (which we expect to error)

Just to clarify, do you mean cases like the following?

let _ = 0 + &0;

This currently passes, as it defaults to i32. Or was a different case supposed to error?

I've added the suggested test cases.

varkor

comment created time in 10 days

push eventvarkor/quiver

varkor

commit sha da78e0fcd6cb92a24caf6bfe5ecd0ef10583f73f

Add a more prominent link to the quiver website in the README

view details

push time in 10 days

pull request commentrust-lang/rust

Split lang_items to crates `rustc_hir` and `rustc_passes`.

Sorry, I haven't had time to look at this. I think it's better to reassign to r? @Zoxc, who suggested the change.

cjgillot

comment created time in 10 days

pull request commentrust-lang/rust

WIP: stability annotations on generic parameters

@Avi-D-coder: sorry, I've been busy lately. I'll try to take a look soon and get back to you.

Avi-D-coder

comment created time in 10 days

pull request commentrust-lang/rust

Improve performance of coherence checks

r=me if perf looks good.

jonas-schievink

comment created time in 10 days

issue openedrust-lang/rust

Revert `compute_const` changes in WF

See https://github.com/rust-lang/rust/pull/56723/files/03b892860da5aff7a10cf4ca1364dbcacb95bfcd#r376641987. Opening this issue so I don't forget about it.

cc @eddyb

created time in 10 days

Pull request review commentrust-lang/rust

Tweak borrow error on `FnMut` when `Fn` is expected

 impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {          err.buffer(&mut self.errors_buffer);     }++    /// Targetted error when encountering an `FnMut` closure where an `Fn` closure was expected.+    fn expected_fn_found_fn_mut_call(&self, err: &mut DiagnosticBuilder<'_>, sp: Span, act: &str) {+        err.span_label(sp, format!("cannot {ACT}", ACT = act));

Any reason for using a named parameter here?

estebank

comment created time in 10 days

Pull request review commentrust-lang/rust

Tweak borrow error on `FnMut` when `Fn` is expected

 error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure   --> $DIR/borrow-immutable-upvar-mutation.rs:15:27    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _f = to_fn(|| x = 42);-   |                           ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:15:24-   |-LL |         let _f = to_fn(|| x = 42);-   |                        ^^^^^^^^^+   |                  -----    ^^^^^^ cannot assign+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure   --> $DIR/borrow-immutable-upvar-mutation.rs:18:31    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _g = to_fn(|| set(&mut y));-   |                               ^^^^^^ cannot borrow as mutable-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:18:24-   |-LL |         let _g = to_fn(|| set(&mut y));-   |                        ^^^^^^^^^^^^^^+   |                  -----        ^^^^^^ cannot borrow as mutable+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:21:55-   |-LL |         let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });-   |                                                       ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:21:52-   |-LL |         let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });-   |                                                    ^^^^^^^^^+  --> $DIR/borrow-immutable-upvar-mutation.rs:23:22+   |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+...+LL |             to_fn(|| z = 42);+   |             -----    ^^^^^^ cannot assign+   |             |+   |             expects `Fn` instead of `FnMut`  error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:27:32-   |-LL |         let _f = to_fn(move || x = 42);-   |                                ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:27:24+  --> $DIR/borrow-immutable-upvar-mutation.rs:30:32    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _f = to_fn(move || x = 42);-   |                        ^^^^^^^^^^^^^^+   |                  -----         ^^^^^^ cannot assign+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:30:36-   |-LL |         let _g = to_fn(move || set(&mut y));-   |                                    ^^^^^^ cannot borrow as mutable-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:30:24+  --> $DIR/borrow-immutable-upvar-mutation.rs:33:36    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _g = to_fn(move || set(&mut y));-   |                        ^^^^^^^^^^^^^^^^^^^+   |                  -----             ^^^^^^ cannot borrow as mutable+   |                  |+   |                  expects `Fn` instead of `FnMut`  error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure-  --> $DIR/borrow-immutable-upvar-mutation.rs:33:65+  --> $DIR/borrow-immutable-upvar-mutation.rs:36:65    |+LL | fn to_fn<A,F:Fn<A>>(f: F) -> F { f }+   |                        - change this to accept `FnMut` instead of `Fn`+... LL |         let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });-   |                                                                 ^^^^^^ cannot assign-   |-help: consider changing this to accept closures that implement `FnMut`-  --> $DIR/borrow-immutable-upvar-mutation.rs:33:57-   |-LL |         let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });-   |                                                         ^^^^^^^^^^^^^^+   |                                                   -----         ^^^^^^ cannot assign+   |                                                   |+   |                                                   expects `Fn` instead of `FnMut`++error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure+  --> $DIR/borrow-immutable-upvar-mutation.rs:43:9+   |+LL |   fn foo() -> Box<dyn Fn() -> usize> {+   |      ---      ---------------------- ...to return `FnMut` instead of `Fn`+   |      |+   |      you might have to change this...

The order of this message seems reversed with the message above.

estebank

comment created time in 10 days

Pull request review commentrust-lang/rust

When suggesting associated fn with type parameters, include in the structured suggestion

 fn missing_items_err(     err.emit(); } +/// Resugar `ty::GenericPredicates` in a way suitable to be used in structured suggestions.+fn bounds_from_generic_predicates(+    tcx: TyCtxt<'_>,+    predicates: ty::GenericPredicates<'_>,+) -> (String, String) {+    let mut types: FxHashMap<Ty<'_>, Vec<DefId>> = FxHashMap::default();+    let mut projections = vec![];+    for (predicate, _) in predicates.predicates {+        debug!("predicate {:?}", predicate);+        match predicate {+            ty::Predicate::Trait(trait_predicate, _) => {+                let entry = types.entry(trait_predicate.skip_binder().self_ty()).or_default();+                let def_id = trait_predicate.skip_binder().def_id();+                if Some(def_id) != tcx.lang_items().sized_trait() {+                    // Type params are `Sized` by default, do not add that restriction to the list+                    // if it is a positive requirement.+                    entry.push(trait_predicate.skip_binder().def_id());+                }+            }+            ty::Predicate::Projection(projection_pred) => {+                projections.push(projection_pred);+            }+            _ => {}+        }+    }+    let generics = if types.is_empty() {+        "".to_string()+    } else {+        format!(+            "<{}>",+            types+                .keys()+                .filter_map(|t| match t.kind {+                    ty::Param(_) => Some(t.to_string()),+                    // Avoid suggesting the following:+                    // fn foo<T, <T as Trait>::Bar>(_: T) where T: Trait, <T as Trait>::Bar: Other {}+                    _ => None,+                })+                .collect::<Vec<_>>()+                .join(", ")+        )+    };+    let mut where_clauses = vec![];+    for (ty, bounds) in types {+        for bound in &bounds {+            where_clauses.push(format!("{}: {}", ty, tcx.def_path_str(*bound)));+        }+    }+    for projection in &projections {+        let p = projection.skip_binder();+        // FIXME: this is not currently supported syntax, we should be looking at the `types` and+        // insert the associated types where they correspond, but for now lets be "lazy" and
        // insert the associated types where they correspond, but for now let's be "lazy" and

Let's open up an issue to fix this once this merges.

estebank

comment created time in 10 days

Pull request review commentrust-lang/rust

Improve `ty.needs_drop`

+//! Check whether a type has (potentially) non-trivial drop glue.++use rustc::ty::subst::Subst;+use rustc::ty::util::{needs_drop_components, AlwaysRequiresDrop};+use rustc::ty::{self, Ty, TyCtxt};+use rustc_data_structures::fx::FxHashSet;+use rustc_hir::def_id::DefId;+use rustc_span::DUMMY_SP;++type NeedsDropResult<T> = Result<T, AlwaysRequiresDrop>;++fn needs_drop_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {+    let adt_fields =+        move |adt_def: &ty::AdtDef| tcx.adt_drop_tys(adt_def.did).map(|tys| tys.iter().copied());+    // If we don't know a type doesn't need drop, say it's a type parameter
    // If we don't know a type doesn't need drop, for example if it's a type parameter
matthewjasper

comment created time in 10 days

Pull request review commentrust-lang/rust

Improve `ty.needs_drop`

 impl<'tcx> ExplicitSelf<'tcx> {         }     } }++/// Returns a list of types such that the given type needs drop if and only if+/// *any* of the returned types need drop. Returns `Err(AlwaysRequiresDrop)` if+/// this type always needs drop.+pub fn needs_drop_components(ty: Ty<'tcx>) -> Result<SmallVec<[Ty<'tcx>; 4]>, AlwaysRequiresDrop> {+    match ty.kind {+        ty::Infer(ty::FreshIntTy(_))+        | ty::Infer(ty::FreshFloatTy(_))+        | ty::Bool+        | ty::Int(_)+        | ty::Uint(_)+        | ty::Float(_)+        | ty::Never+        | ty::FnDef(..)+        | ty::FnPtr(_)+        | ty::Char+        | ty::GeneratorWitness(..)+        | ty::RawPtr(_)+        | ty::Ref(..)+        | ty::Str => Ok(SmallVec::new()),++        // Foreign types can never have destructors+        ty::Foreign(..) => Ok(SmallVec::new()),++        // Pessimistically assume that all generators will require destructors+        // as we don't know if a destructor is a noop or not until after the MIR+        // state transformation pass
        // state transformation pass.
matthewjasper

comment created time in 10 days

Pull request review commentrust-lang/rust

Improve `ty.needs_drop`

 impl<'tcx> ExplicitSelf<'tcx> {         }     } }++/// Returns a list of types such that the given type needs drop if and only if+/// *any* of the returned types need drop. Returns `Err(AlwaysRequiresDrop)` if+/// this type always needs drop.+pub fn needs_drop_components(ty: Ty<'tcx>) -> Result<SmallVec<[Ty<'tcx>; 4]>, AlwaysRequiresDrop> {+    match ty.kind {+        ty::Infer(ty::FreshIntTy(_))+        | ty::Infer(ty::FreshFloatTy(_))+        | ty::Bool+        | ty::Int(_)+        | ty::Uint(_)+        | ty::Float(_)+        | ty::Never+        | ty::FnDef(..)+        | ty::FnPtr(_)+        | ty::Char+        | ty::GeneratorWitness(..)+        | ty::RawPtr(_)+        | ty::Ref(..)+        | ty::Str => Ok(SmallVec::new()),++        // Foreign types can never have destructors
        // Foreign types can never have destructors.
matthewjasper

comment created time in 10 days

Pull request review commentrust-lang/rust

Improve `ty.needs_drop`

+//! Check whether a type has (potentially) non-trivial drop glue.++use rustc::ty::subst::Subst;+use rustc::ty::util::{needs_drop_components, AlwaysRequiresDrop};+use rustc::ty::{self, Ty, TyCtxt};+use rustc_data_structures::fx::FxHashSet;+use rustc_hir::def_id::DefId;+use rustc_span::DUMMY_SP;++type NeedsDropResult<T> = Result<T, AlwaysRequiresDrop>;++fn needs_drop_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {+    let adt_fields =+        move |adt_def: &ty::AdtDef| tcx.adt_drop_tys(adt_def.did).map(|tys| tys.iter().copied());+    // If we don't know a type doesn't need drop, say it's a type parameter+    // without a `Copy` bound, then we conservatively return that it needs+    // drop.+    let res = NeedsDropTypes::new(tcx, query.param_env, query.value, adt_fields).next().is_some();+    debug!("needs_drop_raw({:?}) = {:?}", query, res);+    res+}++struct NeedsDropTypes<'tcx, F> {+    tcx: TyCtxt<'tcx>,+    param_env: ty::ParamEnv<'tcx>,+    query_ty: Ty<'tcx>,+    seen_tys: FxHashSet<Ty<'tcx>>,+    /// A stack of types left to process. Each round, we pop something from the+    /// stack and check if it needs drop. If the result depends on whether some+    /// other types need drop we push them onto the stack.+    unchecked_tys: Vec<(Ty<'tcx>, usize)>,

It would be good to document what the usize represents here.

matthewjasper

comment created time in 10 days

Pull request review commentrust-lang/rust

Improve `ty.needs_drop`

 impl<'tcx> AdtDef {         self.flags.contains(AdtFlags::IS_BOX)     } +    /// Returns `true` if this is ManuallyDrop<T>.
    /// Returns `true` if this is `ManuallyDrop<T>`.
matthewjasper

comment created time in 10 days

Pull request review commentrust-lang/rust

recursion_limit parsing handles overflows

 // just peeks and looks for that attribute.  use crate::session::Session;+use core::num::IntErrorKind;+use rustc::bug; use rustc_span::symbol::{sym, Symbol}; use syntax::ast;  use rustc_data_structures::sync::Once;  pub fn update_limits(sess: &Session, krate: &ast::Crate) {-    update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 128);-    update_limit(krate, &sess.type_length_limit, sym::type_length_limit, 1048576);+    update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);+    update_limit(sess, krate, &sess.type_length_limit, sym::type_length_limit, 1048576); } -fn update_limit(krate: &ast::Crate, limit: &Once<usize>, name: Symbol, default: usize) {+fn update_limit(+    sess: &Session,+    krate: &ast::Crate,+    limit: &Once<usize>,+    name: Symbol,+    default: usize,+) {     for attr in &krate.attrs {         if !attr.check_name(name) {             continue;         }          if let Some(s) = attr.value_str() {-            if let Some(n) = s.as_str().parse().ok() {-                limit.set(n);-                return;+            match s.as_str().parse() {+                Ok(n) => {+                    limit.set(n);+                    return;+                }+                Err(e) => {+                    let mut err = sess.struct_span_err(+                        attr.span,+                        "`recursion_limit` must be a non-negative integer",+                    );++                    let value_span = attr+                        .meta()+                        .and_then(|meta| meta.name_value_literal().cloned())+                        .map(|lit| lit.span)+                        .unwrap_or(attr.span);++                    let error_str = match e.kind() {+                        IntErrorKind::Overflow => "`recursion_limit` is too large",+                        IntErrorKind::Empty => "`recursion_limit` must be a positive integer",
                        IntErrorKind::Empty => "`recursion_limit` must be a non-negative integer",

We were sending mixed messages before.

fisherdarling

comment created time in 10 days

issue openedvarkor/quiver

Proportional grid

At the moment, we only support a square grid cell of a fixed size. This isn't quite how tikz-cd works: instead, rows and columns may be expanded to fit their largest content. This is often not hugely noticeable in quiver, because we resize cell contents to fit the grid, but when cell content is very wide, it becomes difficult to read. We should instead resize the grid like tikz-cd does.

created time in 11 days

issue openedvarkor/quiver

Keyboard controls

There are some keyboard controls in quiver already, but it's not possible to create new objects or arrows solely using the keyboard. Keyboard controls would make using quiver even more efficient and satisfying.

created time in 11 days

issue openedvarkor/quiver

Curved arrows

This is the main feature that quiver is currently missing. It's actually been partially-implemented on a branch (https://github.com/varkor/quiver/tree/curves) for over a year. I just need to get around to finishing it off. The main difficulty is accounting for all of the possible arrow styles, which now need to be potentially curved too. In addition, the circular bounding "boxes" for the vertices doesn't work quite so well with curved edges. image (An example curved arrow from the branch.)

created time in 11 days

issue commentvarkor/quiver

Board games

This issue is off-topic for quiver.

TMVector

comment created time in 11 days

issue closedvarkor/quiver

Arrow formatting is stored in URLs, but not respected when exporting

See this diagram, which contains a 2-cell arrow. However, when exporting to LaTeX, this information is not preserved.

closed time in 11 days

varkor

issue commentvarkor/quiver

Arrow formatting is stored in URLs, but not respected when exporting

Fixed in https://github.com/varkor/quiver/commit/4133aad9ed9443de59164980b90eaf6f01359769.

varkor

comment created time in 11 days

push eventvarkor/quiver

varkor

commit sha 9c805290bc0ab9ea32785885f21a13187afbe73f

Properly trim tikz-cd output

view details

varkor

commit sha 3e39197f5890e69f44f56c2c31f384b4122b17ca

Improve handling of edge reconnection between cells of different levels Cell levels are now recalculated and levels are better accounted for when computing padding. Extra padding has also been added in tikz-cd output for 2-cells.

view details

varkor

commit sha 879f727d0ac2171ddfecb7843ca1ca750a538cd6

Work around bug with `description` in tikz-cd output for empty labels

view details

varkor

commit sha 7e71f7532b7f40add499c7c4eb9c11e01b9deedd

Add KaTeX manually

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha 9c805290bc0ab9ea32785885f21a13187afbe73f

Properly trim tikz-cd output

view details

varkor

commit sha 3e39197f5890e69f44f56c2c31f384b4122b17ca

Improve handling of edge reconnection between cells of different levels Cell levels are now recalculated and levels are better accounted for when computing padding. Extra padding has also been added in tikz-cd output for 2-cells.

view details

varkor

commit sha 879f727d0ac2171ddfecb7843ca1ca750a538cd6

Work around bug with `description` in tikz-cd output for empty labels

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha 899db67cecdecc8306e386b1042ae38fab0a2987

Work around bug with `description` in tikz-cd output for empty labels

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha 4bfbf5909186ba2347870eff4bb24154796def4f

Improve handling of edge reconnection between cells of different levels Cell levels are now recalculated and levels are better accounted for when computing padding. Extra padding has also been added in tikz-cd output for 2-cells.

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha ea7da0cde901885b6517f02de1df0a624b4e9d42

Properly trim tikz-cd output

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha 38b3f6f78ebc7c65eacbf2ff6cac9bf99982c2fd

Round pullback corner angles to nearest 45º This corrects their appearance in rectangles, or in situations where the angle of the arrow is not a clean diagonal.

view details

varkor

commit sha 5bda575d016311b6bc68c32fb57b650c6c23adeb

Add KaTeX manually

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha 38b3f6f78ebc7c65eacbf2ff6cac9bf99982c2fd

Round pullback corner angles to nearest 45º This corrects their appearance in rectangles, or in situations where the angle of the arrow is not a clean diagonal.

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha 78d90101946add7a9ec7e383eb9c1c49909bc38b

Round pullback corner angles to nearest 45º This corrects their appearance in rectangles, or in situations where the angle of the arrow is not a clean diagonal.

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha e502664d6a56e1bfa96f92c8547d32b4959a994e

Add analytics

view details

varkor

commit sha 228489e6630ffcb165dcdb6af444857bfde8329c

Add KaTeX manually

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha e502664d6a56e1bfa96f92c8547d32b4959a994e

Add analytics

view details

push time in 11 days

push eventvarkor/quiver

varkor

commit sha a972fea9458446995a6e4497387ab6f736bba513

Add analytics

view details

push time in 11 days

issue closedvarkor/quiver

Board games

I'm having some friends from work around tonight for boardgames if you wanna come? Starting ~6:30pm.

closed time in 14 days

TMVector

pull request commentrust-lang/rust

Correct inference of primitive operand type behind binary operation

@nikomatsakis: no, I was waiting for the FCP to complete. I'll do so soon.

varkor

comment created time in 15 days

pull request commentrust-lang/rust

recursion_limit parsing handles overflows

@fisherdarling: thanks! Could you squash your commits together? We avoid merge commits in the Rust repo.

fisherdarling

comment created time in 15 days

Pull request review commentrust-lang/rust

recursion_limit parsing handles overflows

 // just peeks and looks for that attribute.  use crate::session::Session;+use core::num::IntErrorKind; use rustc_span::symbol::{sym, Symbol}; use syntax::ast;  use rustc_data_structures::sync::Once;  pub fn update_limits(sess: &Session, krate: &ast::Crate) {-    update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 128);-    update_limit(krate, &sess.type_length_limit, sym::type_length_limit, 1048576);+    update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);+    update_limit(sess, krate, &sess.type_length_limit, sym::type_length_limit, 1048576); } -fn update_limit(krate: &ast::Crate, limit: &Once<usize>, name: Symbol, default: usize) {+fn update_limit(+    sess: &Session,+    krate: &ast::Crate,+    limit: &Once<usize>,+    name: Symbol,+    default: usize,+) {     for attr in &krate.attrs {         if !attr.check_name(name) {             continue;         }          if let Some(s) = attr.value_str() {-            if let Some(n) = s.as_str().parse().ok() {-                limit.set(n);-                return;+            match s.as_str().parse() {+                Ok(n) => {+                    limit.set(n);+                    return;+                }+                Err(e) => {+                    let mut err = sess.struct_span_err(attr.span, "recursion_limit parsing");++                    let value_span = attr+                        .meta()+                        .and_then(|meta| meta.name_value_literal().cloned())+                        .map(|lit| lit.span)+                        .unwrap_or(attr.span);++                    let error_str = match e.kind() {+                        IntErrorKind::Overflow => "the `recursion_limit` is too large",+                        IntErrorKind::Empty => "the `recursion_limit` must be a positive integer",
                        IntErrorKind::Empty => "`recursion_limit` must be a positive integer",
fisherdarling

comment created time in 15 days

Pull request review commentrust-lang/rust

recursion_limit parsing handles overflows

 // just peeks and looks for that attribute.  use crate::session::Session;+use core::num::IntErrorKind; use rustc_span::symbol::{sym, Symbol}; use syntax::ast;  use rustc_data_structures::sync::Once;  pub fn update_limits(sess: &Session, krate: &ast::Crate) {-    update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 128);-    update_limit(krate, &sess.type_length_limit, sym::type_length_limit, 1048576);+    update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);+    update_limit(sess, krate, &sess.type_length_limit, sym::type_length_limit, 1048576); } -fn update_limit(krate: &ast::Crate, limit: &Once<usize>, name: Symbol, default: usize) {+fn update_limit(+    sess: &Session,+    krate: &ast::Crate,+    limit: &Once<usize>,+    name: Symbol,+    default: usize,+) {     for attr in &krate.attrs {         if !attr.check_name(name) {             continue;         }          if let Some(s) = attr.value_str() {-            if let Some(n) = s.as_str().parse().ok() {-                limit.set(n);-                return;+            match s.as_str().parse() {+                Ok(n) => {+                    limit.set(n);+                    return;+                }+                Err(e) => {+                    let mut err = sess.struct_span_err(attr.span, "recursion_limit parsing");++                    let value_span = attr+                        .meta()+                        .and_then(|meta| meta.name_value_literal().cloned())+                        .map(|lit| lit.span)+                        .unwrap_or(attr.span);++                    let error_str = match e.kind() {+                        IntErrorKind::Overflow => "the `recursion_limit` is too large",
                        IntErrorKind::Overflow => "`recursion_limit` is too large",
fisherdarling

comment created time in 15 days

Pull request review commentrust-lang/rust

recursion_limit parsing handles overflows

 // just peeks and looks for that attribute.  use crate::session::Session;+use core::num::IntErrorKind; use rustc_span::symbol::{sym, Symbol}; use syntax::ast;  use rustc_data_structures::sync::Once;  pub fn update_limits(sess: &Session, krate: &ast::Crate) {-    update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 128);-    update_limit(krate, &sess.type_length_limit, sym::type_length_limit, 1048576);+    update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);+    update_limit(sess, krate, &sess.type_length_limit, sym::type_length_limit, 1048576); } -fn update_limit(krate: &ast::Crate, limit: &Once<usize>, name: Symbol, default: usize) {+fn update_limit(+    sess: &Session,+    krate: &ast::Crate,+    limit: &Once<usize>,+    name: Symbol,+    default: usize,+) {     for attr in &krate.attrs {         if !attr.check_name(name) {             continue;         }          if let Some(s) = attr.value_str() {-            if let Some(n) = s.as_str().parse().ok() {-                limit.set(n);-                return;+            match s.as_str().parse() {+                Ok(n) => {+                    limit.set(n);+                    return;+                }+                Err(e) => {+                    let mut err = sess.struct_span_err(attr.span, "recursion_limit parsing");++                    let value_span = attr+                        .meta()+                        .and_then(|meta| meta.name_value_literal().cloned())+                        .map(|lit| lit.span)+                        .unwrap_or(attr.span);++                    let error_str = match e.kind() {+                        IntErrorKind::Overflow => "the `recursion_limit` is too large",+                        IntErrorKind::Empty => "the `recursion_limit` must be a positive integer",+                        IntErrorKind::InvalidDigit => "not a valid integer",+                        IntErrorKind::Underflow => {+                            rustc::bug!("`recursion_limit` should never underflow")

Just for consistency, could you import rustc::bug, so you can just use it as bug! here?

fisherdarling

comment created time in 15 days

Pull request review commentrust-lang/rust

recursion_limit parsing handles overflows

 // just peeks and looks for that attribute.  use crate::session::Session;+use core::num::IntErrorKind; use rustc_span::symbol::{sym, Symbol}; use syntax::ast;  use rustc_data_structures::sync::Once;  pub fn update_limits(sess: &Session, krate: &ast::Crate) {-    update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 128);-    update_limit(krate, &sess.type_length_limit, sym::type_length_limit, 1048576);+    update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);+    update_limit(sess, krate, &sess.type_length_limit, sym::type_length_limit, 1048576); } -fn update_limit(krate: &ast::Crate, limit: &Once<usize>, name: Symbol, default: usize) {+fn update_limit(+    sess: &Session,+    krate: &ast::Crate,+    limit: &Once<usize>,+    name: Symbol,+    default: usize,+) {     for attr in &krate.attrs {         if !attr.check_name(name) {             continue;         }          if let Some(s) = attr.value_str() {-            if let Some(n) = s.as_str().parse().ok() {-                limit.set(n);-                return;+            match s.as_str().parse() {+                Ok(n) => {+                    limit.set(n);+                    return;+                }+                Err(e) => {+                    let mut err = sess.struct_span_err(attr.span, "recursion_limit parsing");

This change doesn't seem to have been made.

fisherdarling

comment created time in 15 days

pull request commentrust-lang/rust

Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues

@yodaldevoid: a second reviewer's opinion on the PR.

varkor

comment created time in 17 days

pull request commentrust-lang/rust

Address inconsistency in using "is" with "declared here"

Looks spurious to me?

@bors retry

varkor

comment created time in 19 days

pull request commentrust-lang/rust

Canonicalize inputs to const eval where needed

This is waiting for a review by @nikomatsakis, who has been at the Mozilla All Hands this week, so I imagine it'll be reviewed next week.

skinny121

comment created time in 19 days

pull request commentrust-lang/rust

Fix a few spelling mistakes

Thanks!

@bors r+ rollup

gorilskij

comment created time in 21 days

issue commentrust-lang/rust

Const generics ICE ("unexpected const parent in type_of_def_id") on const param of method

This is likely https://github.com/rust-lang/rust/issues/64537.

qwerty19106

comment created time in 22 days

Pull request review commentrust-lang/rust

Account for HR lifetimes when suggesting introduction of named lifetime

 crate fn add_missing_lifetime_specifiers_label(                 Applicability::MaybeIncorrect,             );         };-        let suggest_new = |err: &mut DiagnosticBuilder<'_>, sugg| {+        let suggest_new = |err: &mut DiagnosticBuilder<'_>, sugg: &str| {             err.span_label(span, "expected named lifetime parameter"); -            if let Some(generics) = missing_named_lifetime_spots.iter().last() {+            for missing in missing_named_lifetime_spots.iter().rev() {                 let mut introduce_suggestion = vec![];-                introduce_suggestion.push(match &generics.params {-                    [] => (generics.span, "<'lifetime>".to_string()),-                    [param, ..] => (param.span.shrink_to_lo(), "'lifetime, ".to_string()),+                let msg;+                let should_break;+                introduce_suggestion.push(match missing {+                    MissingLifetimeSpot::Generics(generics) => {+                        msg = "consider introducing a named lifetime parameter";+                        should_break = true;+                        match &generics.params {+                            [] => (generics.span, "<'r>".to_string()),+                            [param, ..] => (param.span.shrink_to_lo(), "'r, ".to_string()),+                        }+                    }+                    MissingLifetimeSpot::HRLT { span, span_type } => {+                        msg = "consider introducing a Higher-Ranked lifetime";

"higher-ranked" should not be capitalised.

estebank

comment created time in 22 days

push eventvarkor/rust

Jorge Aparicio

commit sha 470cdf54ac9acee20ab8da46ef7899bae9f58f29

add bare metal ARM Cortex-A targets to rustc -> `rustc --target armv7-none-eabi` will work also build rust-std (rustup) components for them -> `rustup target add armv7-none-eabi` will work

view details

Tobias Kortkamp

commit sha de388032555b697d1b0ef197241886ab90ac39b2

Add -Wl,-znotext to default linker flags to link with lld 9 on FreeBSD 13.0-CURRENT i386 rust-nightly has been failing to link since 2019-12-10 with variations of ``` = note: ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC >>> defined in /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libcompiler_builtins-6570a75fe85f0e1a.rlib(compiler_builtins-6570a75fe85f0e1a.compiler_builtins.2i519eqi-cgu.15.rcgu.o) >>> referenced by std.4xivr03c-cgu.14 >>> std-9bd70afd58e204b7.std.4xivr03c-cgu.14.rcgu.o:(_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h1c78ed6e734a2bfc (.llvm.10122419023709863394)) in archive /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libstd-9bd70afd58e204b7.rlib ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC >>> defined in /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libcompiler_builtins-6570a75fe85f0e1a.rlib(compiler_builtins-6570a75fe85f0e1a.compiler_builtins.2i519eqi-cgu.15.rcgu.o) >>> referenced by std.4xivr03c-cgu.14 >>> std-9bd70afd58e204b7.std.4xivr03c-cgu.14.rcgu.o:(std::io::util::copy::h9115f048f2203467) in archive /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libstd-9bd70afd58e204b7.rlib clang-cpp: error: linker command failed with exit code 1 (use -v to see invocation) error: aborting due to previous error error: could not compile `rustc_macros`. ``` Full log: http://beefy17.nyi.freebsd.org/data/head-i386-default/p523508_s356869/logs/rust-nightly-1.42.0.20200118.log AFAICT it stopped building after bumping compiler_builtins to 0.1.22 in https://github.com/rust-lang/rust/pull/67110.

view details

Yuki Okushi

commit sha 2ecc48ffa17d55ec02f3beb5bb17c718cb439202

Fix ICE #68025

view details

Yuki Okushi

commit sha 0017f495783324b036ffcaafedf7881725ba1e02

Replace `walk_callee` with `consume_expr`

view details

Jorge Aparicio

commit sha a3a077610028c773bffc7a74e6a15faa10d2360d

Merge branch 'master' into bare-metal-cortex-a

view details

Guillaume Gomez

commit sha 12882a8392eb98e870628ffbab4e123b83466adf

Remove usage of global variable "inlined_types"

view details

Tomasz Miąsko

commit sha 6d218db26df424722d13db0ed3babae3cf450bb3

compiletest: Simplify multi-debugger support Previous implementation used a single mode type to store various pieces of otherwise loosely related information: * Whether debuginfo mode is in use or not. * Which debuggers should run in general. * Which debuggers are enabled for particular test case. The new implementation introduces a separation between those aspects. There is a single debuginfo mode parametrized by a debugger type. The debugger detection is performed first and a separate configuration is created for each detected debugger. The test cases are gathered independently for each debugger which makes it trivial to implement support for `ignore` / `only` conditions. Functional changes: * A single `debuginfo` entry point (rather than `debuginfo-cdb`, `debuginfo-gdb+lldb`, etc.). * Debugger name is included in the test name. * Test outputs are placed in per-debugger directory. * Fixed spurious hash mismatch. Previously, the config mode would change from `DebugInfoGdbLldb` (when collecting tests) to `DebugInfoGdb` or `DebugInfoLldb` (when running them) which would affect hash computation. * PYTHONPATH is additionally included in gdb hash. * lldb-python and lldb-python-dir are additionally included in lldb hash.

view details

Guillaume Gomez

commit sha 871e82b7d05435e6dc4ac5d0d4afe54396492ac7

Add aliases attribute check

view details

Mark Rousskov

commit sha 4bb68828de9c424c572a7ec11417660478ca7501

Read metadata from rmeta exclusively, if possible When we're producing an rlib, we do not need anything more than an rmeta file for each of our dependencies (this is indeed utilized by Cargo for pipelining). Previously, we were still storing the paths of possible rlib/dylib crates, which meant that they could still plausibly be accessed. With -Zbinary-dep-depinfo, that meant that Cargo thought that rustc was using both the rlib and an (earlier emitted) rmeta, and so needed a recompile, as the rlib may have finished writing *after* compilation started (for more detail, see issue 68149). This commit changes metadata loading to not store the filepaths of dylib/rlib if we're going to end up creating an rlib only.

view details

Mark Rousskov

commit sha be663bf850fcdcedc678782e5e0945124d5791fb

Correct rmeta/rlib test

view details

Nikita Popov

commit sha 2c0845c6ccfdee7fb255756918a22101376efa7e

Mark __msan_track_origins as an exported symbol for LTO

view details

Tomasz Miąsko

commit sha d8c661a88644ad710e309d3a8f0f27c5f74d705f

Mark __msan_keep_going as an exported symbol for LTO

view details

varkor

commit sha dd0507c054ea27ae836025761908d339a478e0ab

Make `TooGeneric` error in WF checking a proper error `TooGeneric` is encountered during WF checking when we cannot determine that a constant involving a generic parameter will always be evaluated successfully (rather than resulting in an error). In these cases, the burden of proof should be with the caller, so that we can avoid post-monomorphisation tim errors (which was the previous previous behaviour). This commit ensures that this situation produces a proper compiler error, rather than silently ignoring it or ICEing.

view details

Jorge Aparicio

commit sha 8abbd0beae79de5186158a759b08cb73d175b5ad

for now, do not build rust-std for the armv7a-none-eabihf target it needs some upstream changes in the build script of the compiler-builtins crate

view details

Mazdak Farrokhzad

commit sha d47673d3d7351c16aa8528edabfc886d2228fbb0

typeck: use diverges.replace(..)

view details

Mazdak Farrokhzad

commit sha 1240a3180d474f064791686602e324fe683a0645

typeck: remove redundant diverges code

view details

Mazdak Farrokhzad

commit sha 7dceff9b5b2e41855ff3ba2fab3a2ae41e965df5

typeck: remove redundant diverges check

view details

Philipp Gesang

commit sha 5dee7dddf24a022184a743b714b5062e83516a87

Handle methods in try diagnostic The diagnostic for diagnostic for methods and trait provided methods would only show the empty string: error[E0277]: the `?` operator can only be used in that returns `Result` or `Option` (or another type that implements `std::ops::Try`) Handle the missing cases so it reads ``a method'' / ``an async method'' / ``a trait method'' respectively. Signed-off-by: Philipp Gesang <phg@phi-gamma.net>

view details

Eric Huss

commit sha d45d8b1c7b6b725ab9d4f1d987a45a76c7510a47

Update cargo, books

view details

Philipp Gesang

commit sha 02e66baac6882ef30e607d2bca98929f01758957

Test try diagnostics for impl and trait methods Signed-off-by: Philipp Gesang <phg@phi-gamma.net>

view details

push time in 22 days

issue commentrust-lang/rust

Array lengths don't support generic parameters.

@eddyb: I've opened https://github.com/rust-lang/rust/issues/68567 to make sure we don't lose track of that. I'll tackle it soon if no-one else wants to take it.

roblabla

comment created time in 23 days

issue openedrust-lang/rust

`Rvalue::Repeat` should hold a `ty::Const`

fn test<const N: usize>() {
    let array = [0; N];
}

currently fails with error: array lengths can't depend on generic parameters, because we can't tell what concrete value N should take here. This is an artificial limitation: when producing a Rvalue::Repeat, we currently need to provide the length of the array, which is impossible at this stage. cc https://github.com/rust-lang/rust/issues/43408#issuecomment-578526551

created time in 23 days

pull request commentrust-lang/rust

Don't call `tcx.fn_sig` on closures

@bors r+ rollup

Aaron1011

comment created time in 23 days

push eventvarkor/rust

varkor

commit sha 332b61f43e4b09841df50c931940de097c97ee19

Be explicit about whether `GenericArgCountMismatch` arose from a fatal error

view details

push time in 24 days

pull request commentrust-lang/rust

Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues

r? @nikomatsakis for a second opinion (https://github.com/rust-lang/rust/pull/68434#pullrequestreview-346257567)

varkor

comment created time in 24 days

Pull request review commentrust-lang/rust

Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues

 impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {                     let mut err = tcx.sess.struct_span_err(span, msg);                     err.span_note(span_late, note);                     err.emit();-                    reported_late_bound_region_err = Some(true);

It's possible there are interactions with impl Trait that aren't being tested at all. I'll check this.

varkor

comment created time in 24 days

pull request commentrust-lang/rust

Address inconsistency in using "is" with "declared here"

Let's just wait until the branch off.

varkor

comment created time in 25 days

more