Things about Rust, Blockchain
Bancor Protocol Contracts
Stanford C.S 251 学习
pull request commentrust-lang/rust
Benchmark -Zsymbol-mangling-version=v0
Finished benchmarking try commit (a94c448c4353821c56ff2a9158a30ee0554d0590): comparison url.
Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.
Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.
@bors rollup=never @rustbot label: +S-waiting-on-review -S-waiting-on-perf
comment created time in a minute
push eventgolang/go
commit sha 4c835f9169e2b1f98a9755724d1f46bf50566003
[dev.regabi] cmd/compile: use LinksymOffsetExpr in TypePtr/ItabAddr Passes toolstash -cmp. Fixes #43737 Change-Id: I2d5228c0213b5f8742e3cea6fac9bc985b19d78c Reviewed-on: https://go-review.googlesource.com/c/go/+/284122 Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Cuong Manh Le <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
push time in 5 minutes
issue commentgolang/go
testing: calling TempDir() from a Benchmark causes it to fail
We usually only backport changes that are serious bugs that don't have a workaround, and this one has a pretty easy workaround.
comment created time in 19 minutes
push eventgolang/go
commit sha 0ffa1ead6e281932697154d4ea45413b2ba8fa53
[dev.regabi] cmd/compile: use *obj.LSym instead of *ir.Name for staticdata functions Those functions only use (*ir.Name).Linksym(), so just change them to get an *obj.LSym directly. This helps get rid of un-necessary validations that their callers have already done. Passes toolstash -cmp. For #43737. Change-Id: Ifd6c2525e472f8e790940bc167665f9d74dd1bc5 Reviewed-on: https://go-review.googlesource.com/c/go/+/284121 Trust: Cuong Manh Le <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
push time in 24 minutes
pull request commentrust-lang/rust
Might take some juggling but perhaps as an alternative I could backport the commits for the bug fix to the rustfmt-1.4.30 branch in the rustfmt repo. Then rustfmt submod here on beta could stay on the 1.4.30 branch and just pull in the commit, and then do something similar on the RLS maybe in a new branch off whatever's currently in beta?
comment created time in 34 minutes
issue commentethereum/go-ethereum
that is normal behavior as per the yellow paper:
Setting a slot value to 0 is effectively clearing it, in order to save storage space.
Thanks you. I already understand.
comment created time in 39 minutes
pull request commentrust-lang/rust
Make rustdoc lints a tool lint instead of built-in
This page should probably talk about the rustdoc:: prefix: https://github.com/rust-lang/rust/blob/master/src/doc/rustdoc/src/lints.md
It should probably be careful on how it handles MISSING_DOCS. That is already documented in the rustc book, so you could maybe just consider changing it to link to that. Or you could just call out that it doesn't need the rustdoc:: prefix.
Also, I'm uncertain why MISSING_CRATE_LEVEL_DOCS is not being moved. It is not processed by rustc, it is a rustdoc-only lint AFAIK. It seems a little strange to me to have that be the only rustdoc-only lint not prefixed with rustdoc::.
comment created time in an hour
Pull request review commentrust-lang/rust
Implement indexing slices with pairs of core::ops::Bound<usize>
unsafe impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> { (0..=self.end).index_mut(slice) } }++/// Convert pair of `ops::Bound`s into `Range` without performing any bounds checking and (in debug) overflow checking+fn into_range_unchecked(+ len: usize,+ (start, end): (ops::Bound<usize>, ops::Bound<usize>),+) -> ops::Range<usize> {+ let start = match start {+ Bound::Included(i) => i,+ Bound::Excluded(i) => i + 1,+ Bound::Unbounded => 0,+ };+ let end = match end {+ Bound::Included(i) => i + 1,+ Bound::Excluded(i) => i,+ Bound::Unbounded => len,+ };+ Range { start, end }+}++/// Like `check_range` except it returns `None` on invalid ranges.+fn into_maybe_range(
@Kimundi That exists now:
https://doc.rust-lang.org/std/ops/trait.RangeBounds.html#method.assert_len
However, if you'll be using it, you should know that its name might change: #81154
comment created time in an hour
pull request commentrust-lang/rust
Improve design of `assert_len`
The job mingw-check failed! Check out the build log: (web) (plain)
<details><summary><i>Click to see the possible cause of the failure (guessed by this bot)</i></summary>
configure: rust.channel := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions := True
configure: dist.missing-tools := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure:
configure: run `python /checkout/x.py --help`
configure:
---
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.18s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Documenting core v0.0.0 (/checkout/library/core)
error: unresolved link to `slice::get_unchecked`
|
|
776 | /// The returned [`Range`] is safe to pass to [`slice::get_unchecked`] and
| ^^^^^^^^^^^^^^^^^^^^^^ no item named `slice` in scope
|
= note: `-D broken-intra-doc-links` implied by `-D warnings`
error: unresolved link to `slice::get_unchecked_mut`
|
|
777 | /// [`slice::get_unchecked_mut`] for slices with the given range.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `slice` in scope
error: unresolved link to `slice::get_unchecked`
|
|
776 | /// The returned [`Range`] is safe to pass to [`slice::get_unchecked`] and
| ^^^^^^^^^^^^^^^^^^^^^^ no item named `slice` in scope
error: aborting due to 3 previous errors
error: could not document `core`
Caused by:
process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2018 --crate-type lib --crate-name core library/core/src/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/doc --error-format=json --json=diagnostic-rendered-ansi --markdown-css rust.css --markdown-no-toc -Z unstable-options --resource-suffix 1.51.0 --index-page /checkout/src/doc/index.md -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/release/deps --cfg=bootstrap -Dwarnings -Winvalid_codeblock_attributes --crate-version '1.51.0-nightly
(ea4caac36
2021-01-17)'` (exit code: 1)
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/library/test/Cargo.toml" "-p" "core" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "-Z" "unstable-options" "--resource-suffix" "1.51.0" "--index-page" "/checkout/src/doc/index.md"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap doc --stage 0 library/std
Build completed unsuccessfully in 0:00:10
</details>
comment created time in an hour
pull request commentrust-lang/rust
It looks like your local branch is using the wrong rustfmt for some reason, not sure why that would be though. Please file an issue if you can't successfully drop it from this PR so that I can investigate.
comment created time in an hour
push eventparitytech/substrate
commit sha 17cda62526b2bbf2c986cbe08a5c7476b5bcd162
cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs
push time in an hour
pull request commentrust-lang/rust
Add SliceIndex impl for pair of Bounds
I just found this PR, which should add the same impls. It has an active FCP, and it has the same question of what its use case would be.
comment created time in an hour
Pull request review commentparitytech/polkadot
Add an optional verifier to crowdloan
mod benchmarking { let caller: T::AccountId = whitelisted_caller(); let contribution = T::MinContribution::get(); T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());- }: _(RawOrigin::Signed(caller.clone()), fund_index, contribution)+ }: _(RawOrigin::Signed(caller.clone()), fund_index, contribution, None)
I think SR25519 and ED25519 will be all you need here.
comment created time in an hour
pull request commentrust-lang/rust
Remove unused linkcheck exceptions
:pushpin: Commit d5570c2fcbfa29701b5cf2ddf9c49b2f85c2d742 has been approved by Manishearth
<!-- @bors r=Manishearth d5570c2fcbfa29701b5cf2ddf9c49b2f85c2d742 --> <!-- homu: {"type":"Approved","sha":"d5570c2fcbfa29701b5cf2ddf9c49b2f85c2d742","approver":"Manishearth"} -->
comment created time in an hour
pull request commentrust-lang/rust
Remove unused linkcheck exceptions
@bors r+ rollup
comment created time in an hour
pull request commentparitytech/substrate
Freeze Assets and Asset Metadata
Starting benchmark for branch: shawntabrizi-assets-extra-extra (vs master)
Comment will be updated.
comment created time in an hour
pull request commentparitytech/substrate
Freeze Assets and Asset Metadata
/benchmark runtime pallet pallet_assets
comment created time in an hour
pull request commentrust-lang/rust
Make rustdoc lints a tool lint instead of built-in
Are you planning to update the documentation?
What documentation should I update?
Also, there seems to be a stray modification to Cargo.lock.
Oops, fixed, thanks.
comment created time in an hour
issue commentrust-lang/rust
false positive unused_result when passing closure to macro
Additional note: unused_results isn't needed to see if an instance of the Result enum goes unused. Result is marked as must_use, so it should be picked up by the unused_must_use lint, which is set to warn by default.
comment created time in an hour
pull request commentrust-lang/rust
Improve design of `assert_len`
The job mingw-check failed! Check out the build log: (web) (plain)
<details><summary><i>Click to see the possible cause of the failure (guessed by this bot)</i></summary>
configure: rust.channel := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions := True
configure: dist.missing-tools := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure:
configure: run `python /checkout/x.py --help`
configure:
---
Found 435 error codes
Found 0 error codes with no tests
Done!
* 315 features
tidy error: The Unstable Book has a 'library feature' section 'range-bounds-assert-len' which doesn't correspond to an unstable library feature
some tidy checks failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build"
expected success, got: exit code: 1
</details>
comment created time in an hour
push eventparitytech/substrate
commit sha 1727b595c0e03846b5fa8180d810aee489c424e7
missed some usize
push time in an hour
PR closed golang/go
Fixes #43419
pr closed time in an hour
issue commentgolang/go
x/tools/gopls: variable in third party package is not highlighted
Will this issue be fixed in gopls/v1.0.0? @stamblerre
comment created time in an hour
pull request commentrust-lang/rust
The job mingw-check failed! Check out the build log: (web) (plain)
<details><summary><i>Click to see the possible cause of the failure (guessed by this bot)</i></summary>
configure: rust.channel := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions := True
configure: dist.missing-tools := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure:
configure: run `python /checkout/x.py --help`
configure:
---
Checking rand v0.7.3
Checking alloc v0.0.0 (/checkout/library/alloc)
Checking std v0.0.0 (/checkout/library/std)
Checking core v0.0.0 (/checkout/library/core)
error[E0624]: associated function `new` is private
|
|
3567 | let v = Intersperse::new(1..4, 9).fold(Vec::new(), |mut acc, x| {
| ^^^ private associated function
error[E0624]: associated function `new` is private
|
|
3573 | let mut iter = Intersperse::new(1..4, 9);
| ^^^ private associated function
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0624`.
error: could not compile `core`
error: could not compile `core`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "i686-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/library/test/Cargo.toml" "--all-targets" "-p" "test" "-p" "term" "-p" "std" "-p" "alloc" "-p" "unwind" "-p" "core" "-p" "panic_unwind" "-p" "proc_macro" "-p" "panic_abort" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu --all-targets
Build completed unsuccessfully in 0:00:44
</details>
comment created time in an hour
issue commentrust-lang/rust
false positive unused_result when passing closure to macro
This still happens without using macros or closures (playground):
#![warn(unused_results)]
fn dummy() {}
pub fn main() {
&dummy();
}
warning: unused result
--> src/main.rs:6:5
|
6 | &dummy();
| ^^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![warn(unused_results)]
| ^^^^^^^^^^^^^^
This only happens when taking a reference to the result of the function call. unused_results checks if the result of any expression is unused. Presumably, this lint ignores () (which is the type of dummy() and fun()), but not &() (which is the type of &dummy() and &fun())!
I'm not entirely sure what the use case would be for taking a reference to the result of a function call and ignoring it, so the lint is probably correct.
To clarify the lint name, it's not that you're not using a Result, it's that you're not using the result of &fun(). To fix this, you have [at least] two options:
- To make
run_function!return a reference, remove the semicolon:
macro_rules! run_function {
($func: ident) => {{
&$func()
}};
}
- To silence the lint, remove the borrow:
macro_rules! run_function {
($func: ident) => {{
$func();
}};
}
- If you're using this macro on functions that don't return
(), you can place anallowattribute in front of the block (I think)
macro_rules! run_function {
($func: ident) => {
#[allow(unused_results)]
{
&$func();
}
};
}
comment created time in an hour
pull request commentrust-lang/rust
Make rustdoc lints a tool lint instead of built-in
Are you planning to update the documentation?
Also, there seems to be a stray modification to Cargo.lock.
comment created time in an hour
Pull request review commentparitytech/substrate
Freeze Assets and Asset Metadata
pub trait Config: frame_system::Config { /// supports. type AssetDepositPerZombie: Get<BalanceOf<Self>>; + /// The maximum length of a name or symbol stored on-chain.+ type StringLimit: Get<usize>;
ive updated. you are right, u32 is more sensible.
comment created time in an hour
pull request commentrust-lang/rust
The second commit 72dd5a445a3c6663399c86cd33235b5f9e6bd099 is the result of
./x.py fmt run locally. I expected CI catches fmt error. Does something go wrong ? cc @Mark-Simulacrum
comment created time in an hour
issue commentrust-lang/rust
Tracking Issue for range_bounds_assert_len
I created the PR: #81154
comment created time in an hour
pull request commentrust-lang/rust
Make rustdoc lints a tool lint instead of built-in
Makes sense to have the rustdoc lints be scoped to rustdoc::, like the clippy ones are scoped now.
@rfcbot reviewed
comment created time in an hour
