« first day (1399 days earlier)      last day (2083 days later) » 

1:21 AM
Anybody know if there's already an open issue for the badness of this error message?
i.e. it's misleadingly pointing at the trait while saying that an associated type is not Sized
no need to respond immediately, I will be back when it is again daylight in the USA :P
 
 
7 hours later…
8:14 AM
@trentcl type OperatorType: KernelCompute<Self::V>;
without the ?Sized the OperatorType must be Sized.
 
 
3 hours later…
11:34 AM
@kennytm context
Mostly I'm hoping there's already an issue for improving the error message so I don't have to file one
 
 
2 hours later…
1:27 PM
@PeterHall but why is specialization capitalized?
 
2:20 PM
> const BUFFER_SIZE_2048: usize = 2048;
&nrf52::uart::UARTE0.init(uart::UARTParams {
    baud_rate: 115200,
    stop_bits: uart::StopBits::One,
    parity: uart::Parity::None,
    hw_flow_control: false,
});
(guess it's hard to quote code in chat)
These are not encouraging signs for an OS
What do they think that ampersand does there.
At least clippy catches the extra &
 
3:18 PM
@Shepmaster I think of these feature names as Names. Title Case just seems natural. But I have bowed to your wisdom and changed it to lower case.
 
@PeterHall I can almost see it in some cases, but what counts...
Like NLL gets capitalized as an acronym, but we don't capitalize the words when spelled out
 
3:33 PM
@PeterHall If the OP marks it such, I tend to accept it as such.
 
The new one is asking why the bound Self: Sized is not allowed
 
Also, it's @Tim
 
The older one is really about the fact that a dyn Trait is not Sized.
They just happen to have a few words in common
 
@PeterHall Remember that (although unfortunately named), duplicates are about answers, not the Q
 
hm. I don't find that very satisfactory, especially in cases like this, where there is a long answer that explains everything. Redirecting there is the same as directing to the Rust book.
 
4:19 PM
@PeterHall I marked it, because I think the newer one really is about the fact that a dyn Trait is not Sized
If anything, the older one is about why generic methods are not object safe.
 
Tim
Well, it's not an exact duplicate, but with the other answer it's trivial to understand IMO
A trait is not Sized, so if you require the object to be sized and call it on a trait, it can't work. It's required to be Sized due to the other answer.
 
@trentcl Yes, that's what I meant. The linked question has a few answers not really relevant to this one, and one long answer which goes into a lot of detail about object safety. @Tim's question seemed to be about just one part of object safety (forbidding Self: Sized)
 
@Tim Yeah. The questions kind of feed into each other
 
To me, it would be better to keep them separate, but link them in comments or an answer. That way, someone searching for an answer to just "why can't I bound my trait with Self: Sized?", will have the answer rather than having to read that long post.
 
Tim
Surprisingly, this is the first time I use dynamic dispatched traits. Otherwise I was always able to realize it with static dispatches.
@PeterHall I'm fine with that.
I voted for reopen it
 
4:29 PM
@PeterHall I'm unconvinced, because the error in Tim's problem doesn't stem from having a Self: Sized bound (which is fine); it comes from trying to call a method with a Self: Sized bound on a trait object.
And the reason for the Sized bound in the first place is because the method is generic.
 
Ok. But, as posed, the question could be answered along the lines of:

> Methods that take `Self` as an argument, return `Self` or otherwise require `Self: Sized` are not Object safe. That's because methods on a trait object are called via dynamic dispatch and the size of the trait implementation cannot be known at compile time.
Maybe expanded a little. But it's a bit of work to find that same information in the duplicate answer
 
Tim
You may post it when it's open again so future readers don't have to read the full other answer
 
I would also add a link to the other answer because it is very complete
 
Tim
Sure!
go ahead ;)
I don't want to adorn myself with false praise
 
 
1 hour later…
5:45 PM
Ok...
1
Q: How to set the LD_LIBRARY_PATH shell variable in a Rust program so I do not have to type it on the command line?

MateholikerI build a Rust program that calls a C++ function via a C interface. In order to execute the program, I have to run: export LD_LIBRARY_PATH=<path to shared c lib> or I get an error: error while loading shared libraries: libtest.so: cannot open shared object file: No such file or directory I ...

I marked this as duplicate, but I misread OP's answer
but honestly their answer simply doesn't make sense to me.
But they say it works...
So, any opinions on what to do?
 
I.... don't see how that could work. Unless static linking was their problem?
But that doesn't make any sense.
 
When you use cargo run, does the variable set for rustc carry over?
 
@trentcl oh, interesting.
lemme check
nice call, it does!
 
this still seems like a terrible way to do that
 
indeed
I'm guessing it's more brittle than what they want
// build.rs
fn main() {
    println!("cargo:rustc-env=AWESOME=one");
}
//main.rs
fn main() {
    for (k, v) in std::env::vars() {
        println!("{}={}", k, v);
    }
}
$ cargo run | grep AWE
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/wuz`
AWESOME=one
 
 
2 hours later…
8:22 PM
Ok, OP replied
I ask how I could run my program with only typing cargo run so this is the answer. If you want to execute you program without cargo the only two option I see are first: write a script that runs first(you could to this in the build.rs) or second: you add the export LD_LIBRARY_PATH=<path> to the .bashrc file but this is a really bad way of doing it because you cannot set the variable to two different values. — Mateholiker 21 mins ago
So, I guess it's indeed a different question (once I edit in all their subtle requirements)
 
 
2 hours later…
Tim
10:09 PM
@PeterHall Question was opened again ;)
Does anyone know, when a new nightly will be pushed to rustup.rs? (Does it even compile atm?)
 
11:00 PM
@Tim You have to wait for all of Rust, Clippy, Rustfmt, RLS, Miri(?) to build at the same time
It's not something that I think is a great solution, but other people don't like updating nightly and losing e.g. RLS
 
Tim
11:27 PM
@Shepmaster Thanks for the link. Didn't know this repository. Would be cool, if rustup would only wait for installed tools
 

« first day (1399 days earlier)      last day (2083 days later) »