Beautiful diagnostic reporting for text-based programming languages.
CyberSecurityUSC/PCDC-and-SECCDC 7
Resources for PCDC and SECCDC competitions
justinba1010/USCCodeathon-F19-Upper 4
ACM Fall 2019 240/350 Codeathon Problems
JamesPC44/USC_LowerDivision_Fall2018 2
Repository for Fall 2018 problems and solutions for 145/146 problems
human-readable binary encoding
hdamron17/USCCodeathon-S2020-Upper 1
ACM@USC Codeathon problems for Spring 2020
push eventrust-lang/rustc-dev-guide
commit sha bd82b750208a15c4f7bd8b9e2de6c21b9b3be7b6
Revert "Remove outdated build rustdoc --stage 1" This reverts commit cd35d2b5944d8436350b7f2f16f5e720d9912db6.
push time in 11 hours
PR merged rust-lang/rustc-dev-guide
I forgot that --stage 0 is the default; I have it set to --stage 1 by default locally and forgot that it was my specific configuration.
cc @pickfire
pr closed time in 11 hours
issue commentrust-lang/rust
@Davester47 if you can come up with an MCVE for the hang, that would be extremely helpful. Right now all the examples we have require actix.
comment created time in 11 hours
Pull request review commentrust-lang/rustc-dev-guide
Revert "Remove outdated build rustdoc --stage 1"
server. To test these features locally, you can run a local HTTP server, like this: ```bash-$ ./x.py doc library/std+$ ./x.py doc library/std --stage 1
This is already documented: https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#default-stages
comment created time in 12 hours
PR opened rust-lang/rustc-dev-guide
I forgot that --stage 0 is the default; I have it set to --stage 1 by default locally and forgot that it was my specific configuration.
cc @pickfire
pr created time in 12 hours
push eventrust-lang/rustc-dev-guide
commit sha cd35d2b5944d8436350b7f2f16f5e720d9912db6
Remove outdated build rustdoc --stage 1 It builds with stage 1 by default.
push time in 12 hours
PR merged rust-lang/rustc-dev-guide
It builds with stage 1 by default.
r? @jyn514 for correctness
pr closed time in 12 hours
issue commentrust-lang/rust
This looks like a duplicate of https://github.com/rust-lang/rust/issues/75992.
comment created time in 12 hours
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
Should be ready to go :)
comment created time in 13 hours
push eventjyn514/lol-html
commit sha e0eaf6c4234af855d3b77e6cb1731f5f33d0d6fb
Allow using `element!` in a separate expression from `rewrite_str` (#69)
commit sha 3567fcf85fb33f515bd82488ba446cef3ccf2fbe
Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible (#70) * Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible - Add `AsciiCompatibleEncoding` wrapper type - Provide ways to convert between `Ascii...` and `Encoding` - Make `new` infallible - Fix tests, examples, and benches This turned out very well - you only have to worry about fallible conversions if you use an encoding other than the default, which is fairly rare. * Fix C tests and move EncodingError to C Previously, `EncodingError` was part of lol_html proper. Now, it's specific to the C API, which can't pass the rust type `Encoding` and has to pass strings instead.
commit sha 974a98e5158464fdd5f076caeb51d5b6c40eb462
Take `self` in HtmlRewriter::end > IIRC there were some problems with C API because of that. Need to check. This was the error: ``` error[E0507]: cannot move out of `*rewriter` which is behind a mutable reference --> src/rewriter.rs:80:31 | 80 | unwrap_or_ret_err_code! { rewriter.end() }; | ^^^^^^^^ move occurs because `*rewriter` has type `lol_html::HtmlRewriter<'_, rewriter::ExternOutputSink>`, which does not implement the `Copy` trait ``` This commit adds a new `Option` wrapper which allows calling `end()` on a mutable reference. As a side effect, calling `free()` multiple has no effect as long as `end()` was called first. This also removes tests that `end()` panics when call twice, and that `write()` panics when called after `read()`, because they no longer compile: ``` error[E0382]: borrow of moved value: `rewriter` --> src/rewriter/mod.rs:610:13 | 607 | let mut rewriter = create_rewriter(512, |_: &[u8]| {}); | ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:607:53: 607:66]>`, which does not implement the `Copy` trait 608 | 609 | rewriter.end().unwrap(); | ----- `rewriter` moved due to this method call 610 | rewriter.write(b"foo").unwrap(); | ^^^^^^^^ value borrowed here after move error[E0382]: use of moved value: `rewriter` --> src/rewriter/mod.rs:619:13 | 616 | let mut rewriter = create_rewriter(512, |_: &[u8]| {}); | ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:616:53: 616:66]>`, which does not implement the `Copy` trait 617 | 618 | rewriter.end().unwrap(); | ----- `rewriter` moved due to this method call 619 | rewriter.end().unwrap(); | ^^^^^^^^ value used here after move ``` As a small performance benefit, `finished` can be removed, making the rewriter take up slightly less memory from Rust (but not from C).
push time in 13 hours
Pull request review commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
pub extern "C" fn lol_html_rewriter_build( }; let output_sink = ExternOutputSink::new(output_sink, output_sink_user_data);- let rewriter = unwrap_or_ret_null! { HtmlRewriter::try_new(settings, output_sink) };+ let rewriter = unwrap_or_ret_null! { lol_html::HtmlRewriter::try_new(settings, output_sink) }; - to_ptr_mut(rewriter)+ to_ptr_mut(HtmlRewriter(Some(rewriter))) } #[no_mangle] pub extern "C" fn lol_html_rewriter_write(- rewriter: *mut HtmlRewriter<'static, ExternOutputSink>,+ rewriter: *mut HtmlRewriter, chunk: *const c_char, chunk_len: size_t, ) -> c_int { let chunk = to_bytes!(chunk, chunk_len);- let rewriter = to_ref_mut!(rewriter);+ let rewriter = to_ref_mut!(rewriter)+ .0+ .as_mut()+ .expect("cannot call `lol_html_rewriter_write` after calling `end()`"); unwrap_or_ret_err_code! { rewriter.write(chunk) }; 0 } #[no_mangle]-pub extern "C" fn lol_html_rewriter_end(- rewriter: *mut HtmlRewriter<'static, ExternOutputSink>,-) -> c_int {- let rewriter = to_ref_mut!(rewriter);+pub extern "C" fn lol_html_rewriter_end(rewriter: *mut HtmlRewriter) -> c_int {+ let rewriter = to_ref_mut!(rewriter)+ .0+ .take() // Using `take()` allows calling `free()` afterwards (it will be a no-op).+ .expect("cannot call `lol_html_rewriter_end` after calling `end()`");
If this is called after free(), then one of two things happened:
rewriter.0wasNonewhen dropped, soend()was called in the past, so the error message is correct (free() is irrelevant to the panic).rewriter.0wasSomewhen dropped, so this value has already been dropped, so this is UB. In practice, I think the bytes will not be zeroed, so this panic won't execute.
In either case, I don't think there's a need to change the message.
comment created time in 14 hours
pull request commentrust-lang/rust
[x.py setup] Allow setting up git hooks from other worktrees
I think 'seems fine' is good for now, I did test locally that this works. We can always fix issues in follow-ups.
@bors r=mark-simulacrum
comment created time in 16 hours
pull request commentrust-lang/rust
Check for exhaustion in RangeInclusive::contains
Got it, thanks, I didn't realize this was fixing an omission. Looks good to me then :)
Also, wow, Range being an Iterator is very confusing.
comment created time in 16 hours
pull request commentrust-lang/rust
Check for exhaustion in RangeInclusive::contains
I don't know why the end should be treated specially. If you think this is useful, shouldn't it apply to all parts of iteration equally, and let mut iter = 0..5; iter.next(); iter.contains(0) return false?
comment created time in 16 hours
issue commentrust-lang/rust
tuple_fields called on non-tuple
Closing since this is a duplicate.
comment created time in 18 hours
issue closedrust-lang/rust
tuple_fields called on non-tuple
Apologies in advance for not being able to provide a minimal snippet of the code. I'll be willing to give more info, if necessary. Bear in mind that the codebase is not open-source.
<!-- Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->
Code
<code>
Meta
<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. -->
rustc --version --verbose:
rustc 1.49.0-nightly (b1496c6e6 2020-10-18)
binary: rustc
commit-hash: b1496c6e606dd908dd651ac2cce89815e10d7fc5
commit-date: 2020-10-18
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0
Error output
error[E0658]: use of unstable library feature 'entry_insert'
--> api/src/node_actor.rs:147:49
|
147 | m.entry(symbol.clone()).insert(price_ticker);
| ^^^^^^
|
= note: see issue #65225 <https://github.com/rust-lang/rust/issues/65225> for more information
= help: add `#![feature(entry_insert)]` to the crate attributes to enable
error[E0061]: this function takes 5 arguments but 4 arguments were supplied
--> api/src/lib.rs:162:22
|
162 | tokio::spawn(NodeActor::start(pixie_channel, rx, sub, Arc::clone(&re_state)));
| ^^^^^^^^^^^^^^^^ ------------- -- --- --------------------- supplied 4 arguments
| |
| expected 5 arguments
|
note: associated function defined here
--> api/src/node_actor.rs:30:18
|
30 | pub async fn start(
| ^^^^^
31 | (node_tx, node_rx): (ZmqSocket, Receiver<RawMessage>),
| -----------------------------------------------------
32 | mut rx: mpsc::Receiver<Envelope>,
| --------------------------------
33 | sub: ZmqSocket,
| --------------
34 | re_state: Arc<AtomicBool>,
| -------------------------
35 | shared_tickers: crate::SharedTickers,
| ------------------------------------
error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:2138:18: tuple_fields called on non-tuple
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (b1496c6e6 2020-10-18) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C codegen-units=96 -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `[closure@api/src/lib.rs:171:34: 209:6]: std::clone::Clone`
#1 [typeck] type-checking `start`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors; 2 warnings emitted
Some errors have detailed explanations: E0061, E0658.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `api`
<!--
Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your
environment. E.g. RUST_BACKTRACE=1 cargo build.
-->
<details><summary><strong>
<strong></summary>
<p>
thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
0: std::panicking::begin_panic
1: rustc_errors::HandlerInner::bug
2: rustc_errors::Handler::bug
3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
4: rustc_middle::ty::context::tls::with_opt::{{closure}}
5: rustc_middle::ty::context::tls::with_opt
6: rustc_middle::util::bug::opt_span_bug_fmt
7: rustc_middle::util::bug::bug_fmt
8: rustc_middle::ty::sty::<impl rustc_middle::ty::TyS>::tuple_fields
9: rustc_trait_selection::traits::select::SelectionContext::copy_clone_conditions
10: rustc_trait_selection::traits::select::candidate_assembly::<impl rustc_trait_selection::traits::select::SelectionContext>::assemble_candidates
11: rustc_trait_selection::traits::select::candidate_assembly::<impl rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation_no_cache
12: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
13: rustc_query_system::dep_graph::graph::DepGraph<K>::with_anon_task
14: rustc_trait_selection::traits::select::candidate_assembly::<impl rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation
15: rustc_trait_selection::traits::select::SelectionContext::evaluate_stack
16: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_anon_task
18: rustc_trait_selection::traits::select::SelectionContext::evaluate_trait_predicate_recursively
19: rustc_trait_selection::traits::select::SelectionContext::evaluate_predicate_recursively::{{closure}}
20: rustc_trait_selection::traits::select::SelectionContext::evaluate_predicate_recursively
21: rustc_infer::infer::InferCtxt::probe
22: rustc_trait_selection::traits::select::SelectionContext::evaluate_root_obligation
23: rustc_infer::infer::InferCtxtBuilder::enter_with_canonical
24: rustc_traits::evaluate_obligation::evaluate_obligation
25: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::evaluate_obligation>::compute
26: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
27: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
28: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
29: rustc_query_system::query::plumbing::get_query_impl
30: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
31: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
32: rustc_trait_selection::traits::fulfill::FulfillProcessor::process_trait_obligation
33: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
34: rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations
35: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
36: rustc_typeck::check::fn_ctxt::_impl::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::select_obligations_where_possible
37: rustc_infer::infer::InferCtxtBuilder::enter
38: rustc_typeck::check::typeck
39: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck>::compute
40: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
41: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
42: rustc_data_structures::stack::ensure_sufficient_stack
43: rustc_query_system::query::plumbing::get_query_impl
44: rustc_query_system::query::plumbing::ensure_query_impl
45: rustc_typeck::check::typeck_item_bodies
46: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck_item_bodies>::compute
47: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
48: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
49: rustc_data_structures::stack::ensure_sufficient_stack
50: rustc_query_system::query::plumbing::get_query_impl
51: rustc_typeck::check_crate
52: rustc_interface::passes::analysis
53: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
54: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
55: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
56: rustc_data_structures::stack::ensure_sufficient_stack
57: rustc_query_system::query::plumbing::get_query_impl
58: rustc_interface::passes::QueryContext::enter
59: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
60: rustc_span::with_source_map
61: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</p> </details>
closed time in 18 hours
blasrodriissue commentrust-lang/rust
Tracking issue for `X..`, `..X`, and `..=X` (`#![feature(half_open_range_patterns)]`)
This was the exact use case:
// on stable
match delta {
(days, ..) if days > 5 => format!("{}", tm.strftime("%b %d, %Y").unwrap()),
(days @ 2..=5, ..) => format!("{} days ago", days),
(1, ..) => "one day ago".to_string(),
(0, hours, ..) if hours > 1 => format!("{} hours ago", hours),
(0, 1, ..) => "an hour ago".to_string(),
(0, 0, minutes, _) if minutes > 1 => format!("{} minutes ago", minutes),
(0, 0, 1, _) => "one minute ago".to_string(),
(0, 0, 0, seconds) if seconds > 0 => format!("{} seconds ago", seconds),
_ => "just now".to_string(),
};
// on nightly
match delta {
(6.., ..) => format!("{}", tm.strftime("%b %d, %Y").unwrap()),
(days @ 2..=5, ..) => format!("{} days ago", days),
(1, ..) => "one day ago".to_string(),
(0, hours @ 2.., ..) => format!("{} hours ago", hours),
(0, 1, ..) => "an hour ago".to_string(),
(0, 0, minutes @ 2.., _) => format!("{} minutes ago", minutes),
(0, 0, 1, _) => "one minute ago".to_string(),
(0, 0, 0, seconds @ 1..) => format!("{} seconds ago", seconds),
_ => "just now".to_string(),
}
Personally I feel like explicitly adding u/iN::MAX/MIN is probably not too much more writing in practice...
I guess the main difference is that requires you to know what type delta is ... with X.. you'd only have to know {integer}. I'd prefer not to have to think about whether seconds are i32 or i64 or something else. The stable version I posted uses if-guards instead which have the downside you no longer get exhaustiveness checking.
they may have thought of the value as unsigned and not realized it was signed, for example
right - I realized when trying to make this an exhaustive match that this was actually a signed integer when I thought it was unsigned. Actually I think we don't handle the negative case in docs.rs ...
comment created time in 18 hours
issue commentrust-lang/rust
Rust code blocks nested in markdown code blocks are not syntax-highlighted in rustdoc book
Well, in any case, this isn't a rustdoc issue, it's a mdbook issue. Can someone move it there?
comment created time in 20 hours
issue commentrust-lang/rust
Rust code blocks nested in markdown code blocks are not syntax-highlighted in rustdoc book
Personally this doesn't seem like a giant loss to me; the point of these examples is the markdown syntax, not the Rust code itself. I wouldn't mind having the rust highlighted, but if it's hard to do like ehuss mentioned, I'm not sure it's worth it.
comment created time in 20 hours
PR opened rust-lang/rust
Previously, trying to allow this would give another error!
warning: unknown lint: `private_intra_doc_links`
--> private.rs:1:10
|
1 | #![allow(private_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `broken_intra_doc_links`
|
= note: `#[warn(unknown_lints)]` on by default
warning: public documentation for `DocMe` links to private item `DontDocMe`
--> private.rs:2:11
|
2 | /// docs [DontDocMe]
| ^^^^^^^^^ this item is private
|
= note: `#[warn(private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
Fixes the issue found in https://github.com/rust-lang/rust/pull/77249#issuecomment-712339227.
r? @Manishearth
Does anyone know why this additional step is necessary? It seems weird this has to be declared in 3 different places.
pr created time in 20 hours
pull request commentrust-lang/rust
Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints
warning: unknown lint: `private_intra_doc_links`
--> private.rs:1:10
|
1 | #![allow(private_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `broken_intra_doc_links`
|
= note: `#[warn(unknown_lints)]` on by default
warning: public documentation for `DocMe` links to private item `DontDocMe`
--> private.rs:2:11
|
2 | /// docs [DontDocMe]
| ^^^^^^^^^ this item is private
|
= note: `#[warn(private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
Well that's odd.
comment created time in 20 hours
push eventrust-lang/rustc-dev-guide
commit sha 783c5849c45fed6d9fbdd6875483a38ed9531942
Fix typo errros -> errors
push time in 20 hours
push eventJamesPC44/ato20_notes
commit sha ad5cff046830b915b5f92199eff5fe808e94a149
Add contributor-centric systems
push time in 20 hours
push eventJamesPC44/ato20_notes
commit sha c4edbacad3883c6508eca4946759f6535ebe95df
add github actions talk
push time in a day
push eventJamesPC44/ato20_notes
commit sha d381532aa99e7b7a67a1eb99d0b123d5dae020d7
Add microservices talk
push time in a day
push eventJamesPC44/ato20_notes
commit sha 0ad3cc96af70d2e4a8b9364f0fdb186524ad12ae
Add accidental-maintainer chat
push time in a day
pull request commentrust-lang/rust
Add link to rustdoc book in rustdoc help popup
@bors r+ rollup
comment created time in a day
Pull request review commentrust-lang/rust
Add link to rustdoc book in rustdoc help popup
function defocusSearchBar() { addClass(popup, "hidden"); popup.id = "help"; + var book_info = document.createElement("span");+ book_info.innerHTML = "You can find more information on rustdoc in its \+ <a href=\"https://doc.rust-lang.org/rustdoc/\">book</a>.";+
nit: this could be more consice
book_info.innerHTML = "You can find more information in
<a href=\"https://doc.rust-lang.org/rustdoc/\">the rustdoc book</a>.";
comment created time in a day
pull request commenthsivonen/encoding_rs
As an aside, it looks like encoding_rs has been very stable recently, especially since 0.8.11. Have you considered publishing a 1.0 release?
comment created time in a day
pull request commenthsivonen/encoding_rs
..=was stabilized in 1.26: https://github.com/rust-lang/rust/pull/47813/commits/92d1f8d8e4be62e6f4dc32bc57f9d44f53117ec9d- MaybeUninit was stabilized in 1.36: https://doc.rust-lang.org/std/mem/union.MaybeUninit.html
- Removing the loop labels shouldn't affect MSRV.
It looks like encoding_rs currently supports up to 1.29: https://github.com/hsivonen/encoding_rs#0811. So either I can remove the switch to MaybeUninit or the next release should be 0.9 to reflect the breaking change.
comment created time in a day
pull request commenthsivonen/encoding_rs
I couldn't find documentation on the MSRV, but the only code change in 1.0 was a small change to a macro parameter: https://github.com/alexcrichton/cfg-if/compare/0.1.10...1.0.0
comment created time in a day
pull request commentrust-lang/rust-clippy
Enable empty_loop for no_std crates.
In that case someone should r- before bors merges 😆
comment created time in a day
issue commentrust-lang/rust
Tracking issue for `X..`, `..X`, and `..=X` (`#![feature(half_open_range_patterns)]`)
In that case, could we stabilize X.. without stabilizing the others? That seems both more clear and more useful than the other alternatives, since the current stable version is an if guard, while the others can be written with 0..
comment created time in a day
pull request commentrust-lang/rust
Normalize `<X as Y>::T` for rustdoc
Current status: this is blocked on https://github.com/rust-lang/rust/pull/78082 to get the param context, since otherwise the API is different enough from rustc I wouldn't be convinced it had consistent behavior.
comment created time in a day
pull request commentrust-lang/rust
bootstrap: Print units for "finished in xxx" message
@bors rollup
comment created time in 2 days
pull request commentrust-lang/rust
bootstrap: Print units for "finished in xxx" message
@bors r+
comment created time in 2 days
pull request commentrust-lang/rust
Greatly improve display for small mobile devices screens
Again, I'm not sure I'm the best person to review this ... maybe @ollie27 would be a better choice?
That said, the screeenshots do look a lot better :)
comment created time in 2 days
pull request commentdeadlinks/cargo-deadlinks
Always output all errors instead of stopping after the first error
I managed to reproduce the original issue on master (I was on the wrong commit before 🤦) and it does seem to be fixed with this branch. This has no output for me with the changes from this MR:
$ cargo deadlinks 2>a.txt
$ cargo deadlinks 2>b.txt
$ sort a.txt | diff - <(sort b.txt)
Can you try it locally and make sure the only thing different is the ordering? Non-determinism in the ordering doesn't seem exactly a bug to me, just a future enhancement.
comment created time in 2 days
push eventdeadlinks/cargo-deadlinks
commit sha 9f32415f93344c9531f854aac6364fb85095e9ab
update cargo.lock
push time in 2 days
pull request commentdeadlinks/cargo-deadlinks
Always output all errors instead of stopping after the first error
This prints a lot more but i still get different results on different computers.
Parallelism/non-determinism in the files ordering is expected, I can make that an optional feature though. When you say different results, do you mean it's not always catching everything? Or just that it's in a non-deterministic order?
I also noticed now it prints broken links within a single file in a different order each time - not sure it used to do that.
That's strange ... the only parallelism is on the files themselves, not within a file (AFAIK). Unless Handle.children.iter() returns things in a random order? I don't know what deadlinks could do about that if so - maybe I could sort the output before printing it?
comment created time in 2 days
PR opened rust-lang/rust
There's nothing this does that clean can't do. Moving the transformations into clean directly makes it more clear what's going on, and less likely to have data that's inconsistent compared to rustc. It also means that there's no need to have 15 different impl Clean for doctree::X blocks, making it easier to add data to clean::Item (https://github.com/rust-lang/rust/issues/76998).
This will probably end up obsoleting https://github.com/rust-lang/rust/pull/77820, but I haven't actually finished impl Clean for hir::Item 😇 so I won't know until that's done.
Changes from doctree:
renamedwas always None, so no need to carry over
- visit_local_macro <- maybe_inline <- visit_item <- maybe_inline
- imported_from was always None, no need to carry over
- (planned) Crate name should never have been
None; use tcx.sess.crate_name instead.
r? @ghost
pr created time in 2 days
push eventjyn514/rust
commit sha 39f9643998450218d7911a1e8cb3def46b875c41
Remove dead code
push time in 2 days
pull request commentrust-lang/rust
Looks good to me.
r? @ollie27
comment created time in 2 days
pull request commentcloudflare/lol-html
Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible
This is fixable by adding a new error type
Done, I realized I could reuse the existing EncodingError.
comment created time in 2 days
push eventjyn514/lol-html
commit sha e0eaf6c4234af855d3b77e6cb1731f5f33d0d6fb
Allow using `element!` in a separate expression from `rewrite_str` (#69)
commit sha 19706eb50595ae1eacd1ac41214b3724351478a2
Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible - Add `AsciiCompatibleEncoding` wrapper type - Provide ways to convert between `Ascii...` and `Encoding` - Make `new` infallible - Fix tests, examples, and benches This turned out very well - you only have to worry about fallible conversions if you use an encoding other than the default, which is fairly rare.
commit sha e0670b041f04d0d8f4fbf50a07e0a090dfd51d9a
Fix C tests and move EncodingError to C Previously, `EncodingError` was part of lol_html proper. Now, it's specific to the C API, which can't pass the rust type `Encoding` and has to pass strings instead.
push time in 2 days
pull request commentrust-lang/rust
Move orphan module-name/mod.rs files into module-name.rs files
This already has conflicts 😅 Otherwise looks fine to me but I don't work in this part of the compiler.
comment created time in 2 days
Pull request review commentrust-lang/rust
Calculate visibilities once in resolve
error[E0742]: visibilities can only be restricted to ancestor modules- --> $DIR/issue-50493.rs:9:12+ --> $DIR/issue-50493.rs:8:12 | LL | pub(in restricted) field: usize, | ^^^^^^^^^^ -error[E0616]: field `field` of struct `Restricted` is private- --> $DIR/issue-50493.rs:6:10- |-LL | #[derive(Derive)]- | ^^^^^^ private field- |- = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)--error[E0616]: field `field` of struct `Restricted` is private- --> $DIR/issue-50493.rs:6:10- |-LL | #[derive(Derive)]- | ^^^^^^ private field- |- = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
Is this change in the diagnostic intentional?
comment created time in 2 days
Pull request review commentrust-lang/rust
Calculate visibilities once in resolve
pub struct Shell<T> { } pub type Helix_pomatia = Shell<Snail>;-//~^ ERROR crate-visible type `Snail` in public interface-//~| NOTE can't leak crate-visible type+//~^ ERROR private type `Snail` in public interface+//~| NOTE can't leak private type pub type Dermochelys_coriacea = Shell<sea::Turtle>;-//~^ ERROR restricted type `Turtle` in public interface-//~| NOTE can't leak restricted type+//~^ ERROR crate-private type `Turtle` in public interface+//~| NOTE can't leak crate-private type
Are these changes intentional?
comment created time in 2 days
pull request commentrust-lang/rust
@njasm can you open an issue? I agree it's less than ideal, but this PR didn't change very much in that area; it actually made it less crowded because ? no longer shows up.
comment created time in 2 days
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
What we can do instead is consume self on Rust side. But for C API use HtmlRewriterWrapper(Option<HtmlRewriter>) which derefs to rewriter. We'll keep free() which will free the rewriter if it's not None at this point (end() hasn't be called) or will be noop otherwise. And for end() we'll do self.0.take().
I like this! Done :)
comment created time in 2 days
push eventjyn514/lol-html
commit sha 3496131efef5702af60ecb377a47444c82745840
Take `self` in HtmlRewriter::end > IIRC there were some problems with C API because of that. Need to check. This was the error: ``` error[E0507]: cannot move out of `*rewriter` which is behind a mutable reference --> src/rewriter.rs:80:31 | 80 | unwrap_or_ret_err_code! { rewriter.end() }; | ^^^^^^^^ move occurs because `*rewriter` has type `lol_html::HtmlRewriter<'_, rewriter::ExternOutputSink>`, which does not implement the `Copy` trait ``` This commit adds a new `Option` wrapper which allows calling `end()` on a mutable reference. As a side effect, calling `free()` multiple has no effect as long as `end()` was called first. This also removes tests that `end()` panics when call twice, and that `write()` panics when called after `read()`, because they no longer compile: ``` error[E0382]: borrow of moved value: `rewriter` --> src/rewriter/mod.rs:610:13 | 607 | let mut rewriter = create_rewriter(512, |_: &[u8]| {}); | ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:607:53: 607:66]>`, which does not implement the `Copy` trait 608 | 609 | rewriter.end().unwrap(); | ----- `rewriter` moved due to this method call 610 | rewriter.write(b"foo").unwrap(); | ^^^^^^^^ value borrowed here after move error[E0382]: use of moved value: `rewriter` --> src/rewriter/mod.rs:619:13 | 616 | let mut rewriter = create_rewriter(512, |_: &[u8]| {}); | ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:616:53: 616:66]>`, which does not implement the `Copy` trait 617 | 618 | rewriter.end().unwrap(); | ----- `rewriter` moved due to this method call 619 | rewriter.end().unwrap(); | ^^^^^^^^ value used here after move ``` As a small performance benefit, `finished` can be removed, making the rewriter take up slightly less memory from Rust (but not from C).
push time in 2 days
PR closed rust-lang/rust
pr closed time in 2 days
pull request commentrust-lang/rust
crate rhymes with u8, now compiles in 2018 edition
Gotcha, thanks for trying to contribute :) I'll close this then but if you're interested in working in something else I'm happy to help!
comment created time in 2 days
pull request commentrust-lang/rust
Move `slice::check_range` to `RangeBounds`
GitHub Actions has encountered an internal error when running your job.
@bors retry
comment created time in 2 days
pull request commentrust-lang/rust-clippy
Enable empty_loop for no_std crates.
So, after all that, https://github.com/rust-lang/rust/pull/77972 just landed. Maybe we no longer need to sound the alarm on this?
comment created time in 2 days
pull request commentrust-lang/rust
[WIP] Refactor `Binder` to track bound vars
@camelid this is a feature that may have a perf impact, as opposed to a PR that's only for reducing compile time.
comment created time in 2 days
pull request commentrust-lang/rust
[WIP] Refactor `Binder` to track bound vars
@jackh726 FYI you can modify labels yourself with rustbot modify labels: https://forge.rust-lang.org/platforms/zulip/triagebot.html#apply-labels-to-issues
comment created time in 2 days
pull request commentrust-lang/rust
Make sure arenas don't allocate bigger than HUGE_PAGE
Looks like no impact.
comment created time in 2 days
pull request commentrust-lang/rust
crate rhymes with u8, now compiles in 2018 edition
weird-exprs does strange things like this intentionally; just because we can doesn't necessarily mean it's a useful change. Can you explain why this is better than previous behavior?
comment created time in 2 days
pull request commentrust-lang/rust
[WIP] Refactor `Binder` to track bound vars
rebindwas added that should significantly reduce the work we do
@bors try @rust-timer queue
comment created time in 2 days
Pull request review commentrust-lang/rust
Improve wording of "cannot multiply" type error
+fn foo(x: i32, y: f32) -> f32 {+ x * y //~ ERROR cannot multiply `i32` by `f32`+}++fn main() {}
Do you need this new test case? This is tested in plenty of other places.
comment created time in 2 days
pull request commentcloudflare/lol-html
Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible
This is currently broken because unwrap_or_ret_err (unstandably) requires a reasonable error to store in LAST_ERROR and right now I'm only giving it (). This is fixable by adding a new error type but I'm probably not going to get around to it any time soon.
comment created time in 2 days
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
A better idea @cuviper thought of is to have write(self) -> Self instead of taking &mut self; that way whenever you have a Rewriter it will be a fresh expression, so you'll always get the must_use lint. That's a pretty invasive change though and will require lots more ptr::read(), so probably not worth it, but still worth considering.
comment created time in 2 days
push eventjyn514/lol-html
commit sha 9b67e25119880b89bb2f9b2ec3e5054778c4a9b6
[WIP] fix C tests This is broken because I need to come up with a better error for C than `()`.
push time in 2 days
push eventjyn514/lol-html
commit sha 5dfedf713599a08c0cfb597050aa2533997c3ba9
Allow using `element!` in a separate expression from `rewrite_str`
push time in 2 days
push eventjyn514/lol-html
commit sha 89bbbb73aa89d8bc668fbfd68fe4221a3263ad3d
Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible - Add `AsciiCompatibleEncoding` wrapper type - Provide ways to convert between `Ascii...` and `Encoding` - Make `new` infallible - Fix tests, examples, and benches This turned out very well - you only have to worry about fallible conversions if you use an encoding other than the default, which is fairly rare.
push time in 2 days
push eventjyn514/lol-html
commit sha 1edee0d0d8a7c4272dc9fef43cccdb8826fc33c3
Allow using `element!` in a separate expression from `rewrite_str`
push time in 2 days
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
The closest thing I found was an abandoned discussion on internals.rlo https://internals.rust-lang.org/t/idea-attributes-to-warn-if-value-is-dropped-without-being-acted-upon/10485/19 which suggests a 'proof of work' to make sure end() is actually called. That seems like a pretty big burden to force to the user though, really I just want a lint.
comment created time in 2 days
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
Ooh, I can make this must_use too, that way the compiler warns you if you forget to call end().
Hmm, this didn't actually work because .write() counts as a 'use'. I wish there was something like must_consume.
comment created time in 2 days
PR opened cloudflare/lol-html
- Add
AsciiCompatibleEncodingwrapper type - Provide ways to convert between
Ascii...andEncoding - Make
newinfallible - Fix tests, examples, and benches
This turned out very well - you only have to worry about fallible conversions if you use an encoding other than the default, which is fairly rare.
This is a breaking change.
Closes https://github.com/cloudflare/lol-html/issues/46.
pr created time in 3 days
push eventjyn514/lol-html
commit sha a95419d2a1c134e052b51b2257ac130afd49e8c0
Refactor HTMLRewriter Settings to make `HTMLRewriter::new` infallible - Add `AsciiCompatibleEncoding` wrapper type - Provide ways to convert between `Ascii...` and `Encoding` - Make `new` infallible - Fix tests, examples, and benches This turned out very well - you only have to worry about fallible conversions if you use an encoding other than the default, which is fairly rare.
push time in 3 days
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
Ooh, I can make this must_use too, that way the compiler warns you if you forget to call end().
comment created time in 3 days
startedcloudflare/lol-html
started time in 3 days
PR opened cloudflare/lol-html
Closes https://github.com/cloudflare/lol-html/issues/55. This is a breaking change.
pr created time in 3 days
push eventjyn514/lol-html
commit sha 22acfc243ea491e8f7bd185b28cc90f0637bdd3a
Take `self` in HtmlRewriter::end > IIRC there were some problems with C API because of that. Need to check. This was the error: ``` error[E0507]: cannot move out of `*rewriter` which is behind a mutable reference --> src/rewriter.rs:80:31 | 80 | unwrap_or_ret_err_code! { rewriter.end() }; | ^^^^^^^^ move occurs because `*rewriter` has type `lol_html::HtmlRewriter<'_, rewriter::ExternOutputSink>`, which does not implement the `Copy` trait ``` This commit combines `end()` and `free()` into the same function for the C API. It also removes tests that `end()` panics when call twice, and that `write()` panics when called after `read()`, because they no longer compile: ``` error[E0382]: borrow of moved value: `rewriter` --> src/rewriter/mod.rs:610:13 | 607 | let mut rewriter = create_rewriter(512, |_: &[u8]| {}); | ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:607:53: 607:66]>`, which does not implement the `Copy` trait 608 | 609 | rewriter.end().unwrap(); | ----- `rewriter` moved due to this method call 610 | rewriter.write(b"foo").unwrap(); | ^^^^^^^^ value borrowed here after move error[E0382]: use of moved value: `rewriter` --> src/rewriter/mod.rs:619:13 | 616 | let mut rewriter = create_rewriter(512, |_: &[u8]| {}); | ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:616:53: 616:66]>`, which does not implement the `Copy` trait 617 | 618 | rewriter.end().unwrap(); | ----- `rewriter` moved due to this method call 619 | rewriter.end().unwrap(); | ^^^^^^^^ value used here after move ``` As a small performance benefit, `finished` can be removed, making the rewriter take up slightly less memory.
push time in 3 days
pull request commentcloudflare/lol-html
Take `self` in HtmlRewriter::end
This commit combines end() and free() into the same function for the C API.
Note that free() still causes memory unsafety if called twice on the same pointer, so if there was anywhere calling end() twice before, it will now have UB instead of causing a panic. All the call sites should be audited to make sure they call free() exactly once. This is only relevant for C, since in Rust calling end() twice will be a compile error.
comment created time in 3 days
PR opened cloudflare/lol-html
IIRC there were some problems with C API because of that. Need to check.
This was the error:
error[E0507]: cannot move out of `*rewriter` which is behind a mutable reference
--> src/rewriter.rs:80:31
|
80 | unwrap_or_ret_err_code! { rewriter.end() };
| ^^^^^^^^ move occurs because `*rewriter` has type `lol_html::HtmlRewriter<'_, rewriter::ExternOutputSink>`, which does not implement the `Copy` trait
This commit combines end() and free() into the same function for the
C API. It also removes tests that end() panics when call twice, and
that write() panics when called after read(), because they no longer
compile:
error[E0382]: borrow of moved value: `rewriter`
--> src/rewriter/mod.rs:610:13
|
607 | let mut rewriter = create_rewriter(512, |_: &[u8]| {});
| ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:607:53: 607:66]>`, which does not implement the `Copy` trait
608 |
609 | rewriter.end().unwrap();
| ----- `rewriter` moved due to this method call
610 | rewriter.write(b"foo").unwrap();
| ^^^^^^^^ value borrowed here after move
error[E0382]: use of moved value: `rewriter`
--> src/rewriter/mod.rs:619:13
|
616 | let mut rewriter = create_rewriter(512, |_: &[u8]| {});
| ------------ move occurs because `rewriter` has type `rewriter::HtmlRewriter<'_, [closure@src/rewriter/mod.rs:616:53: 616:66]>`, which does not implement the `Copy` trait
617 |
618 | rewriter.end().unwrap();
| ----- `rewriter` moved due to this method call
619 | rewriter.end().unwrap();
| ^^^^^^^^ value used here after move
As a small performance benefit, finished can be removed, making the
rewriter take up slightly less memory.
Closes https://github.com/cloudflare/lol-html/issues/59. I didn't run the Rust tests because of https://github.com/rustation/pre-commit/issues/2, but the C tests all pass.
This is a breaking change.
pr created time in 3 days